| Previous Topic (Krakatoa SkinWrap Particle and Mesh Deformations) | Up (Particle Workflows) | Next Topic (Particle Culling) |
Selection Channel Support
Available in Krakatoa v1.5.1 and higher
Overview
- The 3ds Max Modifier Stack supports a selection channel (including Soft-Selection Weights for non-boolean selection) for controlling the influence of modifiers on sub-object elements like vertices, edges and faces.
- Krakatoa v1.5.1 adds support for the Selection channel of particles loaded by a PRT Loader or created by a PRT Volume object.
- The Selection channel can be saved to PRT files and loaded by PRT Loaders.
- The Selection channel can be read, modified and written by Krakatoa Channels Modifiers (KCMs).
- The Selection channel can be set by the 3ds Max Volume Select Modifier.
- The Selection channel can be acquired by the PRT Volume object from the source geometry.
- The Selection channel can be used by the Krakatoa Delete Modifier to delete selected particles.
Workflow Examples
Sine Wave Selection By Z Position
- In the following example, we will use a PRT Loader pointed at a PRT sequence containing 200K particles saved from a Particle Flow system resembling a round column.
- We assign a new KCM to the modifier stack of the PRT Loader.
- In the MagmaFlow Editor,
- We switch the Output node to Selection channel.
- We switch the Input node to Position channel.
- With the Input node selected, we press SHIFT+S to insert a ToScalar Operator between the Input and the Output nodes.
- With the ToScalar selected, we press 3 to add an Integer Input node with a value of 3 to the second socket of the ToScalar, thus selecting the Z axis as the value.
- We select the ToScalar node and press the * key on the Numeric Keypad to add a Multiply Operator.
- Then we press F to add a Float Input and enter 0.01 to scale down the Z value.
- We select the Multiply node again and hit the [ key to insert a Sin Operator into the flow.
- At this point, the Z position is scaled down and passed into the Sin operator, producing a sine wave in the Selection channel.
- To visualize this, we can add another KCM to the stack and convert the Selection channel to Color:
- The result in the viewport looks like this - the Sin function changes its output between +1 and -1, but the values below 0 are shown as solid black:
- At this point, the PRT Loader has a valid Soft Selection with values between -1 and +1 and we can add a Modifier to test that:
- We add an XForm modifier, enter the Gizmo sub-object level and scale the X and Y axes only to 150%.
- The result in the viewport looks like this:
- We could clamp the selection value in the range from 0.0 to 1.0, thus "flattening out" the negative portions of the Sine wave:
- We select the Sin Operator and hit the C key to insert a Clamp Operator.
- With the Clamp Operator still selected, we hit Ctrl+0 and Ctrl+1 to create and connect two Float Input nodes with values of 0.0 and 1.0.
- The resulting flow looks like this:
- The viewport representation of the PRT Loader changes accordingly:
- Instead of clamping the negative values, we could turn them into positive ones by replacing the Clamp Operator with an AbsoluteValue Operator.
- We can either switch the Clamp from Function to Arithmetic>AbsoluteValue or
- Remove the Clamp and its two Input nodes by pressing the Backspace key and insert an AbsoluteValue Operator by selecting the Sin Operator and hitting the A key.
- The viewport looks like this:
- So far, we have affected the XForm modifier with our custom procedural Soft-Selection.
- If we would add another deformation modifier like Bend with Angle of 90 degrees for example, it would also be affected by the same selection.
- We have to go to the PRT Loader's Base Object and press the "Get All From Object" button in the Modifier Gizmo Size group in the Culling and Deformations rollout to ensure the Bend gizmo will be resized according to the particle system's size.
- Then we add a Bend modifier and set the Angle value to 90.0:
- This is, of course, not necessarily what we want. Like with regular 3ds Max modifiers, we will have to reset the selection after the first deformation for the second to ignore it.
- To do this, we just add a new KCM to the stack just below the Bend modifier and set it to write the value of 1.0 into the Selection channel:
- The Bend now applies correctly to all particles because they all have a Selection (read: Modifier Influence) value of 1.0:
- Using a Selection value of 2.0 increases the influence of the Bend proportionally, deforming the particles more:
- On the other hand, setting the Selection value to 0.0 disables Bend modifier completely. This could be useful when animating the influence of a modifier from 0.0 to 1.0 or higher:
Spherify By Texture Map
- The Selection channel could also be set by a Texture Map value.
- Let's load a particle system containing a Teapot, for example the PRT files from the Initial Krakatoa Tutorial.
- Let's also add a Spherify modifier on top - a value of 100.0 will make the teapot shrink because the default bounding box size of a PRT Loader is 10x10x10.
- To fix this, we can either enter a larger number in the Modifier Gizmo Size group of controls or disable the Spherify, press the Get All From Object button in the PRT Loader again and reenable the Spherify modifier.
- At this point, we have a teapot that turned into a sphere:
- Now let's add a KCM below the Spherify Modifier
- We change the Input node to TextureMap
- The we press the Get Texture Map... button and pick the Cellular Map
- Since the Output is set to Color, we can immediately see the default Cellular Map in object space coordinates:
- Assuming that we want to use the Color in the rendering AND also control the Selection by the Cellular map,
- We can add a second KCM below the Spherify Modifier but after the KCM_Color modifier
- Set the Output node to Selection channel
- Select the Input node and hit Ctrl+M to insert a Magnitude Operator to turn the Vector into a Float:
- Our Teapot is now Spherified according to the grayscale map we applied: