Add more control over ID renaming behavior. #126996
No reviewers
Labels
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset System
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
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
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
Core
Module
Development Management
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
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 project
No Assignees
5 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#126996
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "mont29/blender:tmp-id-rename"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
This commit adds low-level logic in BKE to support three behaviors in
case of name conflict when renaming an ID:
name).
other ID name.
current renamed ID's name.
It also adds quite some changes to IDTemplate, Outliner code, and
RNA-defined UILayout code, and the lower-level UI button API, to allow
for the new behavior defined in the design (i.e. option three from above list).
When renaming from the UI either 'fails' (falls back to adjusted name) or forces
renaming another ID, an INFO report is displayed.
This commit also fixes several issues in existing code, especially
regarding undo handling in rename operations (which could lead to saving
the wrong name in undo step, and/or over-generating undo steps).
API wise, the bahavior when directly assigning a name to the
ID.name
property remains unchanged (option one from the list above). But a new
API call
ID.rename
has been added, which offers all three behaviors.Unittests were added to cover the new implemented behaviors (both at
BKE level, and the RNA/Py API).
This commit implements #119139 design.
@blender-bot package
Package build started. Download here when ready.
@blender-bot build package
Unknown platform
package
. See documentation for details.@blender-bot package
Package build started. Download here when ready.
@blender-bot package
Package build started. Download here when ready.
Feels pretty good to me like this 👍
I thought briefly about whether the suffix should be swapped on collision with the same prefix, rather than taking the lowest available value. But after thinking about it a bit, I think the current behavior regarding this is fine.
@blender-bot build
@blender-bot package
Package build started. Download here when ready.
@blender-bot package linux
Package build started. Download here when ready.
@blender-bot build linux
@blender-bot package
Package build started. Download here when ready.
Nice! Can we tweak the report text a little?
Currently it is:
It mentions the item that we've just typed, so it's not so relevant. Do we know at this point what new name the other data-block got? That could be more useful to know.
What do you think of:
No the new name (or other renamed ID) is not available from the code that generate the report... We could add it too, need to return a struct instead of a simple result value then though.
@blender-bot package
Package build started. Download here when ready.
@blender-bot package
Package build started. Download here when ready.
Would be good to get final review on this one now, it's already a tad late in release cycle for ideal merge window for that type of non-trivial changes...
@blender-bot build
@blender-bot package
Package build started. Download here when ready.
Seems to work as expected! Much nicer. Thanks! +1 on my side
On the UI code side this seems fine, didn't check much on the rest.
Just one small issue, I'm getting a warning:
I don't see
ED_id_management.hh
added to any CMake file, and it's not included ined_id_management.cc
.@blender-bot build
@blender-bot build
@blender-bot build
@blender-bot build