Groom Operator
One or more Ornatrix operators can be combined into a single Groom modifier in Ornatrix for 3ds Max. The Groom modifier functions the same as the individual operators it contains. Reasons for combining operators into a Groom include:- Organization: Simplifying the modifier stack by combining different parts into fewer overall operators.
- Graft Grooms: Creating a type of groom preset that can be grafted onto any surface and reused.
- Selective Parameter Exposure: Allowing only certain parameters to be exposed for controlling the parameters of combined operators.
- Procedural Non-Destructiveness: Enabling a non-destructive workflow for baking hair or operators.
A Groom operator can be decomposed back into its original operators at any time.
Boxing
In Ornatrix for 3ds Max, boxing refers to the process of combining multiple Ornatrix operators into a single Groom operator without changing the output of the hair stack. The boxed operators, including their parameters and assets like maps, are enclosed within the Groom operator.
To box operators:- Select one or more operators in the modifier stack.
- Right-click on one of the selected operators.
- Choose the Box option.
Unboxing
Unboxing is the process of separating a Groom operator back into the individual operators that make it up, maintaining the overall hair stack's output. Parameter values are preserved, but some assets like maps might be converted to their rasterized versions.
To unbox:- Select and right-click on a Groom operator in the modifier stack.
- Choose Unbox.
Exposing Parameters
By default, a Groom operator in Ornatrix for 3ds Max does not expose the parameters of its constituent operators. It uses the parameter values from the time of boxing. However, you can expose any number of parameters for scripting control.
To expose parameters:- Select the Groom operator and open the Parameter Editor.
- Locate the Groom Parameters Script section.
- Click on Edit Parameters Script.... This opens the default text editor with a Python script, listing all potential parameters.
- Uncomment the desired parameters (remove the "#" at the beginning of a line).
- Save the file and press Update in the Parameter Editor.
The Groom Parameters section, which was initially empty, will now display the exposed parameters. The Python script can be further modified and updated to refine the parameters script. Parameters can be renamed, and their default, minimum, and maximum values adjusted. You can also create parameters that perform mathematical operations or set multiple operator parameters simultaneously.
Parameter Groups
Parameters can be organized into UI groups in the following manner:
('GroupUIName', 'Group', True)
All subsequent parameters, until the next group definition, belong to this group. Groups are automatically generated based on Ornatrix operator parameter groups in the default script.
Parameter Definition
The most common method to modify a parameter is via the `set_value` function:
('ParameterUIName', 'type', lambda gm, v : gm.set_value('OperatorName', 'OperatorParameterName', v), minValue, maxValue, defaultValue)
This standard definition includes:
- ParameterUIName: The name as it appears in the UI.
- type: The UI parameter type (int, float, bool, string), matching the type set by `set_value`.
- A setter function, typically a lambda.
- Optionally:
- minValue, maxValue: The UI range for the parameter.
- defaultValue: The default value when resetting.
Additional functions are available for setting array and ramp parameters.
Mirroring Graft Grooms
For a Groom node that is a graft groom in Ornatrix for 3ds Max, you can mirror its output along an object-space axis.
To mirror a groom:- In the Parameter Editor, locate the Mirror Groom section.
- Enable the mirroring option.
The groom is mirrored to the opposite side of the selected axis (default is X-axis). The Randomize option, if enabled, varies the mirrored groom's appearance from the original, assuming a RandomSeed parameter is defined.