diff options
author | Philipp Oeser <info@graphics-engineer.com> | 2020-09-09 23:05:58 +0300 |
---|---|---|
committer | Philipp Oeser <info@graphics-engineer.com> | 2020-09-09 23:10:15 +0300 |
commit | 0721fbb6e1e28bb7afd33f3c4d00c0fd53e292cb (patch) | |
tree | 04699cb30f3b8647c999007ac4c66b7a73f2f088 /source/blender/editors/object | |
parent | d61d21078643da4a7258142d8e48e14c1325fb11 (diff) |
Fix for failing constraints test
Caused by own rB6dc7266cf1f4.
When overriding context for constraint operators (such as in constraint
tests), it could happen that context "active_pose_bone" is set, but
"pose_bone" isnt. Now check for both in ED_object_pose_constraint_list.
Diffstat (limited to 'source/blender/editors/object')
-rw-r--r-- | source/blender/editors/object/object_constraint.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/source/blender/editors/object/object_constraint.c b/source/blender/editors/object/object_constraint.c index 2f9917a2674..8b10a865a68 100644 --- a/source/blender/editors/object/object_constraint.c +++ b/source/blender/editors/object/object_constraint.c @@ -107,9 +107,12 @@ ListBase *ED_object_constraint_active_list(Object *ob) * ED_object_constraint_active_list, such constraints are not excluded here). */ ListBase *ED_object_pose_constraint_list(const bContext *C) { - bPoseChannel *pose_bone = CTX_data_pointer_get(C, "pose_bone").data; + bPoseChannel *pose_bone = CTX_data_pointer_get(C, "active_pose_bone").data; if (pose_bone == NULL) { - return NULL; + pose_bone = CTX_data_pointer_get(C, "pose_bone").data; + if (pose_bone == NULL) { + return NULL; + } } return &pose_bone->constraints; |