Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
authorPhilipp Oeser <info@graphics-engineer.com>2020-09-15 00:10:56 +0300
committerPhilipp Oeser <info@graphics-engineer.com>2020-09-15 18:57:37 +0300
commit7a0a60dde8b4bf120ab7977e476bf5c82b2a63ad (patch)
tree82e12699ad541d36c98314d174cc393ce621798e /source
parent2b36e6bee6ccf5c75708b7fe3815736f426164cb (diff)
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
Diffstat (limited to 'source')
-rw-r--r--source/blender/editors/interface/interface_templates.c16
1 files changed, 16 insertions, 0 deletions
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;