[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [25352] trunk/blender/release/scripts/ui: Applies Patch 20200
Roland Hess
me at harkyman.com
Mon Dec 14 04:01:46 CET 2009
Revision: 25352
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=25352
Author: harkyman
Date: 2009-12-14 04:01:42 +0100 (Mon, 14 Dec 2009)
Log Message:
-----------
Applies Patch 20200
Shuffle IK Restriction and iTaSC parameter panels into more fitting context.
Modified Paths:
--------------
trunk/blender/release/scripts/ui/properties_data_armature.py
trunk/blender/release/scripts/ui/properties_data_bone.py
trunk/blender/release/scripts/ui/properties_object_constraint.py
Modified: trunk/blender/release/scripts/ui/properties_data_armature.py
===================================================================
--- trunk/blender/release/scripts/ui/properties_data_armature.py 2009-12-14 01:58:08 UTC (rev 25351)
+++ trunk/blender/release/scripts/ui/properties_data_armature.py 2009-12-14 03:01:42 UTC (rev 25352)
@@ -235,9 +235,63 @@
col.label(text="Display:")
col.prop(arm, "ghost_only_selected", text="Selected Only")
+class DATA_PT_iksolver_itasc(DataButtonsPanel):
+ bl_label = "iTaSC parameters"
+ bl_default_closed = True
+
+ def poll(self, context):
+ ob = context.object
+ return (ob and ob.pose)
+
+ def draw(self, context):
+ layout = self.layout
+
+ ob = context.object
+
+ itasc = ob.pose.ik_param
+ wide_ui = context.region.width > narrowui
+
+ row = layout.row()
+ row.prop(ob.pose, "ik_solver")
+
+ layout.prop(itasc, "mode", expand=True)
+ simulation = itasc.mode == 'SIMULATION'
+ if simulation:
+ layout.label(text="Reiteration:")
+ layout.prop(itasc, "reiteration", expand=True)
+
+ split = layout.split()
+ split.active = not simulation or itasc.reiteration != 'NEVER'
+ col = split.column()
+ col.prop(itasc, "precision")
+
+ if wide_ui:
+ col = split.column()
+ col.prop(itasc, "num_iter")
+
+
+ if simulation:
+ layout.prop(itasc, "auto_step")
+ row = layout.row()
+ if itasc.auto_step:
+ row.prop(itasc, "min_step", text="Min")
+ row.prop(itasc, "max_step", text="Max")
+ else:
+ row.prop(itasc, "num_step")
+
+ layout.prop(itasc, "solver")
+ if simulation:
+ layout.prop(itasc, "feedback")
+ layout.prop(itasc, "max_velocity")
+ if itasc.solver == 'DLS':
+ row = layout.row()
+ row.prop(itasc, "dampmax", text="Damp", slider=True)
+ row.prop(itasc, "dampeps", text="Eps", slider=True)
+
bpy.types.register(DATA_PT_context_arm)
bpy.types.register(DATA_PT_skeleton)
bpy.types.register(DATA_PT_display)
bpy.types.register(DATA_PT_bone_groups)
bpy.types.register(DATA_PT_paths)
bpy.types.register(DATA_PT_ghost)
+bpy.types.register(DATA_PT_iksolver_itasc)
Modified: trunk/blender/release/scripts/ui/properties_data_bone.py
===================================================================
--- trunk/blender/release/scripts/ui/properties_data_bone.py 2009-12-14 01:58:08 UTC (rev 25351)
+++ trunk/blender/release/scripts/ui/properties_data_bone.py 2009-12-14 03:01:42 UTC (rev 25352)
@@ -226,7 +226,108 @@
col.label(text="Custom Shape:")
col.prop(pchan, "custom_shape", text="")
+class BONE_PT_inverse_kinematics(BoneButtonsPanel):
+ bl_label = "Inverse Kinematics"
+ bl_default_closed = True
+ def poll(self, context):
+ ob = context.object
+ bone = context.bone
+ pchan = ob.pose.bones[bone.name]
+
+ if ob and bone and pchan:
+ return True
+
+ return False
+
+ def draw(self, context):
+ layout = self.layout
+
+ ob = context.object
+ bone = context.bone
+ pchan = ob.pose.bones[bone.name]
+ wide_ui = context.region.width > narrowui
+
+ split = layout.split(percentage=0.25)
+ split.prop(pchan, "ik_dof_x", text="X")
+ split.active = pchan.has_ik
+ row = split.row()
+ row.prop(pchan, "ik_stiffness_x", text="Stiffness", slider=True)
+ row.active = pchan.ik_dof_x and pchan.has_ik
+
+ if wide_ui:
+ split = layout.split(percentage=0.25)
+ sub = split.row()
+ else:
+ sub = layout.column(align=True)
+ sub.prop(pchan, "ik_limit_x", text="Limit")
+ sub.active = pchan.ik_dof_x and pchan.has_ik
+ if wide_ui:
+ sub = split.row(align=True)
+ sub.prop(pchan, "ik_min_x", text="")
+ sub.prop(pchan, "ik_max_x", text="")
+ sub.active = pchan.ik_dof_x and pchan.ik_limit_x and pchan.has_ik
+
+ split = layout.split(percentage=0.25)
+ split.prop(pchan, "ik_dof_y", text="Y")
+ split.active = pchan.has_ik and pchan.has_ik
+ row = split.row()
+ row.prop(pchan, "ik_stiffness_y", text="Stiffness", slider=True)
+ row.active = pchan.ik_dof_y and pchan.has_ik
+
+ if wide_ui:
+ split = layout.split(percentage=0.25)
+ sub = split.row()
+ else:
+ sub = layout.column(align=True)
+ sub.prop(pchan, "ik_limit_y", text="Limit")
+ sub.active = pchan.ik_dof_y and pchan.has_ik
+ if wide_ui:
+ sub = split.row(align=True)
+ sub.prop(pchan, "ik_min_y", text="")
+ sub.prop(pchan, "ik_max_y", text="")
+ sub.active = pchan.ik_dof_y and pchan.ik_limit_y and pchan.has_ik
+
+ split = layout.split(percentage=0.25)
+ split.prop(pchan, "ik_dof_z", text="Z")
+ split.active = pchan.has_ik and pchan.has_ik
+ sub = split.row()
+ sub.prop(pchan, "ik_stiffness_z", text="Stiffness", slider=True)
+ sub.active = pchan.ik_dof_z and pchan.has_ik
+
+ if wide_ui:
+ split = layout.split(percentage=0.25)
+ sub = split.row()
+ else:
+ sub = layout.column(align=True)
+ sub.prop(pchan, "ik_limit_z", text="Limit")
+ sub.active = pchan.ik_dof_z and pchan.has_ik
+ if wide_ui:
+ sub = split.row(align=True)
+ sub.prop(pchan, "ik_min_z", text="")
+ sub.prop(pchan, "ik_max_z", text="")
+ sub.active = pchan.ik_dof_z and pchan.ik_limit_z and pchan.has_ik
+ split = layout.split()
+ split.prop(pchan, "ik_stretch", text="Stretch", slider=True)
+ if wide_ui:
+ split.label()
+ split.active = pchan.has_ik
+
+ if ob.pose.ik_solver == 'ITASC':
+ split = layout.split()
+ col = split.column()
+ col.prop(pchan, "ik_rot_control", text="Control Rotation")
+ col.active = pchan.has_ik
+ if wide_ui:
+ col = split.column()
+ col.prop(pchan, "ik_rot_weight", text="Weight", slider=True)
+ col.active = pchan.has_ik
+ # not supported yet
+ #row = layout.row()
+ #row.prop(pchan, "ik_lin_control", text="Joint Size")
+ #row.prop(pchan, "ik_lin_weight", text="Weight", slider=True)
+
+
class BONE_PT_deform(BoneButtonsPanel):
bl_label = "Deform"
bl_default_closed = True
@@ -298,5 +399,6 @@
bpy.types.register(BONE_PT_transform_locks)
bpy.types.register(BONE_PT_relations)
bpy.types.register(BONE_PT_display)
+bpy.types.register(BONE_PT_inverse_kinematics)
bpy.types.register(BONE_PT_deform)
bpy.types.register(BONE_PT_properties)
Modified: trunk/blender/release/scripts/ui/properties_object_constraint.py
===================================================================
--- trunk/blender/release/scripts/ui/properties_object_constraint.py 2009-12-14 01:58:08 UTC (rev 25351)
+++ trunk/blender/release/scripts/ui/properties_object_constraint.py 2009-12-14 03:01:42 UTC (rev 25352)
@@ -735,164 +735,6 @@
for con in ob.constraints:
self.draw_constraint(context, con)
-
-class BONE_PT_inverse_kinematics(ConstraintButtonsPanel):
- bl_label = "Inverse Kinematics"
- bl_default_closed = True
- bl_context = "bone_constraint"
-
- def poll(self, context):
- ob = context.object
- bone = context.bone
-
- if ob and bone:
- pchan = ob.pose.bones[bone.name]
- return pchan.has_ik
-
- return False
-
- def draw(self, context):
- layout = self.layout
-
- ob = context.object
- bone = context.bone
- pchan = ob.pose.bones[bone.name]
- wide_ui = context.region.width > narrowui
-
- row = layout.row()
- row.prop(ob.pose, "ik_solver")
-
- split = layout.split(percentage=0.25)
- split.prop(pchan, "ik_dof_x", text="X")
- row = split.row()
- row.prop(pchan, "ik_stiffness_x", text="Stiffness", slider=True)
- row.active = pchan.ik_dof_x
-
- if wide_ui:
- split = layout.split(percentage=0.25)
- sub = split.row()
- else:
- sub = layout.column(align=True)
- sub.prop(pchan, "ik_limit_x", text="Limit")
- sub.active = pchan.ik_dof_x
- if wide_ui:
- sub = split.row(align=True)
- sub.prop(pchan, "ik_min_x", text="")
- sub.prop(pchan, "ik_max_x", text="")
- sub.active = pchan.ik_dof_x and pchan.ik_limit_x
-
- split = layout.split(percentage=0.25)
- split.prop(pchan, "ik_dof_y", text="Y")
- row = split.row()
- row.prop(pchan, "ik_stiffness_y", text="Stiffness", slider=True)
- row.active = pchan.ik_dof_y
-
- if wide_ui:
- split = layout.split(percentage=0.25)
- sub = split.row()
- else:
- sub = layout.column(align=True)
- sub.prop(pchan, "ik_limit_y", text="Limit")
- sub.active = pchan.ik_dof_y
- if wide_ui:
- sub = split.row(align=True)
- sub.prop(pchan, "ik_min_y", text="")
- sub.prop(pchan, "ik_max_y", text="")
- sub.active = pchan.ik_dof_y and pchan.ik_limit_y
-
- split = layout.split(percentage=0.25)
- split.prop(pchan, "ik_dof_z", text="Z")
- sub = split.row()
- sub.prop(pchan, "ik_stiffness_z", text="Stiffness", slider=True)
- sub.active = pchan.ik_dof_z
-
- if wide_ui:
- split = layout.split(percentage=0.25)
- sub = split.row()
- else:
- sub = layout.column(align=True)
- sub.prop(pchan, "ik_limit_z", text="Limit")
- sub.active = pchan.ik_dof_z
- if wide_ui:
- sub = split.row(align=True)
- sub.prop(pchan, "ik_min_z", text="")
- sub.prop(pchan, "ik_max_z", text="")
- sub.active = pchan.ik_dof_z and pchan.ik_limit_z
- split = layout.split()
- split.prop(pchan, "ik_stretch", text="Stretch", slider=True)
- if wide_ui:
- split.label()
-
- if ob.pose.ik_solver == 'ITASC':
- split = layout.split()
- col = split.column()
- col.prop(pchan, "ik_rot_control", text="Control Rotation")
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list