
Nature-dependent line colors in Blender/Freestyle
9 months ago
An experimental movie clip using nature-dependent line colors in Blender and the Freestyle NPR renderer. Crease lines are drawn in white, while silhouette lines have a dark color. These two types of lines were rendered separately using a different custom style module based on "nature.py" and merged by the compositor. A halftone shading with slanted stripes in the second cut was done by a custom PyNode script.
-
Vimeo: About / Blog / Developers / Jobs / Community Guidelines / Community Forums / Help Center / Site Map / Merchandise
/ Get Vimeo

Previous Week
I need to look into Freestyle for the toony animations I'm planning. I followed the thread at BA for awhile but haven't dug into it yet.
-banor
This video is a great result! The contours and striped lines work really well.
I would have tried to create these stripes with composite texture nodes, but PyNodes seem to do the job even better. Do you know any good tutorials for PyNode textures or is there any sample script available for the PyNode that you used? I'm trying to get my head around this and I think I (half-way) understand Freestyle scripts but I wouldn't know where to start for PyNode textures like this.
I hope I can use Freestyle and some useful PyNode textures in a new animation I started to work on.
Cheers!
Anatol
Thank you for your interest in Freestyle and PyNode.
I just posted to the BA PyNode thread the PyNode script I used for the movie clip:
blenderartists.org/forum/showthread.php?p=1452011#post1452011
AFAIK, the only and definitive material on PyNode is the following document:
wiki.blender.org/index.php/Dev:Py/Nodes/API
The document looks very succinct at first glance, but it well defines the API in fact. A bit of difficulty that came to me when I was learning PyNode, however, was the execution model of PyNode. A PyNode script works on each pixel, implying that you cannot directly manipulate an image as a 2-dimensional array of pixels. For example, to create a stripes PyNode script like mine, you might want to draw a straight line from a point at (x1, y1) to another at (x2, y2) using a line drawing function. This is impossible in a PyNode script. Instead, you need to find a way to determine the color of each pixel (depending on its coordinates, for instance) so that the array of pixels as a whole will end up showing a meaningful pattern. The formulas in the PyNode script above illustrate this concept.
It is very likely that some patterns are easily implemented by PyNode, while others are not. I would say the stripes belong to the latter group. When you have an artistic idea that you want to try in Blender, it is a good strategy to ponder first if the idea fits well in the per-pixel basis of the PyNode execution model. If an implementation in PyNode seems to pose some difficulty, then probably it is better to take a different approach other than PyNode. Blender provides a number of alternative methods in many cases.
I hope this helps.
With best regards,
T.K.
Thank you for your really helpful reply and insights into this matter! I will try your PyNode texture script. Along with your explanations I hope I can make sense out of it for myself so I can create customised scripts as I need them. (I used your halftone script for some test renders before, really brilliant results!)
Again, thank you very much. It's fantastic to get such a great reply. I'll post some renders on Vimeo once I have some more presentable results.
Cheers!
Anatol