Dynamite Tool for Houdini
Last updated on: 13 July, 2018
Overview
Dynamite is a tool for Houdini which I wrote several years ago to help me bring greater control and automation to the process of creating bake cages in an iterative asset production environment. I needed some means to automatically update cages of all objects, after each iteration of an asset, without having to redo the cages from scratch.
As an input, the program takes two geometry files: a low-poly retopo mesh, and a high-poly reference mesh. Both files must meet two criterions: they need to contain objects or primitive groups having the same names and the quantity of objects or primitive groups must be equal. For example, if we have a car geometry and inside its retopo file we have four objects: wheels
, interior
, body
and chassis
, the same number of objects with the same names must exist in the other file.
When Dynamite loads geometry, it creates its own network in a customizable path. This network will contain one group of three SOP networks per object (or primitive group) of source retopo file. Each group, which I like to call a “baking triplet”, forms a straight triple level hierarchy and contains retopo, reference and cage networks of a given object. The cage geometry is derived from retopo mesh, so the topology of retopo and cage meshes will always be identical.
With the help of a master control node, which is the main operator for controlling the whole network, we can quickly tweak cage offsets of all objects using peak sliders, or fine tune its geometry components (points, edges, primitives) by jumping into edit mode, which is only a single button press away and accessible from the control node. If our asset geometry changes, and we need to update our cages in order to re-bake the textures, then with another single click of a button, Dynamite will reload the two geometry files and rebuild its network to accommodate changes done to objects of our asset. Objects that were not modified will have their cages left intact, and new objects will have their cages created with no offset. The only quirk of the current implementation, is that if point order of an object changes after its cage was fine-tuned, the cage will have to be reset, but only for that specific object or primitive group.
The asset can be exploded, which may help to bake textures in programs that ignore object names, like XNormal for example (hence the name “Dynamite”), or can be exported with name suffixes, which is helpful in programs that take advantage of name correspondence baking.
Watch the video on Invidious instance
(Note that if you open the video, YouTube may track you)
Highlights
Some of the most important features of Dynamite include:
- Ability to use any of the available geometry formats as retopo and reference input geometry, as long as those formats support primitive groups. Usually Wavefront OBJ or FBX are the best choice.
- It’s possible to reference other geometry operators as input geometry (through
op
statement). - If there’s a mismatch in group names of input files, or quantity of objects do not match, the script will inform about it.
- Automatic creation of so-called baking triplets.
- Easy access to keyable translation parameters of the triplets.
- Optional suffixes for output retopo and reference object names.
- One-click object isolation makes working with cages easier, as the view is not obscured by other objects.
- Peak parameter for tweaking cage inflation.
- Semi-automated local modification of cages via Edit SOP. Useful with super low-poly models, or in tight spaces where bake errors could appear due to mesh interpenetration caused by peak SOP.
- A predefined place in cage SOP network to put topology-independent muscle deformers (or any other miscellaneous nodes). This is invaluable if point order of objects changes frequently after each asset iteration, though a bit tedious to set up at the moment.
- Reset any changes applied to a cage of selected object with one click of a button.
- Update Network button which reloads input files and adapts bake triplets to changes that the script finds in primitive groups. New groups found in input files are added to Dynamite network, while bake triplets of groups that no longer exist are removed from it.
- Tessellation of cages will always match tessellation of retopo geometry.
- Subdivision support for creating cages of geometry intended to be rendered as subdivision surfaces.
- Tweakable import/export scale which is useful if input mesh is too small or too large to work with in Houdini, or if external baker throws a warning about baked mesh being too small.
The script can be obtained from: