As seen on TV!
image courtesy of ruaidri @ furaffinity
encode-normals is a small blender addon that copies the normals of a particle emitter to the particle strands each frame, for use in stylized fur shaders.
Blender does not provide access to the underlying emitter normals in the same way it does for mesh color. To get around this, the encode-normals addon stores emitter normals in world space in a vertex color layer. When enabled, it will automatically update the vertex color layer each frame for rendering.
I'm releasing this addon for free, no strings attached. It's open source under GPL2, just like Blender.
But if you like it and you use it a lot, please consider buying me a coffee at my Ko-Fi account!
You do not need to credit me if you use this addon. But I'd love to see what you make! Feel free to send me a link so I can admire it.
This addon was heavily inspired by and partially based on Steve Miller's Mesh Tension Addon
Vertex colors are stored as RGB values from [0, 1]. Normals are stored as
[-1, 1]. The plugin will map store the normals as
(normal * 0.5) + Vector3(0.5, 0.5, 0.5)
.
To reverse this transformation, you need to multiply the values by 2
and then subtract 0.5
by using Vector Math nodes in the shader editor
- Download the extension .py file
- In Blender, go to Preferences -> Add-Ons
- Click Install and select the .py file
- Enable
Mesh > Encode Normals
via the checkbox
- Enable the
Render -> Lock Render
checkbox. This avoids crashes during viewport updates, but your viewport will not respond while rendering (ESC still works) - Click on a mesh that you want to enable this feature on
- Under Mesh properties, enable
Particles Normals
via the checkbox. This will create the vc_normals vertex color group if it does not exist yet. - Set up the shader using the node group above to use your encoded normals instead of generated normals.
- Click
Encode Normals
to manually encode normals for the current frame while doing viewport work. - The addon will automatically encode normals every frame for you during render
- Click the
Ru Button
, which literally does nothing but looks cool
- Ru Button (does nothing)
It does not currently update per frame within the viewport, to avoid slowing down the viewport for animation work. A button is available to manually update the vertex color layer.
- The plugin will throw an error if you click Encode Normals before clicking the checkbox. I forgot to make the addon disable itself until the checkbox is clicked. Lol.