Lots of animation-related operators do not check if the data is editable or not #98712

Open
opened 2022-06-09 09:14:53 +02:00 by Bastien Montagne · 6 comments

Many animation-related operators do not do any check whether the data-block they operate on is linked, liboverride or fully local data. This seems to affect in particular operations from the 3DView (like key insertions), and in the NLA (like adding new tracks, duplicating strips, etc.).

E.g. one can insert keyframes on a linked object (ie create animdata for that linked object, a new local action, and assign that local action to the linked object!).

Related to issue reported in #98686 (Cant rename local NLA tracks within a local library override data-block.).

Many animation-related operators do not do any check whether the data-block they operate on is linked, liboverride or fully local data. This seems to affect in particular operations from the 3DView (like key insertions), and in the NLA (like adding new tracks, duplicating strips, etc.). E.g. one can insert keyframes on a linked object (ie create animdata for that linked object, a new local action, and assign that local action to the linked object!). Related to issue reported in #98686 (Cant rename local NLA tracks within a local library override data-block.).
Author
Owner

Changed status from 'Needs Triage' to: 'Confirmed'

Changed status from 'Needs Triage' to: 'Confirmed'
Author
Owner

Added subscriber: @mont29

Added subscriber: @mont29
Author
Owner

NOTE: Setting to Bug type for now since this is a fairly serious issue (people can easily lose a lot of work with that kind of loophole), but could also be considered a TODO, since an full careful check of all possible operation will take a lot of time...

NOTE: Setting to `Bug` type for now since this is a fairly serious issue (people can easily lose a lot of work with that kind of loophole), but could also be considered a TODO, since an full careful check of all possible operation will take a lot of time...

Added subscriber: @dr.sybren

Added subscriber: @dr.sybren

@mont29 what would you suggest as the proper solution? I don't think copying the changes from a91c8d8efa into many other places would be a particularly attractive design. Is there a function that combines (id != NULL && (ID_IS_LINKED(id) || ID_IS_OVERRIDE_LIBRARY(id)))? I'm guessing that for much of the code it's only relevant whether a datablock can be edited, and not so much why (not).

@mont29 what would you suggest as the proper solution? I don't think copying the changes from a91c8d8efa into many other places would be a particularly attractive design. Is there a function that combines `(id != NULL && (ID_IS_LINKED(id) || ID_IS_OVERRIDE_LIBRARY(id)))`? I'm guessing that for much of the code it's only relevant whether a datablock can be edited, and not so much why (not).
Author
Owner

@dr.sybren that NLA change is more complex for several reasons, mainly thanks to the fact that NLA supports inserting strips/tracks into an override data... a bit similar to the modifiers/constraints case.

We have e.g BKE_id_is_editable, which should be enough in almost all cases here. It just does not check that the id is non-null, ;)

@dr.sybren that NLA change is more complex for several reasons, mainly thanks to the fact that NLA supports inserting strips/tracks into an override data... a bit similar to the modifiers/constraints case. We have e.g `BKE_id_is_editable`, which should be enough in almost all cases here. It just does not check that the id is non-null, ;)
Philipp Oeser removed the
Interest
Animation & Rigging
label 2023-02-09 14:34:49 +01:00
Sybren A. Stüvel added this to the Animation & Rigging project 2023-07-10 15:36:58 +02:00
Sybren A. Stüvel changed title from Lots of animation-related operators do not check if the data is editable or not. to Lots of animation-related operators do not check if the data is editable or not 2023-07-10 15:38:08 +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 Assignees
2 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#98712
No description provided.