UI: enable string properties for alt-click buttons for multiple objects #106599

Merged
Philipp Oeser merged 2 commits from lichtwerk/blender:106591 into main 2023-04-11 10:28:03 +02:00
Member

This came up in #106591 which reported that changing a Light Group would
not work when alt-clicking the property field (which is the usual method
to edit a property for multiple objects at once).

This is because string properties were not supported in
ui_selectcontext_apply which is now done.

Similar to 1318660b04 [which added support for pointer properties].

Adding general support for string properties means this method can now
be used for many more things:

  • changing all sorts of ID names (objects, meshes, ...)
  • many settings in modifiers (e.g. vertexgroups)
  • geometry nodes modifier properties (e.g. attribute names)
  • ...

Fixes #106591

This came up in #106591 which reported that changing a Light Group would not work when alt-clicking the property field (which is the usual method to edit a property for multiple objects at once). This is because string properties were not supported in `ui_selectcontext_apply` which is now done. Similar to 1318660b0449 [which added support for pointer properties]. Adding general support for string properties means this method can now be used for many more things: - changing all sorts of ID names (objects, meshes, ...) - many settings in modifiers (e.g. vertexgroups) - geometry nodes modifier properties (e.g. attribute names) - ... Fixes #106591
Philipp Oeser added 1 commit 2023-04-05 21:57:16 +02:00
2120195d0f UI: enable string properties for alt-click buttons for multiple objects
This came up in #106591 which reported that changing a Light Group would
not work when alt-clicking the property field (which is the usual method
to edit a property for multiple objects at once).

This is because string properties were not supported in
`ui_selectcontext_apply` which is now done.

Similar to 1318660b04 [which added support for pointer properties].

Adding general support for string properties means this method can now
be used for many more things:
- changing all sorts of ID names (objects, meshes, ...)
- many settings in modifiers (e.g. vertexgroups)
- geometry nodes modifier properties (e.g. attribute names)
- ...

Fixes #106591
Philipp Oeser added this to the User Interface project 2023-04-05 21:57:25 +02:00
Philipp Oeser requested review from Campbell Barton 2023-04-05 21:57:39 +02:00
Philipp Oeser requested review from Julian Eisel 2023-04-05 21:57:55 +02:00
Philipp Oeser requested review from Pablo Vazquez 2023-04-05 21:58:12 +02:00
Campbell Barton requested changes 2023-04-06 11:12:15 +02:00
@ -1952,1 +1953,4 @@
}
else if (rna_type == PROP_STRING) {
/* Not a delta in fact. */
RNA_property_string_get(&but->rnapoin, prop, delta.str);

The size of the string isn't known, this could easily overrun the buffer length.

Using RNA_property_string_get_alloc avoids the problem.

The size of the string isn't known, this could easily overrun the buffer length. Using `RNA_property_string_get_alloc` avoids the problem.
lichtwerk marked this conversation as resolved
Philipp Oeser added 1 commit 2023-04-06 12:01:04 +02:00
Campbell Barton approved these changes 2023-04-06 12:24:47 +02:00
Philipp Oeser merged commit 43eb3fe21a into main 2023-04-11 10:28:03 +02:00
Philipp Oeser deleted branch 106591 2023-04-11 10:28:04 +02:00
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
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, Assets & 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
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
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
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
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 project
No Assignees
2 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#106599
No description provided.