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.
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user