Grease Pencil: Adding driver in Transform doesn't behave as expected during playback #88433

Closed
opened 2021-05-20 16:38:48 +02:00 by Piotr Nikov · 21 comments

System Information
Operating system: MacOs 11.3
Graphics card: AMD Radeon Pro 5500M

Blender Version
Broken: Latest 3.0 Alpha
Worked: Never

Short description of error
Adding driver (via "Copy as new Driver and Paste Driver) in Transform (/Layers/Transform) doesn't behave as expected during playback. The viewport doesn't refresh even though the numerical values are clearly changing.
See attached Blend file and screen capture.
Driver.mp4

Exact steps for others to reproduce the error

  • Open attached .blend file
  • Play animation or drag the timeline frame - nothing happens
  • In the "Object Data" properties, select the Layer "Driven" and delete the driver in the Transform panel (below)
  • Play animation or drag the timeline frame - the drawing is updated
    GreasePencil_DriverProblem.blend

Thanks!
Piotr

**System Information** Operating system: MacOs 11.3 Graphics card: AMD Radeon Pro 5500M **Blender Version** Broken: Latest 3.0 Alpha Worked: Never **Short description of error** Adding driver (via "Copy as new Driver and Paste Driver) in Transform (/Layers/Transform) doesn't behave as expected during playback. The viewport doesn't refresh even though the numerical values are clearly changing. See attached Blend file and screen capture. [Driver.mp4](https://archive.blender.org/developer/F10130337/Driver.mp4) **Exact steps for others to reproduce the error** - Open attached .blend file - Play animation or drag the timeline frame - nothing happens - In the "Object Data" properties, select the Layer "Driven" and delete the driver in the Transform panel (below) - Play animation or drag the timeline frame - the drawing is updated [GreasePencil_DriverProblem.blend](https://archive.blender.org/developer/F10130343/GreasePencil_DriverProblem.blend) Thanks! Piotr
Author

Added subscriber: @Pyer

Added subscriber: @Pyer
Author

Added subscriber: @antoniov

Added subscriber: @antoniov
Author

Hi, this is still an issue. Any ideas on how to fix it? Or maybe a workaround? It's cool (and powerful!) to be able to use drivers with GP... Thanks!!!!

Hi, this is still an issue. Any ideas on how to fix it? Or maybe a workaround? It's cool (and powerful!) to be able to use drivers with GP... Thanks!!!!

Added subscriber: @lichtwerk

Added subscriber: @lichtwerk

@lichtwerk do you know what module is the right one for this driver bug?

@lichtwerk do you know what module is the right one for this driver bug?
Author

Hello again. I don't know if this helps, but the above steps work as expected on regular objects. So this bug only affects Grease Pencil...

Hello again. I don't know if this helps, but the above steps work as expected on regular objects. So this bug only affects Grease Pencil...

Added subscriber: @mano-wii

Added subscriber: @mano-wii

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

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

Thanks for the report, I can confirm the problem.
Drivers are usually handled by the #animation_rigging module, but the problem can spread to other areas.

Thanks for the report, I can confirm the problem. Drivers are usually handled by the #animation_rigging module, but the problem can spread to other areas.

Does this really work in Blender 2.93? (I can't find the transform panel to test in this version).

Does this really work in Blender 2.93? (I can't find the transform panel to test in this version).
Author

Hi again! It worked on 2.93 (probably alpha or beta, that's when GP Local Transforms first appeared). I did a job back in March and everything worked as expected. But when I load the scene today it no longer does (same Driver problem).
My Blender scene is dated from the 27th of March if that helps you find the 2.93 version of that time (I don't see alpha/beta builds on Blender's archive site).
I don't know where to look in Blender to see precisely what version was used for that scene.
Tell me if you need anything that can help you pinpoint the problem....

(Edited to correct my english)

Hi again! It worked on 2.93 (probably alpha or beta, that's when GP Local Transforms first appeared). I did a job back in March and everything worked as expected. But when I load the scene today it no longer does (same Driver problem). My Blender scene is dated from the 27th of March if that helps you find the 2.93 version of that time (I don't see alpha/beta builds on Blender's archive site). I don't know where to look in Blender to see precisely what version was used for that scene. Tell me if you need anything that can help you pinpoint the problem.... (Edited to correct my english)
Author

Ok sorry for the multiple messages. Turns out I was wrong about 2.93 working! I thought I used Drivers on my scene but I wasn't...
So in short, in my experience, Drivers never worked with GP Local transforms.
I'm going to edit my first post to reflect that.
Sorry again for the confusion!

Ok sorry for the multiple messages. Turns out I was wrong about 2.93 working! I thought I used Drivers on my scene but I wasn't... So in short, in my experience, Drivers never worked with GP Local transforms. I'm going to edit my first post to reflect that. Sorry again for the confusion!
Author

Sorry for asking, but is this going to get fixed?

Sorry for asking, but is this going to get fixed?
Member

Hm, weird.
Updates happen coorectly when choosing/changing the layer.

As a first note, here is the --debug-depsgraph output

  • On layer change
graph_id_tag_update: id=GDStroke flags=GEOMETRY source=USER_EDIT
graph_id_tag_update: id=GDStroke flags=GEOMETRY source=USER_EDIT
graph_id_tag_update: id=GDStroke flags=COPY_ON_WRITE source=USER_EDIT
graph_id_tag_update: id=GDStroke flags=COPY_ON_WRITE source=USER_EDIT
[SCScene :: View Layer]: Operation is entry point for update: GEOMETRY_EVAL_DONE()
[SCScene :: View Layer]: Operation is entry point for update: COPY_ON_WRITE()
[SCScene :: View Layer]: Operation is entry point for update: GEOMETRY_EVAL()
[SCScene :: View Layer]: Accumulated recalc bits for OBStroke: 8194
[SCScene :: View Layer]: Accumulated recalc bits for GDStroke: 8194
[SCScene :: View Layer]: deg_evaluate_copy_on_write on GDStroke (0x7fcca7402688)
[SCScene :: View Layer]: deg_evaluate_copy_on_write on OBStroke (0x7fcca86ae208)
[SCScene :: View Layer]: BKE_object_eval_uber_data on OBStroke (0x7fcca86ae208)
[SCScene :: View Layer]: BKE_object_handle_data_update on OBStroke (0x7fcca86ae208)
[SCScene :: View Layer]: BKE_animsys_eval_driver on GDStroke (0x7fcca7402688) fcu layers["Driven"].location[0] (0x7fccb7e00008)
[SCScene :: View Layer]: BKE_gpencil_prepare_eval_data on GDStroke (0x7fcca7402688)
[SCScene :: View Layer]: BKE_gpencil_frame_active_set on GDStroke (0x7fcca7402688)
graph_id_tag_update: id=GDStroke flags=GEOMETRY source=USER_EDIT
ID tagged for update during dependency graph evaluation.Depsgraph updated in 0.000607 seconds.
Depsgraph evaluation FPS: 2.964655
  • On frame change
graph_id_tag_update: id=SCScene flags=AUDIO_SEEK source=USER_EDIT
graph_id_tag_update: id=SCScene flags=AUDIO_SEEK source=USER_EDIT
[SCScene :: View Layer]: Operation is entry point for update: SOUND_EVAL()
[SCScene :: View Layer]: Operation is entry point for update: COPY_ON_WRITE()
[SCScene :: View Layer]: Operation is entry point for update: AUDIO_VOLUME()
[SCScene :: View Layer]: Operation is entry point for update: ANIMATION_EVAL()
[SCScene :: View Layer]: Operation is entry point for update: AUDIO_ENTRY()
[SCScene :: View Layer]: Accumulated recalc bits for SCScene: 40960
[SCScene :: View Layer]: Accumulated recalc bits for OBStroke: 0
[SCScene :: View Layer]: Accumulated recalc bits for GDStroke: 6
[SCScene :: View Layer]: Accumulated recalc bits for ACStrokeAction: 4
[SCScene :: View Layer]: Accumulated recalc bits for OBCamera: 0
[SCScene :: View Layer]: deg_evaluate_copy_on_write on SCScene (0x7fccce18cc08)
[SCScene :: View Layer]: layer_eval_view_layer on View Layer (0x7fcccdbbfe88)
[SCScene :: View Layer]: BKE_object_eval_eval_base_flags on OBCamera (0x7fcccdbd6e08)
[SCScene :: View Layer]: BKE_animsys_eval_animdata on GDStroke (0x7fcca7402688) at time 13.000000
[SCScene :: View Layer]: BKE_object_eval_eval_base_flags on OBStroke (0x7fcca86ae208)
[SCScene :: View Layer]: BKE_animsys_eval_driver on GDStroke (0x7fcca7402688) fcu layers["Driven"].location[0] (0x7fccb7e00008)
[SCScene :: View Layer]: BKE_gpencil_frame_active_set on GDStroke (0x7fcca7402688)
Depsgraph updated in 0.001245 seconds.
Depsgraph evaluation FPS: 0.920060
  • On frame change without driver
graph_id_tag_update: id=SCScene flags=AUDIO_SEEK source=USER_EDIT
graph_id_tag_update: id=SCScene flags=AUDIO_SEEK source=USER_EDIT
[SCScene :: View Layer]: Operation is entry point for update: SOUND_EVAL()
[SCScene :: View Layer]: Operation is entry point for update: AUDIO_VOLUME()
[SCScene :: View Layer]: Operation is entry point for update: COPY_ON_WRITE()
[SCScene :: View Layer]: Operation is entry point for update: AUDIO_ENTRY()
[SCScene :: View Layer]: Operation is entry point for update: GEOMETRY_EVAL()
[SCScene :: View Layer]: Operation is entry point for update: ANIMATION_EVAL()
[SCScene :: View Layer]: Accumulated recalc bits for SCScene: 40960
[SCScene :: View Layer]: Accumulated recalc bits for OBStroke: 2
[SCScene :: View Layer]: Accumulated recalc bits for GDStroke: 6
[SCScene :: View Layer]: Accumulated recalc bits for ACStrokeAction: 4
[SCScene :: View Layer]: Accumulated recalc bits for OBCamera: 0
[SCScene :: View Layer]: deg_evaluate_copy_on_write on SCScene (0x7fccce18cc08)
[SCScene :: View Layer]: BKE_animsys_eval_animdata on GDStroke (0x7fcca7402688) at time 16.000000
[SCScene :: View Layer]: BKE_gpencil_frame_active_set on GDStroke (0x7fcca7402688)
[SCScene :: View Layer]: layer_eval_view_layer on View Layer (0x7fcccdbbfe88)
[SCScene :: View Layer]: BKE_object_eval_uber_data on OBStroke (0x7fcca86ae208)
[SCScene :: View Layer]: BKE_object_handle_data_update on OBStroke (0x7fcca86ae208)
[SCScene :: View Layer]: BKE_object_eval_eval_base_flags on OBStroke (0x7fcca86ae208)
[SCScene :: View Layer]: BKE_gpencil_prepare_eval_data on GDStroke (0x7fcca7402688)
[SCScene :: View Layer]: BKE_object_eval_eval_base_flags on OBCamera (0x7fcccdbd6e08)
graph_id_tag_update: id=GDStroke flags=GEOMETRY source=USER_EDIT
ID tagged for update during dependency graph evaluation.Depsgraph updated in 0.001322 seconds.
Depsgraph evaluation FPS: 0.115480
Hm, weird. Updates happen coorectly when choosing/changing the layer. As a first note, here is the `--debug-depsgraph` output - [x] On layer change ``` graph_id_tag_update: id=GDStroke flags=GEOMETRY source=USER_EDIT graph_id_tag_update: id=GDStroke flags=GEOMETRY source=USER_EDIT graph_id_tag_update: id=GDStroke flags=COPY_ON_WRITE source=USER_EDIT graph_id_tag_update: id=GDStroke flags=COPY_ON_WRITE source=USER_EDIT [SCScene :: View Layer]: Operation is entry point for update: GEOMETRY_EVAL_DONE() [SCScene :: View Layer]: Operation is entry point for update: COPY_ON_WRITE() [SCScene :: View Layer]: Operation is entry point for update: GEOMETRY_EVAL() [SCScene :: View Layer]: Accumulated recalc bits for OBStroke: 8194 [SCScene :: View Layer]: Accumulated recalc bits for GDStroke: 8194 [SCScene :: View Layer]: deg_evaluate_copy_on_write on GDStroke (0x7fcca7402688) [SCScene :: View Layer]: deg_evaluate_copy_on_write on OBStroke (0x7fcca86ae208) [SCScene :: View Layer]: BKE_object_eval_uber_data on OBStroke (0x7fcca86ae208) [SCScene :: View Layer]: BKE_object_handle_data_update on OBStroke (0x7fcca86ae208) [SCScene :: View Layer]: BKE_animsys_eval_driver on GDStroke (0x7fcca7402688) fcu layers["Driven"].location[0] (0x7fccb7e00008) [SCScene :: View Layer]: BKE_gpencil_prepare_eval_data on GDStroke (0x7fcca7402688) [SCScene :: View Layer]: BKE_gpencil_frame_active_set on GDStroke (0x7fcca7402688) graph_id_tag_update: id=GDStroke flags=GEOMETRY source=USER_EDIT ID tagged for update during dependency graph evaluation.Depsgraph updated in 0.000607 seconds. Depsgraph evaluation FPS: 2.964655 ``` - [x] On frame change ``` graph_id_tag_update: id=SCScene flags=AUDIO_SEEK source=USER_EDIT graph_id_tag_update: id=SCScene flags=AUDIO_SEEK source=USER_EDIT [SCScene :: View Layer]: Operation is entry point for update: SOUND_EVAL() [SCScene :: View Layer]: Operation is entry point for update: COPY_ON_WRITE() [SCScene :: View Layer]: Operation is entry point for update: AUDIO_VOLUME() [SCScene :: View Layer]: Operation is entry point for update: ANIMATION_EVAL() [SCScene :: View Layer]: Operation is entry point for update: AUDIO_ENTRY() [SCScene :: View Layer]: Accumulated recalc bits for SCScene: 40960 [SCScene :: View Layer]: Accumulated recalc bits for OBStroke: 0 [SCScene :: View Layer]: Accumulated recalc bits for GDStroke: 6 [SCScene :: View Layer]: Accumulated recalc bits for ACStrokeAction: 4 [SCScene :: View Layer]: Accumulated recalc bits for OBCamera: 0 [SCScene :: View Layer]: deg_evaluate_copy_on_write on SCScene (0x7fccce18cc08) [SCScene :: View Layer]: layer_eval_view_layer on View Layer (0x7fcccdbbfe88) [SCScene :: View Layer]: BKE_object_eval_eval_base_flags on OBCamera (0x7fcccdbd6e08) [SCScene :: View Layer]: BKE_animsys_eval_animdata on GDStroke (0x7fcca7402688) at time 13.000000 [SCScene :: View Layer]: BKE_object_eval_eval_base_flags on OBStroke (0x7fcca86ae208) [SCScene :: View Layer]: BKE_animsys_eval_driver on GDStroke (0x7fcca7402688) fcu layers["Driven"].location[0] (0x7fccb7e00008) [SCScene :: View Layer]: BKE_gpencil_frame_active_set on GDStroke (0x7fcca7402688) Depsgraph updated in 0.001245 seconds. Depsgraph evaluation FPS: 0.920060 ``` - [x] On frame change without driver ``` graph_id_tag_update: id=SCScene flags=AUDIO_SEEK source=USER_EDIT graph_id_tag_update: id=SCScene flags=AUDIO_SEEK source=USER_EDIT [SCScene :: View Layer]: Operation is entry point for update: SOUND_EVAL() [SCScene :: View Layer]: Operation is entry point for update: AUDIO_VOLUME() [SCScene :: View Layer]: Operation is entry point for update: COPY_ON_WRITE() [SCScene :: View Layer]: Operation is entry point for update: AUDIO_ENTRY() [SCScene :: View Layer]: Operation is entry point for update: GEOMETRY_EVAL() [SCScene :: View Layer]: Operation is entry point for update: ANIMATION_EVAL() [SCScene :: View Layer]: Accumulated recalc bits for SCScene: 40960 [SCScene :: View Layer]: Accumulated recalc bits for OBStroke: 2 [SCScene :: View Layer]: Accumulated recalc bits for GDStroke: 6 [SCScene :: View Layer]: Accumulated recalc bits for ACStrokeAction: 4 [SCScene :: View Layer]: Accumulated recalc bits for OBCamera: 0 [SCScene :: View Layer]: deg_evaluate_copy_on_write on SCScene (0x7fccce18cc08) [SCScene :: View Layer]: BKE_animsys_eval_animdata on GDStroke (0x7fcca7402688) at time 16.000000 [SCScene :: View Layer]: BKE_gpencil_frame_active_set on GDStroke (0x7fcca7402688) [SCScene :: View Layer]: layer_eval_view_layer on View Layer (0x7fcccdbbfe88) [SCScene :: View Layer]: BKE_object_eval_uber_data on OBStroke (0x7fcca86ae208) [SCScene :: View Layer]: BKE_object_handle_data_update on OBStroke (0x7fcca86ae208) [SCScene :: View Layer]: BKE_object_eval_eval_base_flags on OBStroke (0x7fcca86ae208) [SCScene :: View Layer]: BKE_gpencil_prepare_eval_data on GDStroke (0x7fcca7402688) [SCScene :: View Layer]: BKE_object_eval_eval_base_flags on OBCamera (0x7fcccdbd6e08) graph_id_tag_update: id=GDStroke flags=GEOMETRY source=USER_EDIT ID tagged for update during dependency graph evaluation.Depsgraph updated in 0.001322 seconds. Depsgraph evaluation FPS: 0.115480 ```
Member

It works a tiny tad better if the setup is tweaked so we have separate strokes (then the driven at least gets updated):
GreasePencil_DriverProblem_Separate_strokes.blend

It works a tiny tad better if the setup is tweaked so we have separate strokes (then the driven at least gets updated): [GreasePencil_DriverProblem_Separate_strokes.blend](https://archive.blender.org/developer/F10221887/GreasePencil_DriverProblem_Separate_strokes.blend)
Member

Another issue might be that location is never really used directly, but the matrix gpl->layer_mat instead.
This matrix gets updated correctly via RNA callback rna_GpencilLayerMatrix_update (when tweaked through the UI or python), but these callbacks are not executed from the animation systems (so in the end, the matrix might not be up-to-date).
Needs more investigation.

Another issue might be that location is never really used directly, but the matrix `gpl->layer_mat` instead. This matrix gets updated correctly via RNA callback `rna_GpencilLayerMatrix_update` (when tweaked through the UI or python), but these callbacks are not executed from the animation systems (so in the end, the matrix might not be up-to-date). Needs more investigation.
Author

Sorry again for asking, but is this going to get fixed at some point?
Thanks,
Piotr

Sorry again for asking, but is this going to get fixed at some point? Thanks, Piotr
Member

There is an issue when the animation is build twice in the depsgraph for the same ID (the drivers are set up for Stroke, but since the driver uses Stroke again, there is something going wrong).
I'll try to get to the root of it.

For now though, you can use a workaround:

There is an issue when the animation is build twice in the depsgraph for the same ID (the drivers are set up for `Stroke`, but since the driver uses `Stroke` again, there is something going wrong). I'll try to get to the root of it. For now though, you can use a workaround: - dont use the Input variable pointing to Stroke - use `self` https://docs.blender.org/manual/en/2.93/animation/drivers/drivers_panel.html#expressions - note that `self` in this case is already the `GPencilLayer`, so you have to use `self.id_data.layers["Driver"].location[0] [GreasePencil_DriverProblem_using_self.blend](https://archive.blender.org/developer/F10328001/GreasePencil_DriverProblem_using_self.blend)
Philipp Oeser self-assigned this 2021-08-26 15:28:33 +02:00

This issue was referenced by 333db02e5d

This issue was referenced by 333db02e5d9dfc059b67e372637f0b6b5b159cd9

This issue was referenced by b18122451f

This issue was referenced by b18122451f8185ade9fc1e9aff5cc2f03d4fa040
Member

Changed status from 'Confirmed' to: 'Resolved'

Changed status from 'Confirmed' to: 'Resolved'
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
5 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#88433
No description provided.