Tuesday, May 14, 2024

Blender Shells

A geometry shell or geoshell in DAZ Studio is a kind of virtual mesh. It is a clone of a base mesh which can modify materials and some other properties. When loading a figure with geoshells the DAZ Importer creates a special node group in every material affected by the shell (if the Shell Method setting is set to Material). GeneralProtectionFault recently suggested that we might want to use the shell tools to add other node groups created in Blender. 

This idea has now been implemented. Since the DAZ Importer has grown too large and unwieldy, it was recently split into several separate add-ons, see the post on Add-on Split. The new tool that makes Blender shells is located in the Shell Editor, which contains tools for manipulating shells and layered images from DAZ Importer. The idea is to take a given node group, and make it into a shell which behaves just as the shells imported from DAZ Studio.

GeneralProtectionFault made a script which creates a procedural dirt node group. The script can be downloaded from here. To create the node group, load the script into Blender's text editor and press the Run Script button.

A node group is created in Blender's database. We could also create the node group manually. The only requirement is that the first input and output sockets be the ingoing and outgoing shaders, respectively.
Select the mesh and Add Custom Shell.
In the dialog, select the node group at the top and select the materials . Here we pressed the Skin button to quickly select all skin materials.
At the end of each node tree, a shell node group is created. It has the same sockets as every other shell node. Notice that the Influence slider is purple, meaning that it is driven.
To create drivers the global setting Shell driver type must not be None. I prefer to use rig properties to drive the influence, because using mesh object properties doesn’t seem to work with file linking, but armature object properties do.
The shell node group is a wrapper that contains the original node group and mixes the output with the original shader according to Influence. The only requirement is that the first input and first output are the ingoing and outgoing shader. If you want to tweak the node parameters, we can do it here and all materials are changed. The UV and Displacement sockets could also be used.
We can control the influence of shells in the DAZ Runtime > Visibility > Shells panel.