diff options
author | Philipp Oeser <info@graphics-engineer.com> | 2020-02-20 14:36:59 +0300 |
---|---|---|
committer | Philipp Oeser <info@graphics-engineer.com> | 2020-02-21 16:35:32 +0300 |
commit | f2224ccfceb58e131886391efd656fdd79c561b8 (patch) | |
tree | b6bed2218e66feda7a9866964480e024faa0d8a3 /source/blender/editors/interface/interface_ops.c | |
parent | 0c506a6ef0b7a1cf1ca267151e01da1e87b89e54 (diff) |
Fix T74006: Alt+ clicking (assign to all selected) doesn not work for
bone constraints settings
'UI_context_copy_to_selected_list()' was working fine for constraints on
objects (would properly get the path and list of selected objects) and
also for bone settings (would properly get the path and list of bones).
There was no special case for constraints on bones though, so code would
work on selected objects (not selected bones).
So we now get the right bones and resolve the path to the constraint
setting _from the bones_.
Maniphest Tasks: T74006
Differential Revision: https://developer.blender.org/D6897
Diffstat (limited to 'source/blender/editors/interface/interface_ops.c')
-rw-r--r-- | source/blender/editors/interface/interface_ops.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/source/blender/editors/interface/interface_ops.c b/source/blender/editors/interface/interface_ops.c index 5710be04477..487d0098927 100644 --- a/source/blender/editors/interface/interface_ops.c +++ b/source/blender/editors/interface/interface_ops.c @@ -735,6 +735,8 @@ bool UI_context_copy_to_selected_list(bContext *C, { *r_use_path_from_id = false; *r_path = NULL; + /* special case for bone constraints */ + char *path_from_bone = NULL; /* PropertyGroup objects don't have a reference to the struct that actually owns * them, so it is normally necessary to do a brute force search to find it. This @@ -797,6 +799,11 @@ bool UI_context_copy_to_selected_list(bContext *C, else if (RNA_struct_is_a(ptr->type, &RNA_FCurve)) { *r_lb = CTX_data_collection_get(C, "selected_editable_fcurves"); } + else if (RNA_struct_is_a(ptr->type, &RNA_Constraint) && + (path_from_bone = RNA_path_resolve_from_type_to_property(ptr, prop, &RNA_PoseBone)) != NULL) { + *r_lb = CTX_data_collection_get(C, "selected_pose_bones"); + *r_path = path_from_bone; + } else if (RNA_struct_is_a(ptr->type, &RNA_Node) || RNA_struct_is_a(ptr->type, &RNA_NodeSocket)) { ListBase lb = {NULL, NULL}; char *path = NULL; |