diff options
author | Alexander Gavrilov <angavrilov@gmail.com> | 2019-11-16 20:50:59 +0300 |
---|---|---|
committer | Alexander Gavrilov <angavrilov@gmail.com> | 2019-12-04 12:23:41 +0300 |
commit | b3f388dca9e547c12db277b8422c620ca3b64eaa (patch) | |
tree | ffbf14c7371ef7dd96ac49cb0c6e1810c1708f6f /source/blender/blenkernel/intern/context.c | |
parent | fda791ab1241534e377bee84b3a214e1343094af (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/blenkernel/intern/context.c')
-rw-r--r-- | source/blender/blenkernel/intern/context.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/context.c b/source/blender/blenkernel/intern/context.c index 2e4f756ce68..e3d95bb660f 100644 --- a/source/blender/blenkernel/intern/context.c +++ b/source/blender/blenkernel/intern/context.c @@ -466,6 +466,18 @@ PointerRNA CTX_data_pointer_get_type(const bContext *C, const char *member, Stru return PointerRNA_NULL; } +PointerRNA CTX_data_pointer_get_type_silent(const bContext *C, const char *member, StructRNA *type) +{ + PointerRNA ptr = CTX_data_pointer_get(C, member); + + if (ptr.data && RNA_struct_is_a(ptr.type, type)) { + return ptr; + } + else { + return PointerRNA_NULL; + } +} + ListBase CTX_data_collection_get(const bContext *C, const char *member) { bContextDataResult result; |