Skip to content

Commit 3bcea02

Browse files
authored
Update import_agr.py
1 parent 0df4207 commit 3bcea02

File tree

1 file changed

+24
-16
lines changed

1 file changed

+24
-16
lines changed

advancedfx/import_agr.py

+24-16
Original file line numberDiff line numberDiff line change
@@ -325,28 +325,31 @@ def execute(self, context):
325325

326326
self.errorReport("Error report")
327327

328-
for i in bpy.data.objects:
329-
# Delete smd_bone_vis
330-
if i.name.find("smd_bone_vis") != -1:
331-
bpy.data.objects.remove(i)
332-
333-
for i in bpy.data.objects:
334-
# Delete physics objects
335-
if i.name.find("physics") != -1:
336-
bpy.data.objects.remove(i)
337-
338-
for i in bpy.data.collections:
339-
# Delete physics collections
340-
if i.name.find("physics") != -1:
341-
bpy.data.collections.remove(i)
342-
343328
return {'FINISHED'}
344329

345330

346331
def invoke(self, context, event):
347332
bpy.context.window_manager.fileselect_add(self)
348333
return {'RUNNING_MODAL'}
349334

335+
def Physicsr(self):
336+
for i in bpy.data.objects:
337+
# Delete smd_bone_vis
338+
if i.name.find("smd_bone_vis") != -1:
339+
bpy.data.objects.remove(i)
340+
341+
for i in bpy.data.objects:
342+
# Delete physics objects
343+
if i.name.find("physics") != -1:
344+
bpy.data.objects.remove(i)
345+
346+
for i in bpy.data.collections:
347+
# Delete physics collections
348+
if i.name.find("physics") != -1:
349+
bpy.data.collections.remove(i)
350+
351+
return {'TEST'}
352+
350353
def importModel(self, context, modelHandle):
351354
filePath = self.assetPath.rstrip("/\\") + "/" +modelHandle.modelName
352355
filePath = os.path.splitext(filePath)[0]
@@ -383,7 +386,12 @@ def importModel(self, context, modelHandle):
383386
for bone in a.pose.bones:
384387
if bone.rotation_mode != 'QUATERNION':
385388
bone.rotation_mode = 'QUATERNION'
386-
389+
390+
# noPhysics:
391+
# thanks to Darkhandrob for letting Devostated know how blind he is
392+
if self.noPhysics:
393+
self.Physicsr()
394+
387395
# Scale:
388396

389397
a.scale[0] = self.global_scale

0 commit comments

Comments
 (0)