Transparency by groups (blender addon)
Overview
Allows you to set objects transparency by groups. A must have for anyone doing technical/mechanical animation!
The addon is a tab in the 3D viewport side panel.
the outer case of the printer is group1, the cover of the printing head is group2 (partial transparency)
Workflow
- First create the groups (you can create between 1 and 32 groups) : choose a controller object, then click on the create/update button.
- Then select all the objects that need to be assigned to transparency groups, and click on "assign GN to objects". Now, all the selected objects have a Geometry Node modifier allowing you to associate the object to one (or several!) group. the value 0 means that the object is non associated to the corresponding group, 1 means complete association. everything in between is also allowed, for partial transparency.
- The last step is to edit the relevant materials to actually change the alpha. Here you have two choices : just add the computed opacity attribute node (unconnected) to the materials of the selected objects, allowing you to process this value as you want (for example : direct link to BSDF alpha), OR let the addon add a transparent BSDF shader + mix shader setup to your very last shader to control the transparency automatically.
- Now you can change the Tgroup sliders in the controller object custom properties to control the transparency of your groups!
Good to know (please read) :
/!\ When the GN are first associated to objects, the drivers in the GN tree may not work (blender needs to update the dependencies). This is a well known blender limitation. This should work the next time you load the file, or you can also click again on the first button (create/update Controller & GN) after assigning the GN to at least one object, it fixes the dependencies for good. You can also go into the GN tree, then open the drivers and click on "update dependencies" for each. Sorry for that, I tried to solve this without any luck... /!\
In the case of several groups attributed to a same object, all the alpha values resulting from every groups will be multiplied together. For example, if an object is fully on group 1 and 2, and the opacity of those two groups are both 0.5, the resulting opacity of this object will be 0.5*0.5=0.25.
The controller can be anything that can accept custom properties (like empties or objects).
Obviously, the objects non assigned to any groups and the objects that do not have the GN modifier will NOT be controlled.
The addon focuses on alpha control, but you really can control anything you want, like a colour or the mapping, keeping the logic of grouping objects together, you have full control over your groups and materials!
I put my soul into this addon, a kind tip would be very appreciated!
a .py file to install as blender addon