diff options
author | Nathan Vegdahl <cessen@cessen.com> | 2011-03-10 03:53:24 +0300 |
---|---|---|
committer | Nathan Vegdahl <cessen@cessen.com> | 2011-03-10 03:53:24 +0300 |
commit | 86c07ba1b6a1f056d9f0488e84a8b84f5a9ba730 (patch) | |
tree | a37ab65774efce10e7adeb819d5ca091cc986d1b /rigify/ui.py | |
parent | eeeaa6e5e17bf218bf171dce659431e9d548f307 (diff) |
Rigify:
- Added IK/FK snapping (both directions) for legs.
- Cleaned up another operator so that it works with undo.
- PEP8 cleanups.
Diffstat (limited to 'rigify/ui.py')
-rw-r--r-- | rigify/ui.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/rigify/ui.py b/rigify/ui.py index c9f1e472..dd91c8cc 100644 --- a/rigify/ui.py +++ b/rigify/ui.py @@ -216,11 +216,15 @@ class Sample(bpy.types.Operator): bl_idname = "armature.metarig_sample_add" bl_label = "Add a sample metarig for a rig type" + bl_options = {'UNDO'} metarig_type = StringProperty(name="Type", description="Name of the rig type to generate a sample of", maxlen=128, default="") + def execute(self, context): if context.mode == 'EDIT_ARMATURE' and self.metarig_type != "": + use_global_undo = context.user_preferences.edit.use_global_undo + context.user_preferences.edit.use_global_undo = False try: rig = get_rig_type(self.metarig_type).Rig create_sample = rig.create_sample @@ -228,7 +232,9 @@ class Sample(bpy.types.Operator): print("Rigify: rig type has no sample.") else: create_sample(context.active_object) - bpy.ops.object.mode_set(mode='EDIT') + finally: + context.user_preferences.edit.use_global_undo = use_global_undo + bpy.ops.object.mode_set(mode='EDIT') return {'FINISHED'} |