Fix: UI: cannot copy-paste many array buttons in nodes #108349

Merged
Philipp Oeser merged 2 commits from lichtwerk/blender:108096_b into blender-v3.6-release 2023-06-06 14:24:52 +02:00
Member

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).

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).
Philipp Oeser added 1 commit 2023-05-27 12:51:17 +02:00
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, now changed to `PROP_XYZ`
which does make sense for vectors and doesnt have other relevant
behavior changes (except for maybe the auto-coloring fcurves when
keyframing).
Philipp Oeser added this to the Module: Nodes & Physics project 2023-05-27 12:51:23 +02:00
Philipp Oeser added the
Interest
User Interface
label 2023-05-27 12:51:35 +02:00
Philipp Oeser requested review from Hans Goudey 2023-05-27 12:51:59 +02:00
Philipp Oeser requested review from Harley Acheson 2023-05-27 12:52:19 +02:00
Member

It seems odd to me that ui_but_has_array_value uses a list of subtypes for this. Could it not use RNA_property_array_check(but->rnaprop) as part of its test?

It seems odd to me that `ui_but_has_array_value` uses a list of subtypes for this. Could it not use `RNA_property_array_check(but->rnaprop)` as part of its test?
Author
Member

It seems odd to me that ui_but_has_array_value uses a list of subtypes for this. Could it not use RNA_property_array_check(but->rnaprop) as part of its test?

Was thinking the same initially, but went with the less disruptive fix first.
Still think RNA_property_array_check is probably better for this, would enable us to get rid of a function and save us from future issues like this afaict.

Still, I often find myself prefering to not mix fixes and such "cleanup".

> It seems odd to me that `ui_but_has_array_value` uses a list of subtypes for this. Could it not use `RNA_property_array_check(but->rnaprop)` as part of its test? Was thinking the same initially, but went with the less disruptive fix first. Still think RNA_property_array_check is probably better for this, would enable us to get rid of a function and save us from future issues like this afaict. Still, I often find myself prefering to not mix fixes and such "cleanup".
Member

TBH it seems like what Harley suggests is the way to go. RNA should know much better which RNA property buttons have arrays than the UI code. The way it is right now looks redundant.

TBH it seems like what Harley suggests is the way to go. RNA should know much better which RNA property buttons have arrays than the UI code. The way it is right now looks redundant.
Philipp Oeser added 1 commit 2023-06-06 12:31:32 +02:00
Author
Member

Yeah, lets do it that way then

Yeah, lets do it that way then
Hans Goudey approved these changes 2023-06-06 13:54:37 +02:00
Philipp Oeser merged commit 014825dd26 into blender-v3.6-release 2023-06-06 14:24:52 +02:00
Philipp Oeser deleted branch 108096_b 2023-06-06 14:24:53 +02:00
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset System
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Code Documentation
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
FBX
Interest
Freestyle
Interest
Geometry Nodes
Interest
glTF
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Viewport & EEVEE
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Asset Browser Project
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Asset System
Module
Core
Module
Development Management
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Module
Viewport & EEVEE
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Severity
High
Severity
Low
Severity
Normal
Severity
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No Assignees
3 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#108349
No description provided.