LibOverride: keep some anim data from liboverride when it exists in both IDs. #110900
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
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#110900
Loading…
Reference in New Issue
No description provided.
Delete Branch "mont29:liboverride-fix-animdata"
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?
So far when an anim data had to be created in liboverride (because none
existed in reference ID), and reference ID got an anim data added later,
that reference anim data would simply replace the one from the
liboverride, completely losing all animation-related work done so far in
the liboverride.
This commit fixes that, by adding some custom handling of anim data when
there is a liboverride operation defined on the
animation_data
RNAproperty itself.
It then behaves as if everything that is overridable in the existing
liboverride was defined as overrides (and therefore kept), while
everything else is replaced by the reference animdata:
liboverride are added at the end of the list of these from the
reference data.
Note that this behavior is only expected to happen once, on the first
call to 'apply overrides' after anim data has been added to the reference
linked ID. After that, since both IDs have animdata, there should be no
liboverride property defined for the
animation_data
property itself,but only for paths leading inside that animdata struct.
Implements #110067.
@SimonThommes you may also be interested in testing this ;)
Looks good to me, although I certainly have less understanding of overrides than you do. :-)
I think it could use a bit of testing to make sure it behaves the way people generally want. I'll bring it up in the animation & rigging module meeting today and see if I can get some testers. And I'll test myself as well (probably next Monday).
@blender-bot package
Package build started. Download here when ready.
c510924011
to267db2e309
@blender-bot package
Package build started. Download here when ready.
Just did a first test, and it worked great.
The test included four different object types (mesh, camera, lamp, and armature), and included animating both them and their data blocks in the linking file and then afterwards in the source library file. I also added a driver in the armature in in the library file. Everything worked as I would expect: the animation (actions) in the linking file are maintained, but the new driver from the library was brought over.
And then I realized I didn't try out any NLA stuff. So I'll give that a test next. But at least for basic animation and drivers in a simple test case, it's working as I would expect!
The NLA stuff also works as described: the NLA tracks from the library file get added below the tracks in the linking file.
However, I'm now wondering if that's actually the behavior we want? Maybe we just entirely leave out the tracks from the library file, in the spirit of "this file has already defined its animation"? I'm really not sure, though. Probably best to get feedback on that from people with recent production experience.
This is the expected behavior of NLA tracks, similar to e.g. modifiers or constraints stacks: new items can be added in liboverrides, on top of existing ones from linked reference data.
Only catch here is that NLA tracks not having unique names, liboverrides have to use indices as references, which is fairly weak and limits liboverrides tracks to always be added after linked ones (unlike modifiers or constraints, where added items can be placed freely in the stack).
The code LGTM! Just a tiny nag about a comment that can be handled when landing; the comments in general are much appreciated, and make it clear what's going on (and why).
@ -767,0 +771,4 @@
* by keeping the few overridable data from the liboverride, while using the animdata of the
* reference.
*
* Note that this case will not be encountered when the linked reference data already has an
Shouldn't this be "had"?
Also I think, since 'data' is uncountable & plural, this should either be "had anim data" or "had an anim data pointer".
Just gave it one last look over, and it looks good to me too!
Thanks, committed as
f188d6709f
.Pull request closed