diff options
-rw-r--r-- | intern/iksolver/intern/IK_QJacobianSolver.cpp | 2 | ||||
-rw-r--r-- | release/scripts/startup/bl_ui/properties_data_armature.py | 2 | ||||
-rw-r--r-- | release/scripts/startup/bl_ui/properties_data_bone.py | 1 | ||||
-rw-r--r-- | release/scripts/startup/bl_ui/properties_object_constraint.py | 28 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/action.c | 4 | ||||
-rw-r--r-- | source/blender/ikplugin/intern/iksolver_plugin.c | 3 | ||||
-rw-r--r-- | source/blender/makesdna/DNA_action_types.h | 2 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_constraint.c | 2 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_pose.c | 10 |
9 files changed, 31 insertions, 23 deletions
diff --git a/intern/iksolver/intern/IK_QJacobianSolver.cpp b/intern/iksolver/intern/IK_QJacobianSolver.cpp index 43d177d0651..75f51f566c9 100644 --- a/intern/iksolver/intern/IK_QJacobianSolver.cpp +++ b/intern/iksolver/intern/IK_QJacobianSolver.cpp @@ -377,7 +377,7 @@ bool IK_QJacobianSolver::Solve( norm = maxnorm; // check for convergence - if (norm < 1e-3) { + if (norm < 1e-3 && iterations > 10) { solved = true; break; } diff --git a/release/scripts/startup/bl_ui/properties_data_armature.py b/release/scripts/startup/bl_ui/properties_data_armature.py index 50c34be1414..845beb0f862 100644 --- a/release/scripts/startup/bl_ui/properties_data_armature.py +++ b/release/scripts/startup/bl_ui/properties_data_armature.py @@ -239,7 +239,7 @@ class DATA_PT_ghost(ArmatureButtonsPanel, Panel): class DATA_PT_iksolver_itasc(ArmatureButtonsPanel, Panel): - bl_label = "iTaSC parameters" + bl_label = "Inverse Kinematics" bl_options = {'DEFAULT_CLOSED'} @classmethod diff --git a/release/scripts/startup/bl_ui/properties_data_bone.py b/release/scripts/startup/bl_ui/properties_data_bone.py index 1441c642d51..fdaee6b7cde 100644 --- a/release/scripts/startup/bl_ui/properties_data_bone.py +++ b/release/scripts/startup/bl_ui/properties_data_bone.py @@ -244,7 +244,6 @@ class BONE_PT_inverse_kinematics(BoneButtonsPanel, Panel): pchan = ob.pose.bones[bone.name] row = layout.row() - row.prop(ob.pose, "ik_solver") active = pchan.is_in_ik_chain diff --git a/release/scripts/startup/bl_ui/properties_object_constraint.py b/release/scripts/startup/bl_ui/properties_object_constraint.py index 3fa63bac13c..eb0929895f8 100644 --- a/release/scripts/startup/bl_ui/properties_object_constraint.py +++ b/release/scripts/startup/bl_ui/properties_object_constraint.py @@ -134,7 +134,7 @@ class ConstraintButtonsPanel(): layout.prop(con, "ik_type") getattr(self, 'IK_' + con.ik_type)(context, layout, con) else: - # Legacy IK constraint + # Standard IK constraint self.target_template(layout, con) layout.prop(con, "pole_target") @@ -151,17 +151,27 @@ class ConstraintButtonsPanel(): col.prop(con, "iterations") col.prop(con, "chain_count") - col.label(text="Weight:") - col.prop(con, "weight", text="Position", slider=True) - sub = col.column() - sub.active = con.use_rotation - sub.prop(con, "orient_weight", text="Rotation", slider=True) - col = split.column() col.prop(con, "use_tail") col.prop(con, "use_stretch") - col.separator() - col.prop(con, "use_rotation") + + layout.label(text="Weight:") + + split = layout.split() + col = split.column() + row = col.row(align=True) + row.prop(con, "use_location", text="") + sub = row.row() + sub.active = con.use_location + sub.prop(con, "weight", text="Position", slider=True) + + col = split.column() + row = col.row(align=True) + row.prop(con, "use_rotation", text="") + sub = row.row() + sub.active = con.use_rotation + sub.prop(con, "orient_weight", text="Rotation", slider=True) + def IK_COPY_POSE(self, context, layout, con): self.target_template(layout, con) diff --git a/source/blender/blenkernel/intern/action.c b/source/blender/blenkernel/intern/action.c index e95451252d0..dd27cc70ba3 100644 --- a/source/blender/blenkernel/intern/action.c +++ b/source/blender/blenkernel/intern/action.c @@ -512,7 +512,7 @@ const char *BKE_pose_ikparam_get_name(bPose *pose) { if (pose) { switch (pose->iksolver) { - case IKSOLVER_LEGACY: + case IKSOLVER_STANDARD: return NULL; case IKSOLVER_ITASC: return "bItasc"; @@ -587,7 +587,7 @@ void BKE_pose_ikparam_init(bPose *pose) BKE_pose_itasc_init(itasc); pose->ikparam = itasc; break; - case IKSOLVER_LEGACY: + case IKSOLVER_STANDARD: default: pose->ikparam = NULL; break; diff --git a/source/blender/ikplugin/intern/iksolver_plugin.c b/source/blender/ikplugin/intern/iksolver_plugin.c index af15333ece5..ca81f4c915a 100644 --- a/source/blender/ikplugin/intern/iksolver_plugin.c +++ b/source/blender/ikplugin/intern/iksolver_plugin.c @@ -379,6 +379,7 @@ static void execute_posetree(struct Scene *scene, Object *ob, PoseTree *tree) copy_v3_v3(goalpos, goal[3]); copy_m3_m4(goalrot, goal); + normalize_m3(goalrot); /* same for pole vector target */ if (data->poletar) { @@ -433,7 +434,7 @@ static void execute_posetree(struct Scene *scene, Object *ob, PoseTree *tree) iktarget = iktree[target->tip]; - if (data->weight != 0.0f) { + if ((data->flag & CONSTRAINT_IK_POS) && data->weight != 0.0f) { if (poleconstrain) IK_SolverSetPoleVectorConstraint(solver, iktarget, goalpos, polepos, data->poleangle, (poleangledata == data)); diff --git a/source/blender/makesdna/DNA_action_types.h b/source/blender/makesdna/DNA_action_types.h index d8d1ad78451..f227af78dab 100644 --- a/source/blender/makesdna/DNA_action_types.h +++ b/source/blender/makesdna/DNA_action_types.h @@ -372,7 +372,7 @@ typedef enum ePose_Flags { /* bPose->iksolver and bPose->ikparam->iksolver */ typedef enum ePose_IKSolverType { - IKSOLVER_LEGACY = 0, + IKSOLVER_STANDARD = 0, IKSOLVER_ITASC = 1 } ePose_IKSolverType; diff --git a/source/blender/makesrna/intern/rna_constraint.c b/source/blender/makesrna/intern/rna_constraint.c index 7b6b629ca82..30a9bfd81f6 100644 --- a/source/blender/makesrna/intern/rna_constraint.c +++ b/source/blender/makesrna/intern/rna_constraint.c @@ -614,7 +614,7 @@ static void rna_def_constraint_kinematic(BlenderRNA *brna) RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_dependency_update"); prop = RNA_def_property(srna, "iterations", PROP_INT, PROP_NONE); - RNA_def_property_range(prop, 1, 10000); + RNA_def_property_range(prop, 0, 10000); RNA_def_property_ui_text(prop, "Iterations", "Maximum number of solving iterations"); RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update"); diff --git a/source/blender/makesrna/intern/rna_pose.c b/source/blender/makesrna/intern/rna_pose.c index 412aad20a41..5c90fb8787c 100644 --- a/source/blender/makesrna/intern/rna_pose.c +++ b/source/blender/makesrna/intern/rna_pose.c @@ -675,7 +675,7 @@ static void rna_def_bone_group(BlenderRNA *brna) } static EnumPropertyItem prop_iksolver_items[] = { - {IKSOLVER_LEGACY, "LEGACY", 0, "Legacy", "Original IK solver"}, + {IKSOLVER_STANDARD, "LEGACY", 0, "Standard", "Original IK solver"}, {IKSOLVER_ITASC, "ITASC", 0, "iTaSC", "Multi constraint, stateful IK solver"}, {0, NULL, 0, NULL, NULL} }; @@ -1126,7 +1126,7 @@ static void rna_def_pose_itasc(BlenderRNA *brna) prop = RNA_def_property(srna, "iterations", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "numiter"); - RNA_def_property_range(prop, 1.f, 1000.f); + RNA_def_property_range(prop, 0, 1000); RNA_def_property_ui_text(prop, "Iterations", "Maximum number of iterations for convergence in case of reiteration"); RNA_def_property_update(prop, NC_OBJECT | ND_POSE, "rna_Itasc_update"); @@ -1221,8 +1221,7 @@ static void rna_def_pose_ikparam(BlenderRNA *brna) RNA_def_property_enum_sdna(prop, NULL, "iksolver"); RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_enum_items(prop, prop_iksolver_items); - RNA_def_property_ui_text(prop, "IK Solver", - "IK solver for which these parameters are defined, 0 for Legacy, 1 for iTaSC"); + RNA_def_property_ui_text(prop, "IK Solver", "IK solver for which these parameters are defined"); } /* pose.bone_groups */ @@ -1285,8 +1284,7 @@ static void rna_def_pose(BlenderRNA *brna) RNA_def_property_enum_sdna(prop, NULL, "iksolver"); RNA_def_property_enum_funcs(prop, NULL, "rna_Pose_ik_solver_set", NULL); RNA_def_property_enum_items(prop, prop_iksolver_items); - RNA_def_property_ui_text(prop, "IK Solver", - "Selection of IK solver for IK chain, current choice is 0 for Legacy, 1 for iTaSC"); + RNA_def_property_ui_text(prop, "IK Solver", "Selection of IK solver for IK chain"); RNA_def_property_update(prop, NC_OBJECT | ND_POSE, "rna_Pose_ik_solver_update"); prop = RNA_def_property(srna, "ik_param", PROP_POINTER, PROP_NONE); |