[Bf-blender-cvs] [7a0a60dde8b] master: Dont show temporary IK constraints in the constraint stack

Philipp Oeser noreply at git.blender.org
Tue Sep 15 18:02:23 CEST 2020


Commit: 7a0a60dde8b4bf120ab7977e476bf5c82b2a63ad
Author: Philipp Oeser
Date:   Mon Sep 14 23:10:56 2020 +0200
Branches: master
https://developer.blender.org/rB7a0a60dde8b4bf120ab7977e476bf5c82b2a63ad

Dont show temporary IK constraints in the constraint stack

Those constraints are added when using AutoIK (or targetless IK as
well).
While not strictly incorrect, these kinds of constraints were not
showing in the UI prior to rBeaa44afe703e (and I think they should not).

ref T80437

Maniphest Tasks: T80437

Differential Revision: https://developer.blender.org/D8895

===================================================================

M	source/blender/editors/interface/interface_templates.c

===================================================================

diff --git a/source/blender/editors/interface/interface_templates.c b/source/blender/editors/interface/interface_templates.c
index 77a9d9f549a..28c986f87cc 100644
--- a/source/blender/editors/interface/interface_templates.c
+++ b/source/blender/editors/interface/interface_templates.c
@@ -2063,6 +2063,14 @@ void uiTemplateConstraints(uiLayout *UNUSED(layout), bContext *C, bool use_bone_
     UI_panels_free_instanced(C, region);
     bConstraint *con = (constraints == NULL) ? NULL : constraints->first;
     for (int i = 0; con; i++, con = con->next) {
+      /* Dont show temporary constraints (AutoIK and targetless IK constraints). */
+      if (con->type == CONSTRAINT_TYPE_KINEMATIC) {
+        bKinematicConstraint *data = con->data;
+        if (data->flag & CONSTRAINT_IK_TEMP) {
+          continue;
+        }
+      }
+
       char panel_idname[MAX_NAME];
       panel_id_func(con, panel_idname);
 
@@ -2086,6 +2094,14 @@ void uiTemplateConstraints(uiLayout *UNUSED(layout), bContext *C, bool use_bone_
     /* Assuming there's only one group of instanced panels, update the custom data pointers. */
     Panel *panel = region->panels.first;
     LISTBASE_FOREACH (bConstraint *, con, constraints) {
+      /* Dont show temporary constraints (AutoIK and targetless IK constraints). */
+      if (con->type == CONSTRAINT_TYPE_KINEMATIC) {
+        bKinematicConstraint *data = con->data;
+        if (data->flag & CONSTRAINT_IK_TEMP) {
+          continue;
+        }
+      }
+
       /* Move to the next instanced panel corresponding to the next constraint. */
       while ((panel->type == NULL) || !(panel->type->flag & PNL_INSTANCED)) {
         panel = panel->next;



More information about the Bf-blender-cvs mailing list