Driver on grease pencil modifier does not update for redraw #57483

Closed
opened 2018-10-29 10:15:35 +01:00 by Antonio Vazquez · 24 comments

If add a driver that handle a property in a grease pencil modifier, the grease pencil datablock (GPD) must be tagged as dirty (DEG_id_tag_update(&gpd->id, OB_RECALC_OB | OB_RECALC_DATA)).

The problem is the property change in the modifier, but as the driver did not tagged the datablock as dirty, the drawing cache is not updated and the image in viewport does not change (only change if change the current frame number that force a redraw).

Driver_Evaluation.png

Here is the test file.

TEST_DRIVER_SIMPLE.blend

If add a driver that handle a property in a grease pencil modifier, the grease pencil datablock (GPD) must be tagged as dirty (DEG_id_tag_update(&gpd->id, OB_RECALC_OB | OB_RECALC_DATA)). The problem is the property change in the modifier, but as the driver did not tagged the datablock as dirty, the drawing cache is not updated and the image in viewport does not change (only change if change the current frame number that force a redraw). ![Driver_Evaluation.png](https://archive.blender.org/developer/F5281449/Driver_Evaluation.png) Here is the test file. [TEST_DRIVER_SIMPLE.blend](https://archive.blender.org/developer/F5281454/TEST_DRIVER_SIMPLE.blend)
Author
Member

Added subscriber: @antoniov

Added subscriber: @antoniov

#62514 was marked as duplicate of this issue

#62514 was marked as duplicate of this issue

Added subscribers: @dfelinto, @Sergey

Added subscribers: @dfelinto, @Sergey

@antoniov : depsgraph is the one responsible for those tags. You need to build a relation between the driver and the grease pencil object.
Later (tomorrow) I can nspect the depsgraph to see what is going on. If you want to try in the meantime, enable the dependency graph addon, and dump the depsgraph as image.

@antoniov : depsgraph is the one responsible for those tags. You need to build a relation between the driver and the grease pencil object. Later (tomorrow) I can nspect the depsgraph to see what is going on. If you want to try in the meantime, enable the dependency graph addon, and dump the depsgraph as image.

For the records, you will need to install graphviz and gnuplot for that:

https://graphviz.gitlab.io/_pages/Download/windows/graphviz-2.38.msi
https://sourceforge.net/projects/gnuplot/files/gnuplot/

As well as making sure their respective bin directory is in the %PATH%.

For the records, you will need to install graphviz and gnuplot for that: https://graphviz.gitlab.io/_pages/Download/windows/graphviz-2.38.msi https://sourceforge.net/projects/gnuplot/files/gnuplot/ As well as making sure their respective bin directory is in the %PATH%.

I simplified your file a bit:
driver.blend

It produces the following depsgraph:
depsgraph.jpg

I simplified your file a bit: [driver.blend](https://archive.blender.org/developer/F5282888/driver.blend) It produces the following depsgraph: ![depsgraph.jpg](https://archive.blender.org/developer/F5282904/depsgraph.jpg)
Member

Added subscriber: @lichtwerk

Added subscriber: @lichtwerk
Member

Hm, was also looking into this, but havent found the issue (yet)

I've verified that a relation bone --> stroke modifier gets added in DepsgraphRelationBuilder::build_driver_variables

But we are missing a BKE_object_eval_uber_data on the grasepencil.

I've also verified that this is called in DepsgraphNodeBuilder::build_object_data_geometry , so that should make BKE_object_eval_uber_data() the exit for greasepencil as well?

[SCScene :: RenderLayer]: Operation is entry point for update: POSE_DONE()
[SCScene :: RenderLayer]: Operation is entry point for update: POSE_INIT_IK()
[SCScene :: RenderLayer]: Operation is entry point for update: POSE_INIT()
[SCScene :: RenderLayer]: Operation is entry point for update: COPY_ON_WRITE()
[SCScene :: RenderLayer]: Operation is entry point for update: PLACEHOLDER(Armature Eval)
[SCScene :: RenderLayer]: Operation is entry point for update: COPY_ON_WRITE()
[SCScene :: RenderLayer]: Accumulated recalc bits for OBCube: 17
[SCScene :: RenderLayer]: Accumulated recalc bits for OBArmature: 81
[SCScene :: RenderLayer]: Accumulated recalc bits for ARArmature: 4294967109
[SCScene :: RenderLayer]: Accumulated recalc bits for OBStroke: 1
[SCScene :: RenderLayer]: deg_evaluate_copy_on_write on ARArmature (0x7f94a0fc7788)
[SCScene :: RenderLayer]: deg_evaluate_copy_on_write on OBArmature (0x7f949b4e9c08)
[SCScene :: RenderLayer]: BKE_pose_eval_init on OBArmature (0x7f949b4e9c08)
[SCScene :: RenderLayer]: BKE_pose_eval_init_ik on OBArmature (0x7f949b4e9c08)
[SCScene :: RenderLayer]: BKE_pose_eval_bone on OBArmature (0x7f949b4e9c08) pchan Bone (0x7f94a44e5008)
[SCScene :: RenderLayer]: BKE_pose_bone_done on Bone (0x7f94a44e5008)
[SCScene :: RenderLayer]: BKE_pose_eval_flush on OBArmature (0x7f949b4e9c08)
[SCScene :: RenderLayer]: BKE_animsys_eval_driver on OBStroke (0x7f94cc323008) fcu grease_pencil_modifiers["Offset"].rotation[1] (0x7f94a2304108)
[SCScene :: RenderLayer]: BKE_animsys_eval_driver on OBCube (0x7f949b4eb408) fcu modifiers["SimpleDeform"].angle[0] (0x7f94a4f09088)
[SCScene :: RenderLayer]: BKE_object_eval_uber_data on OBCube (0x7f949b4eb408)

Guess I have to read some more.
Also noticed that DepsgraphNodeBuilder::build_gpencil() and DepsgraphRelationBuilder::build_gpencil() are apperently unused? (build_animdata() is called from elsewhere anyways...)
Did I say I have to read some more ;)?

Hm, was also looking into this, but havent found the issue (yet) I've verified that a relation `bone --> stroke modifier` gets added in [DepsgraphRelationBuilder::build_driver_variables ](https://developer.blender.org/diffusion/B/browse/blender2.8/source/blender/depsgraph/intern/builder/deg_builder_relations.cc;2dbddaf3be57142a70fc1fb8f46997d67e980f57$1448) But we are missing a `BKE_object_eval_uber_data` on the grasepencil. I've also verified that this is called in [DepsgraphNodeBuilder::build_object_data_geometry ](https://developer.blender.org/diffusion/B/browse/blender2.8/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc;2dbddaf3be57142a70fc1fb8f46997d67e980f57$1174), so that should make `BKE_object_eval_uber_data()` the exit for greasepencil as well? ``` [SCScene :: RenderLayer]: Operation is entry point for update: POSE_DONE() [SCScene :: RenderLayer]: Operation is entry point for update: POSE_INIT_IK() [SCScene :: RenderLayer]: Operation is entry point for update: POSE_INIT() [SCScene :: RenderLayer]: Operation is entry point for update: COPY_ON_WRITE() [SCScene :: RenderLayer]: Operation is entry point for update: PLACEHOLDER(Armature Eval) [SCScene :: RenderLayer]: Operation is entry point for update: COPY_ON_WRITE() [SCScene :: RenderLayer]: Accumulated recalc bits for OBCube: 17 [SCScene :: RenderLayer]: Accumulated recalc bits for OBArmature: 81 [SCScene :: RenderLayer]: Accumulated recalc bits for ARArmature: 4294967109 [SCScene :: RenderLayer]: Accumulated recalc bits for OBStroke: 1 [SCScene :: RenderLayer]: deg_evaluate_copy_on_write on ARArmature (0x7f94a0fc7788) [SCScene :: RenderLayer]: deg_evaluate_copy_on_write on OBArmature (0x7f949b4e9c08) [SCScene :: RenderLayer]: BKE_pose_eval_init on OBArmature (0x7f949b4e9c08) [SCScene :: RenderLayer]: BKE_pose_eval_init_ik on OBArmature (0x7f949b4e9c08) [SCScene :: RenderLayer]: BKE_pose_eval_bone on OBArmature (0x7f949b4e9c08) pchan Bone (0x7f94a44e5008) [SCScene :: RenderLayer]: BKE_pose_bone_done on Bone (0x7f94a44e5008) [SCScene :: RenderLayer]: BKE_pose_eval_flush on OBArmature (0x7f949b4e9c08) [SCScene :: RenderLayer]: BKE_animsys_eval_driver on OBStroke (0x7f94cc323008) fcu grease_pencil_modifiers["Offset"].rotation[1] (0x7f94a2304108) [SCScene :: RenderLayer]: BKE_animsys_eval_driver on OBCube (0x7f949b4eb408) fcu modifiers["SimpleDeform"].angle[0] (0x7f94a4f09088) [SCScene :: RenderLayer]: BKE_object_eval_uber_data on OBCube (0x7f949b4eb408) ``` Guess I have to read some more. Also noticed that DepsgraphNodeBuilder::build_gpencil() and DepsgraphRelationBuilder::build_gpencil() are apperently unused? (build_animdata() is called from elsewhere anyways...) Did I say I have to read some more ;)?
Author
Member

@lichtwerk Do you have any update about this?

@lichtwerk Do you have any update about this?

Added subscriber: @BerbankGreen

Added subscriber: @BerbankGreen
Brecht Van Lommel changed title from Driver evaluation must tag grease pencil datablock for redraw to Driver on grease pencil modifier does not update for redraw 2019-03-14 19:37:30 +01:00

Added subscriber: @joewc

Added subscriber: @joewc

Hello my friends!
Same problem with blender 2.8

System Information
Operating system: Windows 7 sp1
Graphics card: NVIDIA [GeForce GTX 675M] driver: nvidia v: 391.35

Device-1: Intel Core Processor Integrated Graphics driver: i7 3720QM
Device-2: 16gb RAM

Blender crash Version
blender-2.80-cc5bdf029324-win64.zip download 17/03/2019

Short description of error
Drivers link as empty to modifiers (time offset - mode: fixed frame) no realtime keyframe updates.

The old building version works fine: blender-2.80-790cb7799dcf-win64.zip - download 19/02/2019.

Thank you for yours hard work and sorry for my bad english.

Hello my friends! Same problem with blender 2.8 System Information Operating system: Windows 7 sp1 Graphics card: NVIDIA [GeForce GTX 675M] driver: nvidia v: 391.35 Device-1: Intel Core Processor Integrated Graphics driver: i7 3720QM Device-2: 16gb RAM **Blender crash Version** blender-2.80-cc5bdf029324-win64.zip download 17/03/2019 Short description of error Drivers link as empty to modifiers (time offset - mode: fixed frame) no realtime keyframe updates. **The old building version works fine: blender-2.80-790cb7799dcf-win64.zip - download 19/02/2019.** Thank you for yours hard work and sorry for my bad english.
Author
Member

@Sergey Can you help us here?

@Sergey Can you help us here?
Sergey Sharybin self-assigned this 2019-03-30 20:58:16 +01:00

@antoniov, will check next week.

P.S. Probably better to assign to me, so it's not lost in the stream of incoming mail, and can always be accessed from assigned tasks.

@antoniov, will check next week. P.S. Probably better to assign to me, so it's not lost in the stream of incoming mail, and can always be accessed from assigned tasks.

Added subscribers: @heini, @AnnaIv, @brecht

Added subscribers: @heini, @AnnaIv, @brecht

Added subscriber: @SamuelTelles

Added subscriber: @SamuelTelles

Hi, people.
Having the same problem with the "time offset" modifier, but I can tell you this was working very nicely on "blender-2.80-860a9f979d60-win64". It's pretty useful to develop complex rigs with GP. Attaching my blend file.. just in case.

test driver time offset.blend

Hi, people. Having the same problem with the "time offset" modifier, but I can tell you this was working very nicely on "blender-2.80-860a9f979d60-win64". It's pretty useful to develop complex rigs with GP. Attaching my blend file.. just in case. [test driver time offset.blend](https://archive.blender.org/developer/F6946661/test_driver_time_offset.blend)

Added subscriber: @NoahJamesBradleySmith-2

Added subscriber: @NoahJamesBradleySmith-2

driver.blend Same problem here. Attached my blend file in case anyone wants a look at it.

[driver.blend](https://archive.blender.org/developer/F7073667/driver.blend) Same problem here. Attached my blend file in case anyone wants a look at it.
Author
Member

@lichtwerk Maybe this bug must be set as High to be fixed before release. What do you think?

@lichtwerk Maybe this bug must be set as High to be fixed before release. What do you think?
Member

@Sergey: do you have time to check this [agree this could be raised to High prio]?

@Sergey: do you have time to check this [agree this could be raised to High prio]?

This issue was referenced by fc8547b889

This issue was referenced by fc8547b88924ea3ba083b3b7cec705e6eba87422

Changed status from 'Open' to: 'Resolved'

Changed status from 'Open' to: 'Resolved'

Holy...!! :D

Holy...!! :D
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
11 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#57483
No description provided.