Cartoon lines of a darker color than the original surface / custom color

I’ve been trying hard to find an answer with no luck, so I’m asking here: Is there a way to use nodes (or other settings in Blender apart from scripting) to create darkened or custom colored cartoon lines? This means having the edges of a mesh darken the original color around its borders, or even accept a manual color (preferred).

To be straight, I need this as part of a personal experiment to see if I can achieve the exact same style in My Little Pony - Friendship is Magic under Blender with 3D. I have most of what I’d need to try this, and am only missing a way to generate the proper cartoon lines. For those not experienced with MLP’s drawing style, here is an image:

As you can see, each character has lines around the edge of the same color as the main surface, only darker. And the more the mesh blends in, the more the line fades and gets smaller. However, background objects (such as houses) don’t necessarily use this effect, so it mustn’t be applied on all meshes as a global render option. I seen this sort of shader being possible in some engines.

I’ve been googling for tutorials and also asked on IRC, but no one knows how to do it in Blender. All tutorials show a method which only allows lines of one global color (Render - Post Processing - Edge checkbox) and this does not work for what I need. And no, I don’t want the “duplicate the mesh scale it up by a small amount and flip the normals” way either, unless it’s a modifier that doesn’t need to be applied. Wanna keep vertices to a minimum and do this as a post-process if possible.


I agree, some style in Freestyle would be your best bet. Unless, of course, you went the Synfig Studio route (it’s basically open source Flash)

Thanks everyone. I don’t plan to depend on external addons for this, including other render engines. I’ll take a look at that thread and Blend file when I have time, as the screenshot there looks like what I’m trying to achieve.

And that video about the freestyle branch is very interesting! Does this mean the feature will be in 2.63? I would really like that… the edge effects there are really awesome and might even be more than what I’m looking for :slight_smile:

You can do it with Blender internal, but you have to place each Pony, or object that requires a matching outline color, in its own entire scene. This will allow you to have an edge color just for that scene. Then create a master scene that composites together all the various parts for a single render. This is quite a chore and you will have no control over the thickness of the line because Blender Internal’s edge feature is a one trick Pony (ha…get it…that was funny).

Your reluctance to explore other render options may limit your ability to achieve your goal.


26_multi-edge_color.blend (472 KB)

If the only problem with your proposed solution is line thickness then it might still be possible to circumvent. I’ve no idea if this is useful or even relevant but oh well…

If you want the varied edge lengths of the style, you’ll have a hard time with BI Edge render. So unless you have some really unavoidable practical issue with using a Freestyle-build, I really recommend it.

A super quick pony scene with Freestyle, without any additional post-processing.
This doesn’t take any sort of scripting or expertise - it’s all done with a fairly straightforward and obvious UI.

A couple of features that were useful in this case:

Obviously, a Color modifier that grabs color from the object. Problematic for the instances where the pony outlines shouldn’t match the color (like the rainbow-mane and -tail), but it shouldn’t be too hard to set that up by other means.
I used a curve to specify the thickness of each line-segment, to make them thin off in both ends.
I Freestyle-marked a few edges - the nostrils, blue stripes and lines across the ground - to manually set edges there.

I specified that an Object Group should be excluded from the Line-layer, to not get lines for the houses (to apply the term generously…)
I specified that Freestyle-marked faces should be excluded, to not get lines for the eyes or bright spots on the ground.
You only have one set of Freestyle Edge/Face marks per object though, so that’s a bit limited.

The big downside is that render time is a lot slower. In this case it’s 3s with pure BI, 38s with Freestyle. Also, rendering animation without flickering can be tricky if you use heavily treated lines. wonder if the freestyle branch lets you do something like that.

The freestyle way seems indeed best. I just prefer sticking to original Blender for my renders, but I can get the freestyle build. Will FreeStyle get into 2.63 or a future 2.6 version?