@@ -118,6 +118,7 @@ class A3OB_OT_proxy_extract(bpy.types.Operator):
118118 first_lod_only : bpy .props .BoolProperty (default = True )
119119 translate_selections : bpy .props .BoolProperty ()
120120 cleanup_empty_selections : bpy .props .BoolProperty ()
121+ sections : bpy .props .EnumProperty (items = (("PRESERVE" , "" , "" ),), default = "PRESERVE" )
121122 absolute_paths : bpy .props .BoolProperty (default = True )
122123 filepath : bpy .props .StringProperty ()
123124
@@ -136,6 +137,11 @@ def execute(self, context):
136137 with open (self .filepath , "rb" ) as file :
137138 try :
138139 lod_objects = import_p3d .read_file (self , context , file )
140+ imported_object = lod_objects [0 ]
141+ imported_object .matrix_world = proxy_object .matrix_world
142+ imported_object .name = os .path .basename (self .filepath )
143+ imported_object .data .name = os .path .basename (self .filepath )
144+ bpy .data .meshes .remove (proxy_object .data )
139145 self .report ({'INFO' }, "Successfully extracted proxy (check the logs in the system console)" )
140146 except struct .error as ex :
141147 self .report ({'ERROR' }, "Unexpected EndOfFile (check the system console)" )
@@ -144,12 +150,6 @@ def execute(self, context):
144150 self .report ({'ERROR' }, "%s (check the system console)" % ex )
145151 traceback .print_exc ()
146152
147- imported_object = lod_objects [0 ]
148- imported_object .matrix_world = proxy_object .matrix_world
149- imported_object .name = os .path .basename (self .filepath )
150- imported_object .data .name = os .path .basename (self .filepath )
151- bpy .data .meshes .remove (proxy_object .data )
152-
153153 return {'FINISHED' }
154154
155155
0 commit comments