Page MenuHome

Grease Pencil layer visibility control via driver(using distance between two objects)
Closed, ResolvedPublic

Description

System Information
Operating system: macOS High Sierra (version 10.13.6{F7578376}
Graphics card: NVIDIA GeForce GT 750M OpenGL Engine NVIDIA Corporation 4.1 NVIDIA-10.32.0 355.11.10.10.40.102

Blender Version
Broken: version: 2.80 (sub 74), branch: master, commit date: 2019-07-07 23:53, hash: rBbb2abacb4b5c
Worked: (optional)

Short description of error
Hey guys having a bit of a issue with blender grease pencil layer visibility.
-I am trying to control the visibility of grease pencil layer via driver using the distance between two objects.It is working in render and layers panel ,but not in the viewport. It doesnot get updated in viewport.Please fix.

-Mouse pointer is back in draw mode

Other than that GREAT WORK guys. BLENDER 2.8 is awesome.

Happy Blending.

Exact steps for others to reproduce the error
-add a grease pencil stroke
-draw anything
-go to layers panel of grease pencil
-add a driver
-add two objects to control visibility of Grease Pencil layer via distance.

Event Timeline

Germano Cavalcante (mano-wii) triaged this task as Needs Information from User priority.

We require a .blend file and simple steps to reproduce the problem.
We currently have many bugs to keep track of.
It is not good for the developer for whom this bug is assigned to spend a lot of time trying to replicate it.
A guideline for making a good bug report can be found here: https://wiki.blender.org/wiki/Process/Bug_Reports

System Information
Operating system: macOS High Sierra (version 10.13.6{F7578376}
Graphics card: NVIDIA GeForce GT 750M OpenGL Engine NVIDIA Corporation 4.1 NVIDIA-10.32.0 355.11.10.10.40.102

Blender Version
Broken: version: 2.80 (sub 74), branch: master, commit date: 2019-07-07 23:53, hash: rBbb2abacb4b5c
Worked: (optional)

Short description of error
Hey guys having a bit of a issue with blender grease pencil layer visibility.
-I am trying to control the visibility of grease pencil layer via driver using the distance between two objects.It is working in render and layers panel, and is working after you set key,but It does not get live update in viewport.Please fix.

-Mouse pointer is back in draw mode

Other than that GREAT WORK guys. BLENDER 2.8 is awesome.

Happy Blending.

Exact steps for others to reproduce the error
-add a grease pencil stroke
-draw anything
-go to layers panel of grease pencil
-add a driver
-add two objects to control visibility of Grease Pencil layer via distance.
-move object to turn on/off the grease pencil stroke

Bastien Montagne (mont29) raised the priority of this task from Needs Information from User to Waiting for Developer to Reproduce.
Antonio Vazquez (antoniov) lowered the priority of this task from Waiting for Developer to Reproduce to Confirmed, Medium.

I can reproduce the problem and I guess what it's the reason.

When you set the layer as hidden in the layer list, the property "hide" is changed and the rna_GPencil_update function is called to tag the GPU cache and recalc the view data, but when the property is changed using the driver the property is changed but the datablock is not tagged and the screen is not updated. I have run a debug and the rna_update function is not called.

It's easy to verify, after moving the sphere to set as hide, just move the frame in the timeline and the screen is refreshed because the GPU data is tagged and updated. The solution is tag the gpd datablock

Something like:

bGPdata *gpd = (bGPdata *)ob->data;
DEG_id_tag_update(&gpd->id, ID_RECALC_GEOMETRY);
WM_main_add_notifier(NC_GPENCIL | NA_EDITED, NULL);

No idea where to fix this, maybe @Bastien Montagne (mont29) or @Sergey Sharybin (sergey) have any idea.

@Antonio Vazquez (antoniov), this sounds like a missing relation in the dependency graph. Can you give me a very simple file with minimal possible entities involved to reproduce the issue?

@Sergey Sharybin (sergey) you have a very simple file in the task (see above)

Ah, missed that. Indeed seems simple setup to debug :)

:(

was really looking forward for this fix.

anyways congrats on official release. cheers developers ๐Ÿ™‚