Renaming an ID through RNA does not consistently increment OTHER or CURRENT ID in case of name collision #71244
Labels
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
6 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#71244
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
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?
Renaming an ID through RNA does not consistently increment either the current ID or the other ID in case of name collision. This depends on the existing order of the data-blocks before the rename happens.
As pointed out in the comment below by @ideasman42, fixing this in one way or the other is trivial. But we have to choose one of the two solutions:
Note that it should also be ensured that behavior is consistent with Outliner renaming code as well.
Original Report
System Information
Operating system: Windows-10-10.0.17134 64 Bits
Graphics card: GeForce GTX 1070/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 431.60
Blender Version
Broken: version: 2.80 (sub 75), branch: master, commit date: 2019-07-29 14:47, hash:
f6cb5f5449
Worked: (optional)
Short description of error
when we try to rename an object with an already used name,, it will rename the existing occurence, not the incoming one
Exact steps for others to reproduce the error
works with the default scene (with Cube, Light, Camera) :
I gess it should be the opposite : the incoming similar name is incremented, but the original name stays the same
Added subscriber: @BoUBoU
#90052 was marked as duplicate of this issue
Added subscriber: @ideasman42
This has come up before.
Internal detail: which data-block gets numbered depends on the current order, So if you first rename the cube to
A
, then rename toCamera
, this wont happen.We can change this so the item you're renaming always gets numbered and you never accidentally rename other items.
However sometimes users want this behavior, having to find the item and rename it so this one can take it's place (while arguably correct) is tedious.
This is more a design task though, how it works isn't great but isn't a mistake in the code.
Automatic renaming increment the existing name, and not the incoming oneto Renaming an ID through RNA does not consistantly increment OTHER or CURRENT ID in case of name collisionAdded subscriber: @mont29
Renaming an ID through RNA does not consistantly increment OTHER or CURRENT ID in case of name collisionto Renaming an ID through RNA does not consistently increment OTHER or CURRENT ID in case of name collisionI would also rather just increment current ID's name, instead of changing some random other ID's name…
We could also add an operator to allow the other behavior (i.e. always set affected ID to exactly given name, and rename the other in case of name collision)?
@mont29 while incrementing the current ID is the correct solution - I suspect some users will run into situations where they don't know or care what the other ID is called and want to take it's name.
Did you have an idea how this operator would be accessed?
I was thinking we could...
This way only intentional removal of the extension renames the other data & only from the UI.
The Python API could have a function for this if it's needed.
Added subscribers: @WilliamReynish, @pablovazquez
@ideasman42 I don’t have a very strong opinion, but even for UI, I would not try to be smart… even though I can see how much more friendly/handy that behavior would be, compared to having to call some 'force rename' operator, this would introduce a weird special behavior which might backfire in some cases as well.
Note that we want to add a 'contextual' menu to ID template, since we are adding more and more operations there and we cannot keep adding buttons and/or weird 'Shift-click' thingies. So exposing that would be a natural place for that 'force rename' operator I guess? We could also add some 'Shift-click' on the name field to trigger 'force rename' behavior I guess…
Think we could use the #user_interface team advice here as well, @pablovazquez ? @WilliamReynish ?
Added subscriber: @c2ba
Added subscriber: @kioku
As I have run into this recently - this behaviour should change. Hidden renaming of things is really bad - especially if you setup names carefully for further processing.
Guess a 'force' flag in the F2 rename would be fine tho.
Added subscribers: @marty3000, @PratikPB2123, @lichtwerk, @kursadk
Reported again in #115192 / !116246, was agreed to go for 'always rename newly-named data' behavior for the time being. Committed as
195bb4f8f5
.The opposite behavior (rename existing data) can be implemented separately for the UI renaming aspect.
Think we can close this task too now.