From 014825dd26b38a448e1872d8a1490076be14592b Mon Sep 17 00:00:00 2001 From: Philipp Oeser Date: Tue, 6 Jun 2023 14:24:45 +0200 Subject: [PATCH] Fix: UI: cannot copy-paste many array buttons in nodes This came up in #108096 Reason this fails is the `ui_but_has_array_value` check [which depends on a property subtype that supports arrays]. The default `VectorBuilder` has a `PropertySubType` of `PROP_NONE` though, so one possibility would be to change this to `PROP_XYZ`. However, RNA should know much better which RNA property buttons have arrays than the UI code, so use RNA_property_array_check now (instead of checking particular UI property subtypes). Pull Request: https://projects.blender.org/blender/blender/pulls/108349 --- .../blender/editors/interface/interface_query.cc | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/source/blender/editors/interface/interface_query.cc b/source/blender/editors/interface/interface_query.cc index 133aa57e1a0..d429e73cc45 100644 --- a/source/blender/editors/interface/interface_query.cc +++ b/source/blender/editors/interface/interface_query.cc @@ -122,21 +122,7 @@ bool ui_but_is_popover_once_compat(const uiBut *but) bool ui_but_has_array_value(const uiBut *but) { - return (but->rnapoin.data && but->rnaprop && - ELEM(RNA_property_subtype(but->rnaprop), - PROP_COLOR, - PROP_TRANSLATION, - PROP_DIRECTION, - PROP_VELOCITY, - PROP_ACCELERATION, - PROP_MATRIX, - PROP_EULER, - PROP_QUATERNION, - PROP_AXISANGLE, - PROP_XYZ, - PROP_XYZ_LENGTH, - PROP_COLOR_GAMMA, - PROP_COORDS)); + return (but->rnapoin.data && but->rnaprop && RNA_property_array_check(but->rnaprop)); } static wmOperatorType *g_ot_tool_set_by_id = nullptr;