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.
This commit is contained in:
Philipp Oeser 2020-09-09 22:05:58 +02:00
parent d61d210786
commit 0721fbb6e1
Notes: blender-bot 2023-02-14 08:39:23 +01:00
Referenced by issue #80396, Potential candidates for corrective releases
Referenced by issue #80327, Glitches in UI drawing
1 changed files with 5 additions and 2 deletions

View File

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