Skip to content

Commit

Permalink
Merge branch 'Development' into node-groups
Browse files Browse the repository at this point in the history
  • Loading branch information
pragma37 committed Nov 27, 2023
2 parents 88f0a1e + af3bf2b commit 5394d82
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions BlenderMalt/MaltRenderEngine.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ def flatten_matrix(matrix):

#Objects
def add_object(obj, matrix, id):
if obj.display_type in ['TEXTURED','SOLID'] and obj.type in ('MESH','CURVE','SURFACE','META', 'FONT'):
if obj.type in ('MESH','CURVE','SURFACE','META', 'FONT'):
name = MaltMeshes.get_mesh_name(obj)
if depsgraph.mode == 'RENDER':
name = '___F12___' + name
Expand Down Expand Up @@ -191,14 +191,20 @@ def add_object(obj, matrix, id):

is_f12 = depsgraph.mode == 'RENDER'

def visible_display(obj):
return obj.display_type in ('TEXTURED','SOLID') or obj.type == 'LIGHT'

for obj in depsgraph.objects:
if is_f12 or obj.visible_in_viewport_get(context.space_data):
if is_f12 or (visible_display(obj) and obj.visible_in_viewport_get(context.space_data)):
id = xxhash.xxh3_64_intdigest(obj.name_full.encode()) % (2**16)
add_object(obj, obj.matrix_world, id)

for instance in depsgraph.object_instances:
if instance.instance_object:
if is_f12 or instance.parent.visible_in_viewport_get(context.space_data):
obj = instance.instance_object
parent = instance.parent
if is_f12 or (visible_display(obj) and visible_display(parent) and
parent.visible_in_viewport_get(context.space_data)):
id = abs(instance.random_id) % (2**16)
add_object(instance.instance_object, instance.matrix_world, id)

Expand Down

0 comments on commit 5394d82

Please sign in to comment.