Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Gavrilov <angavrilov@gmail.com>2019-11-16 20:50:59 +0300
committerAlexander Gavrilov <angavrilov@gmail.com>2019-12-04 12:23:41 +0300
commitb3f388dca9e547c12db277b8422c620ca3b64eaa (patch)
treeffbf14c7371ef7dd96ac49cb0c6e1810c1708f6f /source/blender/makesrna/intern/rna_access.c
parentfda791ab1241534e377bee84b3a214e1343094af (diff)
UI: support Copy To Selected and Alt-Click for PropertyGroup members.
Rigify uses a property group to contain options of its rigs, so currently it is impossible to use Alt-Click or Copy To Selected to change a setting for multiple rigs at the same time. The main problem here is that there is no efficient way to find which bone the property group belongs to. To maintain performance, implement this by checking the active bone if it is known. Copy Data Path and related features still don't work, as data path calculation can't use context. Differential Revision: https://developer.blender.org/D6264
Diffstat (limited to 'source/blender/makesrna/intern/rna_access.c')
-rw-r--r--source/blender/makesrna/intern/rna_access.c30
1 files changed, 20 insertions, 10 deletions
diff --git a/source/blender/makesrna/intern/rna_access.c b/source/blender/makesrna/intern/rna_access.c
index 78cd99837c3..d8889455ac7 100644
--- a/source/blender/makesrna/intern/rna_access.c
+++ b/source/blender/makesrna/intern/rna_access.c
@@ -5738,11 +5738,28 @@ static char *rna_idp_path(PointerRNA *ptr,
return path;
}
+/**
+ * Find the path from the structure referenced by the pointer to the IDProperty object.
+ *
+ * \param ptr Reference to the object owning the custom property storage.
+ * \param needle Custom property object to find.
+ * \return Relative path or NULL.
+ */
+char *RNA_path_from_struct_to_idproperty(PointerRNA *ptr, IDProperty *needle)
+{
+ IDProperty *haystack = RNA_struct_idprops(ptr, false);
+
+ if (haystack) { /* can fail when called on bones */
+ return rna_idp_path(ptr, haystack, needle, NULL);
+ }
+ else {
+ return NULL;
+ }
+}
+
static char *rna_path_from_ID_to_idpgroup(PointerRNA *ptr)
{
PointerRNA id_ptr;
- IDProperty *haystack;
- IDProperty *needle;
BLI_assert(ptr->owner_id != NULL);
@@ -5753,14 +5770,7 @@ static char *rna_path_from_ID_to_idpgroup(PointerRNA *ptr)
*/
RNA_id_pointer_create(ptr->owner_id, &id_ptr);
- haystack = RNA_struct_idprops(&id_ptr, false);
- if (haystack) { /* can fail when called on bones */
- needle = ptr->data;
- return rna_idp_path(&id_ptr, haystack, needle, NULL);
- }
- else {
- return NULL;
- }
+ return RNA_path_from_struct_to_idproperty(&id_ptr, ptr->data);
}
/**