Depsgraph doesn't add the correct relations to a Bone driver unless it is recreated from scratch #121874

Open
opened 2024-05-16 15:49:27 +02:00 by Sebastian Parborg · 2 comments

System Information
Operating system: Gentoo Linux
Graphics card: AMD Radeon Vega Frontier Edition

Blender Version
Broken: Since a least Blender 4.1, but I don't think this is a new issue.

Short description of error
It seems like depsgraph doesn't correctly add all the needed dependencies to certain bone drivers.
Even after using the "Update dependencies" button in the driver editor.

It also seems like Cycles takes the result of the depsgraph viewport evaluation instead of the render evaluation for final animation renders.

Exact steps for others to reproduce the error

  1. Open the attached example .blend file
  2. Step back and forth in the timeline. Note that the shape of the mesh or the bendy bones stays the same.
  3. If you render the animation (ctrl f12), notice that the resulting shape is deformed strangely:
    image
  4. If you untick "Disable in Renders" for the ctrl collection it now renders correctly:
    image

You can also see this happen in the viewport playback if you enable "Disable in Viewport" for the ctrl collection.

Cycles funkyness

While testing this out I noticed that Cycles doesn't have any issues with "Disable in Renders". But if you flip it around so you have the ctrl collection be "Disable in Viewport" but not "Disable in Renders", then Cycles has the same issue as Eevee/Workbench.

Seems like Cycles is using the viewport evaluation and not the render evaluation? Probably an other bug that this issue showcases, right?

Further analysis

I did some more digging and noticed that the two drivers in the scene does not have the same amount of depsgraph in/out dep arrows in the debug renders:
image
Note that the "ease out" driver has three "in" arrows and one "out" while the problematic "ease in" driver only as two "in" arrows and one "out" arrow.

If I manually delete the driver and recreate it from scratch (not copy/pasting it), things starts working again and the new depsgraph debug export now shows that the "ease in" driver now has the same in/out arrows as the other driver:
image

Note that it now correctly is linked to ctrl_upWaistTube_BBoneSubA_001_L, while in the first image it was not.

To me it seems weird that this was missing in the first place and even more weird that the "Update dependencies" button in the action editor did not solve this issue. However, deleting and recreating the driver from scratch does make depsgraph derive the correct relationships.

Here is the driver in question for reference:
image

**System Information** Operating system: Gentoo Linux Graphics card: AMD Radeon Vega Frontier Edition **Blender Version** Broken: Since a least Blender 4.1, but I don't think this is a new issue. **Short description of error** It seems like depsgraph doesn't correctly add all the needed dependencies to certain bone drivers. Even after using the "Update dependencies" button in the driver editor. It also seems like Cycles takes the result of the depsgraph viewport evaluation instead of the render evaluation for final animation renders. **Exact steps for others to reproduce the error** 1. Open the attached example .blend file 2. Step back and forth in the timeline. Note that the shape of the mesh or the bendy bones stays the same. 3. If you render the animation (ctrl f12), notice that the resulting shape is deformed strangely: ![image](/attachments/3d9a3d50-8ec0-4d63-996e-698da6189e41) 4. If you untick "Disable in Renders" for the `ctrl` collection it now renders correctly: ![image](/attachments/8171276f-774b-4427-8acf-38c0f36ab850) You can also see this happen in the viewport playback if you enable "Disable in Viewport" for the `ctrl` collection. ## Cycles funkyness While testing this out I noticed that Cycles doesn't have any issues with "Disable in Renders". But if you flip it around so you have the `ctrl` collection be "Disable in Viewport" but not "Disable in Renders", then Cycles has the same issue as Eevee/Workbench. Seems like Cycles is using the viewport evaluation and not the render evaluation? Probably an other bug that this issue showcases, right? ## Further analysis I did some more digging and noticed that the two drivers in the scene does not have the same amount of depsgraph in/out dep arrows in the debug renders: ![image](/attachments/53d0d61f-8039-4299-9745-9303f642956b) Note that the "ease out" driver has three "in" arrows and one "out" while the problematic "ease in" driver only as two "in" arrows and one "out" arrow. If I manually delete the driver and recreate it from scratch (not copy/pasting it), things starts working again and the new depsgraph debug export now shows that the "ease in" driver now has the same in/out arrows as the other driver: ![image](/attachments/98ee74e0-eb3d-4fec-bd8a-82788c4d90e4) Note that it now correctly is linked to `ctrl_upWaistTube_BBoneSubA_001_L`, while in the first image it was not. To me it seems weird that this was missing in the first place and even more weird that the "Update dependencies" button in the action editor did not solve this issue. However, deleting and recreating the driver from scratch does make depsgraph derive the correct relationships. Here is the driver in question for reference: ![image](/attachments/6d1c206c-13d4-45ed-abd3-34ecd185b187)
Sebastian Parborg added this to the Animation & Rigging project 2024-05-16 15:51:45 +02:00
Author
Member

@Sergey here is the issue I talked about.
Before digging deeper I also tested it on multiple computers including Clement's when I showed this issue to him while I thought this was a Eevee issue (as "Disable in Render" wouldn't affect Cycles, but then I found out later that Cycles has the same issue if you do "Disable in Viewport").

@Sergey here is the issue I talked about. Before digging deeper I also tested it on multiple computers including Clement's when I showed this issue to him while I thought this was a Eevee issue (as "Disable in Render" wouldn't affect Cycles, but then I found out later that Cycles has the same issue if you do "Disable in Viewport").

The issue comes from the flags on DriverVar being inconsistent with what they are expected to be. A a driver variable for "Transform Channel" is supposed to have DTAR_FLAG_STRUCT_REF | DTAR_FLAG_ID_OB_ONLY flags, but one of the drivers does not. One of the drivers somehow only has bits from the transform_space.

In order to fix the issue the root cause needs to be addressed. Namely, how the driver with invalid/inconsistent internal flags has been created.

The issue comes from the flags on `DriverVar` being inconsistent with what they are expected to be. A a driver variable for `"Transform Channel"` is supposed to have `DTAR_FLAG_STRUCT_REF | DTAR_FLAG_ID_OB_ONLY` flags, but one of the drivers does not. One of the drivers somehow only has bits from the `transform_space`. In order to fix the issue the root cause needs to be addressed. Namely, how the driver with invalid/inconsistent internal flags has been created.
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser Project (Legacy)
Interest
Asset System
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#121874
No description provided.