This patch allows you to dynamically control stroke's opacity and thickness using an object for distance reference in the modifier. Fading range is adjustable, and it is compatible with current curve/vertex group selection.
See GIF for example:
Differential D9091
GPencil fading based on distance to reference object in Opacity and Thickness modifiers Authored by YimingWu (NicksBest) on Oct 2 2020, 1:34 PM.
Details
This patch allows you to dynamically control stroke's opacity and thickness using an object for distance reference in the modifier. Fading range is adjustable, and it is compatible with current curve/vertex group selection. See GIF for example:
Diff Detail
Event Timeline
Comment Actions What is the motivation for this feature? This sounds like the kind of thing that can be done with a driver. I can imagine hundreds of properties that would be useful to modify based on an object position, it's not clear to me why this needs built-in support rather than working through the generic driver system (which can be made more user friendly).
Comment Actions Updated for better handling of fading effects, can control both start and end factors. Comment Actions I have tested with a simple driver and the Opacity modifier and I get something similar...not with so many options, but it works. I don't know what is the opinion of @Matias Mendiola (mendio) and @Daniel Martinez Lara (pepeland) about this. Comment Actions This patch takes _per-vertex_ distance rather than object origin distance, drivers can't do that. This is more versatile as this could be used on a large drawing that comes from one GPencil object. Comment Actions @YimingWu (NicksBest) I know, my point is to know if this feature by vertex worth a new modifier.. really I don't know, we need the opinion of artists. Comment Actions @Antonio Vazquez (antoniov) It's not a separate modifier, it's just improvement on the existing one. Yes we should wait for the opinions from the artists as well. Comment Actions I'm using the equivalent to this modifier in Freestyle (Distance to Object) a lot, and I think this is also necessary for LineArt/GP. Comment Actions In general, LGTM. Not sure if you need initializate the variables or not. If you need it, there is a change how is done now. You can find examples in other modifiers.
Comment Actions
Comment Actions I have tested and if you remove the Modifier, the reference object user count get negative. If you try to delete this empty, gets an assert. ERROR (bke.lib_id): D:\MyBlender\BlenderDEV\blender\source\blender\blenkernel\intern\lib_id.c:292 id_us_min: ID user decrement error: OBEmpty (from '[Main]'): 0 <= 0 Comment Actions
Comment Actions I have tested and now is working as expected. I would like to have the UI review, especially, the parameter names and the tooltips, before commit the patch. @Matias Mendiola (mendio) Any comment? Comment Actions @YimingWu (NicksBest) BTW, when you commit this change to master, be sure to update the Wiki page of the release notes (https://wiki.blender.org/wiki/Reference/Release_Notes/2.92/Grease_Pencil). Now, it's mandatory to include all changes in the release notes. Comment Actions due that this modifier feature is tight related to the new Line Art module and also that Line Art is under review and still could suffer a lot of changes, I suggest waiting for a final Line Art design before commit Comment Actions The new Modifier options work really nice but the Influence panel in all Grease Pencil modifiers is always the last one, please move it below the new Fading panel | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||