Skip to content

Commit

Permalink
Fix UUID reference in simulated_scatter.py and blender_utils.py
Browse files Browse the repository at this point in the history
  • Loading branch information
aelmiger committed May 2, 2024
1 parent 9057052 commit 44a79cb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions syclops/blender/plugins/simulated_scatter.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def _simulate_convex_objects(self, scatter_points: np.array):
new_conv_hull
)
new_conv_hull["PARENT_UUID_COPY"] = conv_hull["PARENT_UUID"]
del new_conv_hull["UUID"]
del new_conv_hull["POINTER_UUID"]
del new_conv_hull["PARENT_UUID"]
self.instanced_conv_hulls.append(utility.ObjPointer(new_conv_hull))
# Delete Parent UUID to prevent further copying
Expand Down Expand Up @@ -129,7 +129,7 @@ def _simulate_convex_objects(self, scatter_points: np.array):
final_collection = utility.create_collection(self.config["name"] + "_Final")

for parent_uuid, poses in obj_poses.items():
parent_obj = utility.filter_objects("UUID", parent_uuid)[0]
parent_obj = utility.filter_objects("POINTER_UUID", parent_uuid)[0]
for pose in poses:
# Creater instance object
instance_object = parent_obj.copy()
Expand Down
6 changes: 3 additions & 3 deletions syclops/utility/blender_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -299,10 +299,10 @@ def write_uuid_to_obj(
str: UUID of object.
"""
if self.type == "OBJECT":
if "UUID" in obj:
return obj["UUID"]
if "POINTER_UUID" in obj:
return obj["POINTER_UUID"]
ob_id = str(uuid.uuid4())
obj["UUID"] = ob_id
obj["POINTER_UUID"] = ob_id
elif self.type == "COLLECTION":
ob_id = obj.name
return ob_id
Expand Down

0 comments on commit 44a79cb

Please sign in to comment.