Skip to content

Commit

Permalink
Fix error in case an object has no modifiers
Browse files Browse the repository at this point in the history
Signed-off-by: Andrej Orsula <orsula.andrej@gmail.com>
  • Loading branch information
AndrejOrsula committed Apr 7, 2022
1 parent e54a450 commit adec670
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions examples/scripts/blender/procedural_dataset_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -1270,10 +1270,11 @@ def __trigger_modifier_update(obj: bpy.types.Object):
# TODO[enhancement]: Figure out a better way of updating modifiers after
# programatic changes
bpy.context.view_layer.objects.active = obj
bpy.ops.object.modifier_move_to_index(
modifier=obj.modifiers.values()[0].name,
index=0,
)
if len(obj.modifiers.values()):
bpy.ops.object.modifier_move_to_index(
modifier=obj.modifiers.values()[0].name,
index=0,
)

def __unify_string(
string: str,
Expand Down

0 comments on commit adec670

Please sign in to comment.