diff options
author | Joshua Leung <aligorith@gmail.com> | 2009-09-12 16:30:23 +0400 |
---|---|---|
committer | Joshua Leung <aligorith@gmail.com> | 2009-09-12 16:30:23 +0400 |
commit | ad43aaf881652a10a47a850277bfe3d376a82433 (patch) | |
tree | 9e3f721a567b6ef2bc473db204ce8fd6bfa39ec6 /release/ui | |
parent | 3a9d99e3e86a44ee7c9abf144c7b03fe246adc37 (diff) |
2.5 - Rotation Locking for Bones
* Added Transform Locks panel. The layout for rotation I'm not satisfied with yet, though it is the best alternative so far.
* Rotations can now be locked per-component for quats/axis-angle instead of going through eulers. This is currently enabled by the checkbox for the 'label' of the Lock Rotation column.
- The naming of the property in RNA + the way this is presented in the UI can get some work done.
- The setting for the 'w' component for quats/axis-angle is currently a separate flag in RNA, since I can't figure out how to lump this in under the 'lock_rotation' property instead (i.e. getting that to be either 3 or 4 components, depending on whether per-component locking is enabled).
- Editing values directly should not be possible when these locks are set...
* Fixed some tools which made use of this
Diffstat (limited to 'release/ui')
-rw-r--r-- | release/ui/buttons_data_bone.py | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/release/ui/buttons_data_bone.py b/release/ui/buttons_data_bone.py index 5aac44bbc94..a0121821e55 100644 --- a/release/ui/buttons_data_bone.py +++ b/release/ui/buttons_data_bone.py @@ -71,6 +71,35 @@ class BONE_PT_transform(BoneButtonsPanel): col = layout.column(align=True) col.itemL(text="Euler:") col.row().itemR(pchan, "euler_rotation", text="") + +class BONE_PT_transform_locks(BoneButtonsPanel): + __label__ = "Transform Locks" + + def poll(self, context): + return context.bone + + def draw(self, context): + layout = self.layout + + ob = context.object + bone = context.bone + pchan = ob.pose.pose_channels[context.bone.name] + + row = layout.row() + col = row.column() + col.itemR(pchan, "lock_location") + col.active = not (bone.parent and bone.connected) + + col = row.column() + if pchan.rotation_mode in ('QUATERNION', 'AXIS_ANGLE'): + col.itemR(pchan, "lock_rotations_4d", text="Lock Rotation") + if pchan.lock_rotations_4d: + col.itemR(pchan, "lock_rotation_w", text="W") + col.itemR(pchan, "lock_rotation", text="") + else: + col.itemR(pchan, "lock_rotation", text="Rotation") + + row.column().itemR(pchan, "lock_scale") class BONE_PT_bone(BoneButtonsPanel): __label__ = "Bone" @@ -243,6 +272,7 @@ class BONE_PT_deform(BoneButtonsPanel): bpy.types.register(BONE_PT_context_bone) bpy.types.register(BONE_PT_transform) +bpy.types.register(BONE_PT_transform_locks) bpy.types.register(BONE_PT_bone) bpy.types.register(BONE_PT_deform) bpy.types.register(BONE_PT_inverse_kinematics) |