Skip to content

Commit

Permalink
fix: [Blender 4] fix an error when hydrating cutter utilities with th…
Browse files Browse the repository at this point in the history
…e clear-parent option selected
  • Loading branch information
tristan-hm committed Feb 24, 2024
1 parent 4a47be7 commit 3fb0b05
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion booleans/hydrate.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,11 @@ def finish(self, context):
new_objects.append((new_obj, obj))

if self.clear_parent:
bpy.ops.object.parent_clear({'object': new_obj}, type='CLEAR_KEEP_TRANSFORM')
if bpy.app.version < (4, 0, 0):
bpy.ops.object.parent_clear({'object': new_obj}, type='CLEAR_KEEP_TRANSFORM')
else:
with bpy.context.temp_override(object=new_obj):
bpy.ops.object.parent_clear(type='CLEAR_KEEP_TRANSFORM')

bpy.ops.object.select_all(action='DESELECT')
for new_obj, orig_obj in new_objects:
Expand Down

0 comments on commit 3fb0b05

Please sign in to comment.