Skip to content

Commit

Permalink
Merge pull request #343 from princeton-vl/static_asset_bug
Browse files Browse the repository at this point in the history
bugfix static asset hierarchy collapse
  • Loading branch information
pvl-bot authored Jan 8, 2025
2 parents f932960 + 34753ca commit 91a6f02
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions infinigen/assets/static_assets/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,11 @@ def collapse_hierarchy(root_obj):
mesh_objects = []

def process_object(obj, parent=None):
new_obj = obj
if obj.type != "MESH":
new_obj = create_empty_mesh_object(obj.name, parent)
new_obj.matrix_world = obj.matrix_world
else:
if parent:
new_obj.parent = parent
new_obj = create_empty_mesh_object(obj.name, parent)
new_obj.matrix_world = obj.matrix_world

if obj.type == "MESH":
new_obj.data = obj.data.copy()

mesh_objects.append(new_obj)

Expand All @@ -54,9 +52,9 @@ def process_object(obj, parent=None):

bpy.context.view_layer.objects.active = mesh_objects[0]
bpy.ops.object.join()

final_obj = bpy.context.active_object

# Delete the original hierarchy
butil.delete(list(butil.iter_object_tree(root_obj)))

return final_obj

0 comments on commit 91a6f02

Please sign in to comment.