[Bf-blender-cvs] [f2224ccfceb] master: Fix T74006: Alt+ clicking (assign to all selected) doesn not work for bone constraints settings

Philipp Oeser noreply at git.blender.org
Fri Feb 21 14:38:35 CET 2020


Commit: f2224ccfceb58e131886391efd656fdd79c561b8
Author: Philipp Oeser
Date:   Thu Feb 20 12:36:59 2020 +0100
Branches: master
https://developer.blender.org/rBf2224ccfceb58e131886391efd656fdd79c561b8

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

===================================================================

M	source/blender/editors/interface/interface_ops.c

===================================================================

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;



More information about the Bf-blender-cvs mailing list