Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix UUID reference in simulated_scatter.py and blender_utils.py #16

Merged
merged 2 commits into from
May 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading