Skip to content

Commit 5394d82

Browse files
committed
Merge branch 'Development' into node-groups
2 parents 88f0a1e + af3bf2b commit 5394d82

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

BlenderMalt/MaltRenderEngine.py

+9-3
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ def flatten_matrix(matrix):
100100

101101
#Objects
102102
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'):
104104
name = MaltMeshes.get_mesh_name(obj)
105105
if depsgraph.mode == 'RENDER':
106106
name = '___F12___' + name
@@ -191,14 +191,20 @@ def add_object(obj, matrix, id):
191191

192192
is_f12 = depsgraph.mode == 'RENDER'
193193

194+
def visible_display(obj):
195+
return obj.display_type in ('TEXTURED','SOLID') or obj.type == 'LIGHT'
196+
194197
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)):
196199
id = xxhash.xxh3_64_intdigest(obj.name_full.encode()) % (2**16)
197200
add_object(obj, obj.matrix_world, id)
198201

199202
for instance in depsgraph.object_instances:
200203
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)):
202208
id = abs(instance.random_id) % (2**16)
203209
add_object(instance.instance_object, instance.matrix_world, id)
204210

0 commit comments

Comments
 (0)