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-08-14 19:17:52 +0300
committerAlexander Gavrilov <angavrilov@gmail.com>2019-08-14 19:18:13 +0300
commit16c28b5a6784dfdc22535cef14961a9a95136a44 (patch)
treefb604f91d4a849a906810e7be696fd275f501359 /source/blender/editors/interface/interface_ops.c
parent9ac3964be198a9bcbbcf2cda2ecd99047eae560f (diff)
UI: suppress Copy/Paste/Edit Driver options on whole array property fields.
When a button represents the whole array (e.g. color picker buttons), these context menu options were available, but didn't really work correctly. Since it's not clear how they could reasonably work without a valid index, it's better to hide them.
Diffstat (limited to 'source/blender/editors/interface/interface_ops.c')
-rw-r--r--source/blender/editors/interface/interface_ops.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/source/blender/editors/interface/interface_ops.c b/source/blender/editors/interface/interface_ops.c
index f5a894d7620..6051bf5ca40 100644
--- a/source/blender/editors/interface/interface_ops.c
+++ b/source/blender/editors/interface/interface_ops.c
@@ -172,7 +172,8 @@ static bool copy_as_driver_button_poll(bContext *C)
UI_context_active_but_prop_get(C, &ptr, &prop, &index);
if (ptr.id.data && ptr.data && prop &&
- ELEM(RNA_property_type(prop), PROP_BOOLEAN, PROP_INT, PROP_FLOAT, PROP_ENUM)) {
+ ELEM(RNA_property_type(prop), PROP_BOOLEAN, PROP_INT, PROP_FLOAT, PROP_ENUM) &&
+ (index >= 0 || !RNA_property_array_check(prop))) {
path = RNA_path_from_ID_to_property(&ptr, prop);
if (path) {