Skip to content

Commit

Permalink
Fix UUID reference in simulated_scatter.py and blender_utils.py (#16)
Browse files Browse the repository at this point in the history
* Fix UUID reference in simulated_scatter.py and blender_utils.py

* Bump version to 1.2.4 in pyproject.toml
  • Loading branch information
aelmiger committed May 7, 2024
1 parent 9057052 commit 3be04d1
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ readme = "README.md"
requires-python = ">=3.8"
license = {text = "GPLv3"}

version = "1.2.3"
version = "1.2.4"

dynamic = ["dependencies"]

Expand Down
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 3be04d1

Please sign in to comment.