Armature driving other object visibility gets out of sync if the parent collection is hidden/shown again in viewport #102148

Open
opened 2022-10-29 18:29:55 +02:00 by Lucho · 11 comments

System Information
Operating system: Windows-10-10.0.22000-SP0 64 Bits
Graphics card: NVIDIA GeForce RTX 3060/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 522.25

Blender Version
Broken: version: 3.3.1, branch: master, commit date: 2022-10-04 18:35, hash: b292cfe5a9
Worked: Never

Short description of error
With a linked override library with some driver on some linked object (render or viewport visibility), if you disable viewport visibility for one parent collection of that object, when the file went open again the changes made to the linked armature gets messy and a resync is needed.
Note that it happens only if there is some driver on one of the linked objects.

Original file:
override_driver_original.blend
Linked file:
override_driver_linked.blend

Exact steps for others to reproduce the error

  • Open the file named "override_driver_linked.blend"
  • Move "Armature" somewhere
  • Enter in Pose Mode and move the Bone somewhere, exit from Pose Mode
  • Disable from viewport the parent collection, named "Collection.001" (Globally disable in viewport)
  • Save the file and exit
  • Re-open the file
  • Make the "Collection.001" visibile again, note that both the armature and the object are misplaced!
  • Enter in Pose Mode, note that the object move but the armature is still misplaced!
  • Make a Resync on the armature to replace all in the right position
