Fix T81800: Datablock pin not working for bones in pose mode

The "active_pose_bone" context variable isn't accessed from
`buttons_context`, it uses `screen_context` instead. This means
it can't account for pinning in the property editor.

Using "pose_bone" context variable first means the property
editor context will be used and the pinning will work.

Differential Revision: https://developer.blender.org/D9242
This commit is contained in:
Hans Goudey 2020-10-18 10:57:14 -05:00
parent 806a561e23
commit 78a5895c96
Notes: blender-bot 2023-02-14 10:29:32 +01:00
Referenced by commit 94364be80a, Fix ASAN warning after recent cleanup
Referenced by issue #81800, Datablock pin not working for bone constrains
1 changed files with 2 additions and 2 deletions

View File

@ -111,9 +111,9 @@ ListBase *ED_object_constraint_active_list(Object *ob)
*/
ListBase *ED_object_pose_constraint_list(const bContext *C)
{
bPoseChannel *pose_bone = CTX_data_pointer_get(C, "active_pose_bone").data;
bPoseChannel *pose_bone = CTX_data_pointer_get(C, "pose_bone").data;
if (pose_bone == NULL) {
pose_bone = CTX_data_pointer_get(C, "pose_bone").data;
pose_bone = CTX_data_pointer_get(C, "active_pose_bone").data;
if (pose_bone == NULL) {
return NULL;
}