diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2012-10-25 02:36:06 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2012-10-25 02:36:06 +0400 |
commit | 1298357581ac4e1c4221ce723d5ad0db9721aa4b (patch) | |
tree | 493c8dbb9425761585cff7d732bf5d801ca4e51c | |
parent | 5aa6327e2f3b0af57075f2aa6f6ad73083eec074 (diff) |
Fix #32964: IK constraint had a "Target" option, which actually is an internal
flag that shouldn't have been exposed in the user interface. Also avoided many
calls to pchan.is_in_ik_chain in UI script, it's somewhat slow.
4 files changed, 22 insertions, 22 deletions
diff --git a/release/scripts/startup/bl_ui/properties_data_bone.py b/release/scripts/startup/bl_ui/properties_data_bone.py index 1e70483864c..1441c642d51 100644 --- a/release/scripts/startup/bl_ui/properties_data_bone.py +++ b/release/scripts/startup/bl_ui/properties_data_bone.py @@ -246,72 +246,74 @@ class BONE_PT_inverse_kinematics(BoneButtonsPanel, Panel): row = layout.row() row.prop(ob.pose, "ik_solver") + active = pchan.is_in_ik_chain + split = layout.split(percentage=0.25) split.prop(pchan, "lock_ik_x", icon='LOCKED' if pchan.lock_ik_x else 'UNLOCKED', text="X") - split.active = pchan.is_in_ik_chain + split.active = active row = split.row() row.prop(pchan, "ik_stiffness_x", text="Stiffness", slider=True) - row.active = pchan.lock_ik_x is False and pchan.is_in_ik_chain + row.active = pchan.lock_ik_x is False and active split = layout.split(percentage=0.25) sub = split.row() sub.prop(pchan, "use_ik_limit_x", text="Limit") - sub.active = pchan.lock_ik_x is False and pchan.is_in_ik_chain + sub.active = pchan.lock_ik_x is False and active sub = split.row(align=True) sub.prop(pchan, "ik_min_x", text="") sub.prop(pchan, "ik_max_x", text="") - sub.active = pchan.lock_ik_x is False and pchan.use_ik_limit_x and pchan.is_in_ik_chain + sub.active = pchan.lock_ik_x is False and pchan.use_ik_limit_x and active split = layout.split(percentage=0.25) split.prop(pchan, "lock_ik_y", icon='LOCKED' if pchan.lock_ik_y else 'UNLOCKED', text="Y") - split.active = pchan.is_in_ik_chain + split.active = active row = split.row() row.prop(pchan, "ik_stiffness_y", text="Stiffness", slider=True) - row.active = pchan.lock_ik_y is False and pchan.is_in_ik_chain + row.active = pchan.lock_ik_y is False and active split = layout.split(percentage=0.25) sub = split.row() sub.prop(pchan, "use_ik_limit_y", text="Limit") - sub.active = pchan.lock_ik_y is False and pchan.is_in_ik_chain + sub.active = pchan.lock_ik_y is False and active sub = split.row(align=True) sub.prop(pchan, "ik_min_y", text="") sub.prop(pchan, "ik_max_y", text="") - sub.active = pchan.lock_ik_y is False and pchan.use_ik_limit_y and pchan.is_in_ik_chain + sub.active = pchan.lock_ik_y is False and pchan.use_ik_limit_y and active split = layout.split(percentage=0.25) split.prop(pchan, "lock_ik_z", icon='LOCKED' if pchan.lock_ik_z else 'UNLOCKED', text="Z") - split.active = pchan.is_in_ik_chain + split.active = active sub = split.row() sub.prop(pchan, "ik_stiffness_z", text="Stiffness", slider=True) - sub.active = pchan.lock_ik_z is False and pchan.is_in_ik_chain + sub.active = pchan.lock_ik_z is False and active split = layout.split(percentage=0.25) sub = split.row() sub.prop(pchan, "use_ik_limit_z", text="Limit") - sub.active = pchan.lock_ik_z is False and pchan.is_in_ik_chain + sub.active = pchan.lock_ik_z is False and active sub = split.row(align=True) sub.prop(pchan, "ik_min_z", text="") sub.prop(pchan, "ik_max_z", text="") - sub.active = pchan.lock_ik_z is False and pchan.use_ik_limit_z and pchan.is_in_ik_chain + sub.active = pchan.lock_ik_z is False and pchan.use_ik_limit_z and active split = layout.split(percentage=0.25) split.label(text="Stretch:") sub = split.row() sub.prop(pchan, "ik_stretch", text="", slider=True) - sub.active = pchan.is_in_ik_chain + sub.active = active if ob.pose.ik_solver == 'ITASC': split = layout.split() col = split.column() col.prop(pchan, "use_ik_rotation_control", text="Control Rotation") - col.active = pchan.is_in_ik_chain + col.active = active col = split.column() col.prop(pchan, "ik_rotation_weight", text="Weight", slider=True) - col.active = pchan.is_in_ik_chain + col.active = active # not supported yet #row = layout.row() #row.prop(pchan, "use_ik_linear_control", text="Joint Size") diff --git a/release/scripts/startup/bl_ui/properties_object_constraint.py b/release/scripts/startup/bl_ui/properties_object_constraint.py index 1eac232de88..3fa63bac13c 100644 --- a/release/scripts/startup/bl_ui/properties_object_constraint.py +++ b/release/scripts/startup/bl_ui/properties_object_constraint.py @@ -88,7 +88,6 @@ class ConstraintButtonsPanel(): col = split.column() col.prop(con, "chain_count") - col.prop(con, "use_target") def CHILD_OF(self, context, layout, con): self.target_template(layout, con) @@ -162,7 +161,6 @@ class ConstraintButtonsPanel(): col.prop(con, "use_tail") col.prop(con, "use_stretch") col.separator() - col.prop(con, "use_target") col.prop(con, "use_rotation") def IK_COPY_POSE(self, context, layout, con): diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 135f23eb9aa..9dc75adcc6a 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -2543,8 +2543,13 @@ static void direct_link_constraints(FileData *fd, ListBase *lb) break; case CONSTRAINT_TYPE_KINEMATIC: { + bKinematicConstraint *data = con->data; + con->lin_error = 0.f; con->rot_error = 0.f; + + /* version patch for runtime flag, was not cleared in some case */ + data->flag &= ~CONSTRAINT_IK_AUTO; } case CONSTRAINT_TYPE_CHILDOF: { diff --git a/source/blender/makesrna/intern/rna_constraint.c b/source/blender/makesrna/intern/rna_constraint.c index f2454a2dcfb..dcf214852e3 100644 --- a/source/blender/makesrna/intern/rna_constraint.c +++ b/source/blender/makesrna/intern/rna_constraint.c @@ -703,11 +703,6 @@ static void rna_def_constraint_kinematic(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Lock Z Rot", "Constraint rotation along Z axis"); RNA_def_property_update(prop, NC_OBJECT | ND_POSE, "rna_Constraint_dependency_update"); - prop = RNA_def_property(srna, "use_target", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", CONSTRAINT_IK_AUTO); - RNA_def_property_ui_text(prop, "Target", "Disable for targetless IK"); - RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_dependency_update"); - prop = RNA_def_property(srna, "use_stretch", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", CONSTRAINT_IK_STRETCH); RNA_def_property_ui_text(prop, "Stretch", "Enable IK Stretching"); |