NLA is editable even when the animation data is linked #105260
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#105260
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?
Blender Version
Broken: 2.80 to current main branch (
96abaae9ac57e3833f862bc0b562d2fe7a95f702
)Worked: probably never
Short description of error
The NLA is editable, even when the animation data is linked and thus should be read-only.
Exact steps for others to reproduce the error
nla-link-test.blend
Observed behaviour: the NLA strip can be moved.
Expected behaviour: the NLA data of the linked object should be read-only. Just like the cube itself (you cannot move it).
Subscribing.
looks like the way to disable editing for linked NLA is in nla_select.c and nla_edit.c
wherever you see:
/* get editor data */
if (ANIM_animdata_get_context(C, &ac) == 0) {
return OPERATOR_CANCELLED;
}
replace it with:
/* get editor data and make sure active object is not linked */
Object *ob = CTX_data_active_object(C);
if ((ANIM_animdata_get_context(C, &ac) == 0) || (ob && ob->id.lib)) {
return OPERATOR_CANCELLED;
}
This cancels all attempts at editing when the active object is a linked one.
I tested it and can't edit anything in the NLA editor for the linked cube, but I'm brand new to the blender code base, don't want to presume anything.
Thanks @Jay-Mckee for helping out :)
Unfortunately this is not enough. The animation data may be owned by other objects (when the "Selected Only" filter is turned off), so the check will have to be done somewhere else.
As for the check itself, that shouldn't access
ob->id.lib
directly, but rather useID_IS_LINKED(ob->id)
. There are a bunch of macros inDNA_ID.h
that can help with these kind of tests.Probably related: The NLA track edibility can be toggled by pressing tab.
Testing this in 3.5.1
the last step in this "See that the strip edit has not been saved to disk." is working for me, meaning I can open and edit the animation strip data and save it and it opens correctly.
@cgtinker you are correct the UI click for unlock and mute for an object that is linked in and not overridden is not possible.
Hitting TAB does seem to get around the flag that says it you can't edit a linked datablock.
So in this case the main "fix" is that the TAB shortcut key for some reason is able to lock/unlock the track while it says it shouldn't be able to
Seem like all nla edit methods filter before starting to work on nla strips – how about adding a new filter flag? B.e.
ANIMFILTER_DATA_NOT_LINKED
and filter using the strips id propID_IS_LINKED(strip->act)
.This would just add a flag in various places in the end.
I think
ANIMFILTER_DATA_LOCAL
would be a better name (I prefer avoiding negations). Then again, maybe adding theID_IS_LINKED(strip->act)
to theANIMFILTER_FOREDIT
filtering could be enough?Denys Hsu referenced this issue2023-05-08 21:29:12 +02:00
@dr.sybren , this looks like a part of #98712