Fix #111067: NLA tracks cannot be renamed from Outliner #111110

Merged
Philipp Oeser merged 1 commits from lichtwerk/blender:111067 into main 2023-08-14 15:27:25 +02:00
Member

Outliner do_item_rename has checks so linked or overridden IDs cannot
be renamed.

A TreeStoreElems ID can point to other data than "real" IDs though
(see how outliner_add_element casts to an ID from an arbitrary void
pointer and cases marked /* NO ID */ in code). In those cases,
ID_IS_LINKED or ID_IS_OVERRIDE_LIBRARY could return true and a the
renaming operation would fail.

Now also check if this is a real ID (TSE_IS_REAL_ID), so code can
continue.

Also add a proper notifier, so track renaming from the Outliner will
update the NLA immediately.

Outliner `do_item_rename` has checks so linked or overridden IDs cannot be renamed. A `TreeStoreElem`s ID can point to other data than "real" IDs though (see how `outliner_add_element` casts to an ID from an arbitrary void pointer and cases marked `/* NO ID */` in code). In those cases, `ID_IS_LINKED` or `ID_IS_OVERRIDE_LIBRARY` _could_ return true and a the renaming operation would fail. Now also check if this is a real ID (`TSE_IS_REAL_ID`), so code can continue. Also add a proper notifier, so track renaming from the Outliner will update the NLA immediately.
Philipp Oeser added 1 commit 2023-08-14 12:49:07 +02:00
30c2259bcc Fix #111067: NLA tracks cannot be renamed from outliner
Outliner `do_item_rename` has checks so linked or overridden IDs cannot
be renamed.

A `TreeStoreElem`s ID can point to other data than "real" IDs though
(see how `outliner_add_element` casts to an ID from an arbitrary void
pointer and cases marked `/* NO ID */` in code). In those cases,
`ID_IS_LINKED` or `ID_IS_OVERRIDE_LIBRARY` _could_ return true and a the
renaming operation would fail.

Now also check if this is a real ID (`TSE_IS_REAL_ID`), so code can
continue.

Also add a proper notifier, so track renaming from the Outliner will
update the NLA immediately.
Philipp Oeser added this to the User Interface project 2023-08-14 12:49:30 +02:00
Philipp Oeser added the
Interest
Core
Interest
Animation & Rigging
labels 2023-08-14 12:50:02 +02:00
Philipp Oeser requested review from Julian Eisel 2023-08-14 12:50:11 +02:00
Philipp Oeser requested review from Bastien Montagne 2023-08-14 12:50:22 +02:00
Julian Eisel approved these changes 2023-08-14 12:51:44 +02:00
Bastien Montagne approved these changes 2023-08-14 14:17:52 +02:00
Bastien Montagne left a comment
Owner

Patch LGTM.

It raises the question of editing non-ID data that should not be editable though? Looks like this function does not take into account fact like 'NLA tracks from linked data should not be renamed' (and probably many more similar cases)?

Patch LGTM. It raises the question of editing non-ID data that should not be editable though? Looks like this function does not take into account fact like 'NLA tracks from linked data should not be renamed' (and probably many more similar cases)?
Author
Member

Patch LGTM.

It raises the question of editing non-ID data that should not be editable though? Looks like this function does not take into account fact like 'NLA tracks from linked data should not be renamed' (and probably many more similar cases)?

Will look at that separately

> Patch LGTM. > > It raises the question of editing non-ID data that should not be editable though? Looks like this function does not take into account fact like 'NLA tracks from linked data should not be renamed' (and probably many more similar cases)? Will look at that separately
Philipp Oeser merged commit cf43477839 into main 2023-08-14 15:27:25 +02:00
Philipp Oeser deleted branch 111067 2023-08-14 15:27:27 +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
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#111110
No description provided.