**System Information** Operating system: Windows-10-10.0.22000-SP0 64 Bits Graphics card: NVIDIA GeForce RTX 3060/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 522.25 **Blender Version** Broken: version: 3.3.1, branch: master, commit date: 2022-10-04 18:35, hash: `b292cfe5a9` Worked: Never **Short description of error** With a linked override library with some driver on some linked object (render or viewport visibility), if you disable viewport visibility for one parent collection of that object, when the file went open again the changes made to the linked armature gets messy and a resync is needed. Note that it happens only if there is some driver on one of the linked objects. Original file: [override_driver_original.blend](https://archive.blender.org/developer/F13798902/override_driver_original.blend) Linked file: [override_driver_linked.blend](https://archive.blender.org/developer/F13798915/override_driver_linked.blend) **Exact steps for others to reproduce the error** - Open the file named "override_driver_linked.blend" - Move "Armature" somewhere - Enter in Pose Mode and move the Bone somewhere, exit from Pose Mode - Disable from viewport the parent collection, named "Collection.001" (Globally disable in viewport) - Save the file and exit - Re-open the file - Make the "Collection.001" visibile again, note that both the armature and the object are misplaced! - Enter in Pose Mode, note that the object move but the armature is still misplaced! - Make a Resync on the armature to replace all in the right position
Author

Added subscriber: @Lucho

Added subscriber: @Lucho
Member

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

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

Added subscriber: @mont29

Added subscriber: @mont29

This has nothing to do with overrides, the same happens with purely local data (if you apply steps above to override_driver_original.blend)... For me objects goes back to where it belongs as soon as I start moving the bone in pose mode though.

Anyway, this is an update issue (would bet wrong/missing tagging from code toggling the collection visibility).

This has nothing to do with overrides, the same happens with purely local data (if you apply steps above to `override_driver_original.blend`)... For me objects goes back to where it belongs as soon as I start moving the bone in pose mode though. Anyway, this is an update issue (would bet wrong/missing tagging from code toggling the collection visibility).

Added subscriber: @dr.sybren

Added subscriber: @dr.sybren

I'd actually like to get feedback from #dependency_graph team here too, maybe @dr.sybren would be interested, since this seems to involve armatures/drivers/depsgraph?

rna_Collection_flag_update only sets ID_RECALC_COPY_ON_WRITE on the affected collection, and then tags relations for updates. Not sure if that's supposed to be enough or even if that's how this is supposed to be handled.

I'd actually like to get feedback from #dependency_graph team here too, maybe @dr.sybren would be interested, since this seems to involve armatures/drivers/depsgraph? `rna_Collection_flag_update` only sets `ID_RECALC_COPY_ON_WRITE` on the affected collection, and then tags relations for updates. Not sure if that's supposed to be enough or even if that's how this is supposed to be handled.
Bastien Montagne changed title from Library Override with driver gets messy if the parent collection is hidden to Armature driving other object visibility gets out of sync if the parent collection is hidden/shown again in viewport 2022-11-15 16:50:14 +01:00

Added subscribers: @JacquesLucke, @Sergey

Added subscribers: @JacquesLucke, @Sergey

Bastien and I did a little digging, and as it turns out, the driver isn't strictly necessary. Having any animation data on the Cube viewport visibility is enough to trigger this behaviour.

When the Cube visibility is animated/driven, Cube and Armature are present in the depsgraph, even when the parent collection is disabled (and thus its contents are never visible, regardless of the animation). This is probably handled correctly during depsgraph evaluation, leaving them less-than-fully evaluated. When the parent collection is made visible again, it's likely that Cube and Armature don't get recomputed (we suspect because their direct visibility didn't change), hence the bad positioning.

@Sergey @JacquesLucke what would you think would be the right way to solve this?

Bastien and I did a little digging, and as it turns out, the driver isn't strictly necessary. Having any animation data on the Cube viewport visibility is enough to trigger this behaviour. When the Cube visibility is animated/driven, `Cube` and `Armature` are present in the depsgraph, even when the parent collection is disabled (and thus its contents are never visible, regardless of the animation). This is probably handled correctly during depsgraph evaluation, leaving them less-than-fully evaluated. When the parent collection is made visible again, it's likely that `Cube` and `Armature` don't get recomputed (we suspect because their direct visibility didn't change), hence the bad positioning. @Sergey @JacquesLucke what would you think would be the right way to solve this?

There was quite some work put into making it so depsgraph can properly "recover" from partially evlauated ID becoming visible. Think the main part is the D15498, and with some followup fixes. It might be possible that something is still not handled properly there.

Such a depsgraph reaction to visibility updates is not cheap, so there are some limiters set in place and only specific set of cases will trigger that code path. I think of is that the ID_RECALC_COPY_ON_WRITE tag on the collection does not trigger visibility update in the dependency graph. So a quick verification of where the root of the problem lies would be to tag scene for ID_RECALC_BASE_FLAGS next to the collection ID tag. If that solves the problem then we need to make depsgrapgh properly react for visibility changes when the collection changes. If that extra tag does not fix the issue a deeper investigation is needed.

There was quite some work put into making it so depsgraph can properly "recover" from partially evlauated ID becoming visible. Think the main part is the [D15498](https://archive.blender.org/developer/D15498), and with some followup fixes. It might be possible that something is still not handled properly there. Such a depsgraph reaction to visibility updates is not cheap, so there are some limiters set in place and only specific set of cases will trigger that code path. I think of is that the `ID_RECALC_COPY_ON_WRITE` tag on the collection does not trigger visibility update in the dependency graph. So a quick verification of where the root of the problem lies would be to tag scene for `ID_RECALC_BASE_FLAGS` next to the collection ID tag. If that solves the problem then we need to make depsgrapgh properly react for visibility changes when the collection changes. If that extra tag does not fix the issue a deeper investigation is needed.
Philipp Oeser removed the
Interest
Core
label 2023-02-09 14:42:46 +01:00

Hi, sorry if this is offtopic, but I've been plagued by a similar issue this year on most professional projects, armatures keep snapping to a "false" pose from a specific arbitrary frame. It happens at some point in files during the project, and I managed to strip 2 files of all other data part the ones causing this issue. Both case are totally different, but same symptoms, just the trigger seems different.
In this first one, removing the armature from the collection makes it behave normally again:
105873.blend

And on this one, deleting the objects does it, because the mesh's material references an empty that's child constrained on a bone:
Second_bug_test_05.blend

To reproduce the bug, just enter pose mode or select a bone to trigger the false pose, and scroll the timeline to reseal the real animation data.
I reported both when each happened, and it's been confirmed, but I received no other answer, even if this seems like a massive showstopper issue for anyone wanting to use blender for character animation. This thread might be archive, but if these two files can help getting to the root of this issue that would be amazing.

Hi, sorry if this is offtopic, but I've been plagued by a similar issue this year on most professional projects, armatures keep snapping to a "false" pose from a specific arbitrary frame. It happens at some point in files during the project, and I managed to strip 2 files of all other data part the ones causing this issue. Both case are totally different, but same symptoms, just the trigger seems different. In this first one, removing the armature from the collection makes it behave normally again: 105873.blend And on this one, deleting the objects does it, because the mesh's material references an empty that's child constrained on a bone: Second_bug_test_05.blend **To reproduce the bug, just enter pose mode or select a bone to trigger the false pose, and scroll the timeline to reseal the real animation data.** I reported both when each happened, and it's been confirmed, but I received no other answer, even if this seems like a massive showstopper issue for anyone wanting to use blender for character animation. This thread might be archive, but if these two files can help getting to the root of this issue that would be amazing.

@loicbramoulle From the information I gather about your case it is not related to the visibility drivers. If that is indeed so please submit a dedicated report.

@loicbramoulle From the information I gather about your case it is not related to the visibility drivers. If that is indeed so please submit a dedicated report.
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
6 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#102148
No description provided.