Fix #120058: Crash on undo rename in edit mode #120099
No reviewers
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
4 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#120099
Loading…
Reference in New Issue
No description provided.
Delete Branch "Jake-Faulkner/blender:Fix-120058"
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?
Drop the check for the return of
BKE_id_new_name_validate
, as it doesn't indicate if the name changed. More correct would be to replace it with a check for if the new name is different than the old, but I don't see any neat way to do that from down here.Other check might also be replaced with an assert, but I'm less sure about that?
Just noting that the regression was caused by
195bb4f8f5
@mod_moder can you explain me what is linked to overrides in this PR?
I am not really familiar with this code so that is simple: i see
ID_IS_LINKED
and os i link overrides here.@Jake-Faulkner Thanks for the PR! You have correctly identified the cause of the issue, but the proposed solution here is not correct.
This function is only here to ensure that the name of the ID is unique, it can be called from other codepaths than renaming an existing ID.
I think the proper solution here is to finally have a new
BKE_libblock_rename(Main &bmain, ID &id, StringRefNull old_name, StringRefNull new_name)
function, which would ensure all required actions on ID rename are performed (afaik, at least two different code handle ID renaming: RNA, and the Outliner).BKE_main_namemap_remove_name
with the old name.BKE_libblock_ensure_unique_name
.bmain.is_memfile_undo_written
to false.When in doubt (and given the fact that
ID_IS_LINKED
is not relevant for the changes here), it is better to not do anything here then@Jake-Faulkner Thanks again for identifying to source issue of this crash and for the PR,
Given the severity of the bug (and therefore the urgency to fix it, and get it to sink a bit in main before backporting to 4.1.1), I went ahead and created an alternate fix (!120196).
Turns out we already had a
BKE_libblock_rename
that did everything correctly, we 'just' needed to use it everywhere!Pull request closed