@@ -100,7 +100,7 @@ def flatten_matrix(matrix):
100
100
101
101
#Objects
102
102
def add_object (obj , matrix , id ):
103
- if obj .display_type in [ 'TEXTURED' , 'SOLID' ] and obj . type in ('MESH' ,'CURVE' ,'SURFACE' ,'META' , 'FONT' ):
103
+ if obj .type in ('MESH' ,'CURVE' ,'SURFACE' ,'META' , 'FONT' ):
104
104
name = MaltMeshes .get_mesh_name (obj )
105
105
if depsgraph .mode == 'RENDER' :
106
106
name = '___F12___' + name
@@ -191,14 +191,20 @@ def add_object(obj, matrix, id):
191
191
192
192
is_f12 = depsgraph .mode == 'RENDER'
193
193
194
+ def visible_display (obj ):
195
+ return obj .display_type in ('TEXTURED' ,'SOLID' ) or obj .type == 'LIGHT'
196
+
194
197
for obj in depsgraph .objects :
195
- if is_f12 or obj .visible_in_viewport_get (context .space_data ):
198
+ if is_f12 or ( visible_display ( obj ) and obj .visible_in_viewport_get (context .space_data ) ):
196
199
id = xxhash .xxh3_64_intdigest (obj .name_full .encode ()) % (2 ** 16 )
197
200
add_object (obj , obj .matrix_world , id )
198
201
199
202
for instance in depsgraph .object_instances :
200
203
if instance .instance_object :
201
- if is_f12 or instance .parent .visible_in_viewport_get (context .space_data ):
204
+ obj = instance .instance_object
205
+ parent = instance .parent
206
+ if is_f12 or (visible_display (obj ) and visible_display (parent ) and
207
+ parent .visible_in_viewport_get (context .space_data )):
202
208
id = abs (instance .random_id ) % (2 ** 16 )
203
209
add_object (instance .instance_object , instance .matrix_world , id )
204
210
0 commit comments