Closes #3: Remove orphans block in loops
This commit is contained in:
parent
de3d517a57
commit
f31a71ca04
@ -737,6 +737,10 @@ class ExportMyFormat(bpy.types.Operator, ExportHelper):
|
||||
|
||||
for o in bpy.data.objects:
|
||||
|
||||
# If orphan, ignore
|
||||
if o.users == 0:
|
||||
continue
|
||||
|
||||
if o.type == 'CAMERA' and o.data.get('isDefault'):
|
||||
|
||||
defaultCam = o.name
|
||||
@ -1264,6 +1268,10 @@ class ExportMyFormat(bpy.types.Operator, ExportHelper):
|
||||
|
||||
for l in bpy.data.lamps:
|
||||
|
||||
# If orphan, get on with it
|
||||
if l.users == 0:
|
||||
continue
|
||||
|
||||
LCM.append( str( int( l.color.r * 4096 ) if l.color.r else 0 ) )
|
||||
|
||||
LCM.append( str( int( l.color.g * 4096 ) if l.color.g else 0 ) )
|
||||
@ -1304,6 +1312,10 @@ class ExportMyFormat(bpy.types.Operator, ExportHelper):
|
||||
|
||||
for m in bpy.data.meshes:
|
||||
|
||||
# If orphan, ignore
|
||||
if m.users == 0:
|
||||
continue
|
||||
|
||||
if not m.get('isPortal') :
|
||||
|
||||
# Store vertices coordinates by axis to find max/min coordinates
|
||||
@ -2332,6 +2344,10 @@ class ExportMyFormat(bpy.types.Operator, ExportHelper):
|
||||
|
||||
for o in bpy.data.objects:
|
||||
|
||||
# If orphan, ignore
|
||||
if o.users == 0:
|
||||
continue
|
||||
|
||||
# Only loop through meshes
|
||||
|
||||
if o.type == 'MESH' and not o.data.get('isPortal'):
|
||||
|
Loading…
x
Reference in New Issue
Block a user