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
This commit is contained in:
2020-09-14 23:10:56 +02:00
parent 2b36e6bee6
commit 7a0a60dde8

View File

@@ -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;