Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def modifiers_by_name(obj, name):
- """ Find all modifiers with a specific name in obj """
- return [x for x in obj.modifiers if x.name == name]
- def modifiers_by_type(obj, typename):
- """ Find all modifiers with a specific type in obj """
- return [x for x in obj.modifiers if x.type == typename]
- # move all "Screw" modifiers to the top
- for modifier in reversed(modifiers_by_type(obj, "SCREW")):
- # while modifier not on top
- while obj.modifiers.find(modifier.name) != 0:
- # move it one more to the top.
- bpy.ops.object.modifier_move_up(modifier=modifier.name)
Add Comment
Please, Sign In to add comment