Magma 2¶
Available in Krakatoa v1.5.0 and higher
Introduction¶
- Magma is the name of the Channel Data Editing system of Krakatoa MX.
- It was first introduced in Krakatoa 1.5.0.
- Magma 2 introduced in Krakatoa MX 2 was refactored from the ground up.
- It provides both improved performance and enhanced workflows by eliminating a large number of limitations of the original implementation as determined by users and developers.
Magma 2 Major Characteristics¶
- Magma 2 stores all node information in a MagmaHolder ReferneceTarget object implemented via the 3ds Max SDK.
- Magma 2 stores all relevant data using Parameter Blocks, including all Animation controllers which now appear as sub-tracks of the MagmaHolder. (In Magma 1, the Animation data was stored in Global Tracks and the connection between Magma Input Nodes and TrackView Controllers was implemented using unique IDs.)
- Magma 2 does not make a differentiation between Input nodes, Operator nodes and Output nodes anymore - all nodes can be converted freely between categories and types - while the conversion of Output nodes to operators is disabled in the UI, it is technically supported.
- Magma 2 is fully exposed to MAXScript - all operations performed in the Magma editor can be peformed via scripting.
Human-Readable Flow Format¶
- As mentioned above, Magma 2 exposes a MAXScript Interface for creating, manipulating and deleting nodes, their properties and connections.
- Thus, the scripted creation of Magma Flows is fully and natively supported
- The Magma Editor employs automatically generated MAXScript code for all file operations including
- Saving, Loading, and Merging full or partial flows,
- Loading and Saving of BlackOp Compound Nodes,
- Copying and Pasting of nodes within the same flow and between flows using the Windows Clipboard
- Undo and Redo of editing operations etc.
- This provides a human-readable expression of the flow data that can be posted to Internet forums and pasted from there directly into the Magma Editor, for example.
Accessing Magma 2¶
- Magma 2 is available on the modifier stack of 3ds Max through a Magma Modifier and a Magma World Space Modifier (a.k.a. SpaceMagma introduced in v2.5.0)
- Both are implemented as pure C++ modifiers to improve performance (while Magma 1 used a scripted modifier as the host of the Magma Flow data).
- Node and Texture Map references are stored natively in the Parameter Blocks and are completely name-agnostic, allowing the renaming of scene objects the flow depends on without affecting its functionality.
- Magma 2 is also available from a Custom Render Element.
Magma 2 Editor¶
- The Magma Editor is the user interface dialog that allows the creation and modification of particle data.
- Like its predecessor, the Magma 2 Editor has been implemented using the Helium node control originally developed by Lumonix.com, but a number of limitations have been lifted compared to the previous implementation.
Multiple Magma Editors¶
- Each Magma Modifier will open its own independent Magma Editor.
- There is no limit to the number of Magma Editor instances that can be opened at the same time.
- This enables parallel editing, comparison, copying and pasting of nodes between Editors etc.
- In contrast, Magma 1.x had a single window displaying the content of every modifier, one at a time.
Multiple Output Nodes Per Modifier¶
- Each Magma Modifier can write to one or more Output channels.
- There is no fixed limit to the number of channels one modifier can output to.
- This allows the output of the same data to multiple targets, or the output of multiple dependent or independent calculations to multiple targets.
- For example, a Color value can be written to both the Color and Emission channels, or the results of Ray Intersection can be output to both the Position and Normal channels without performing the intersection multiple times - see the example further on this page.
- In contrast, in Magma 1.x each modifier could output to only one channel, so in the above cases it would have required two modifiers and potentially two Ray Intersections, resulting in slower performance.
- Note that the Custom Render Element using Magma 2 only allows one Output node to be created, writing to the Render Element’s bitmap.
Multiple Output Sockets Per Operator¶
- Each Magma node can expose an arbitrary number of Output sockets.
- In contrast, the previous version supported only one Output socket per node.
- In some operators, output sockets can be added dynamically as needed to access relevant data.
- The new system allows new types of operators like
- the Breakout operator which exposes three outputs to extract the components of a Vector value,
- the IntersectRay which can output several results from a single node,
- the PropertyQuery operator which can define an arbitrary number of user-defined outputs and so on.
- In contrast, in Magma 1.x an operator could have only one output socket, which required a lot more nodes to perform the same operation.
Support For Default Input Values¶
- Input sockets can implement a default value, significantly reducing the number of necessary nodes in the flow.
- An InputValue node is only needed if
- Keyframe animation is required,
- The value needs to be exposed to the UI,
- The socket in question does not support a default value.
- In contrast, Magma 1.x required an explicit Input value node for every input socket, otherwise the flow would be considered invalid.
Advanced Node Creation And Connection Workflows¶
- Most automatic connection workflows of Magma 1.x are still supported - for example, creating new nodes while other nodes are selected in the editor will attempt to connect them.
- Magma 2 implements dragging a connection wire from an unconnected input or output socket into an empty area of the editor as a creation shortcut.
- Depending on the context, a node menu will pop up, or one or more nodes will be created automatically if the choice is obvious.
- For example, in the case of an IntersectRay operator,
- Dragging from the Geometry input creates an InputGeometry node automatically because it is the only logical option there.
- Dragging from the Ray Origin input socket creates a Position channel input AND a Transform > ToWorld operator because the Ray Origin is usually the particle’s position in world space.
- Dragging from the Ray Direction socket creates a Vector input with value of [0,0,-1] because it is considered a very typical default.
- Holding down CTRL key while releasing the wire will pop up the full node menu to select any other node.
- Selecting multiple operators and pressing the SPACE BAR key performs a connection based on input and output socket names from left to right - nodes on the left are considered inputs of the nodes to the right.
- Creating a Switch (equivalent to logical IF) operator when at least one Boolean operator is selected (for example Greater, Less) will automatically connect the Boolean operator to the third input socket of the Switch which is the control socket.
- Inserting new nodes into existing connections is supported by either selecting the wire itself, or selecting the node and using the INS key to specify the output socket and the connection type (Insert or Connect).
- If the mode is Insert, the node will be inserted into the existing connection.
- If the mode is Connect and there is no existing connection from the highlighted output socket, the new node will be connected to it.
- If the mode is Connect and there is an existing connection, the new node will be branched into a new connection.
- Inserting an existing node into an existing connection is also supported by selecting the wire first, then adding the existing node using Ctrl+Click and pressing SPACE BAR to insert.
- Insertion is always performed using the first input and first output sockets of the node to be inserted.
Example: The following Magma 2 flow performs a Ray Intersection along the -Z world axis against a Plane primitive and sets the particle’s Position to the intersection point, the Normal to the face normal at the intersection, and the Viewport Vector display of the particles to 10x the Normal vector:

- In Magma 1.x, the same operation required three Krakatoa Channels Modifiers:
- The bottom one performs the Ray Intersection and outputs the resulting position to the Position channel.

- The second one performs the SAME Ray Intersection and outputs the Face Normal to the Normal channel:

- The top modifier takes the already calculated Normal channel, multiplies it by 10.0 and outputs as the PRTViewportVector channel to show the particles as lines 10 times longer than the acquired Normals:

- Note that the Multiplication by 10.0 requires an Input Value node in Magma 1.x, but in Magma 2 it can be set via the Default Value, unless the value requires keyframe animation…
The bottom line: The Magma 2 solution required only one modifier with 11 nodes, while the Magma 1.x used 3 modifiers with a total of 18 nodes. Running these flows with 27 million particles and 20,000 faces showed a difference of about 5 seconds from the additional Ray Intersection.
Magma 2 Nodes¶
- Magma 2 provides all features of the previous version, although some operators are implemented differently, and a number of new operators have been added.
The following topic lists all operators available in Magma 2.
Compatibiliy With Old Scenes and Saved Flow Files¶
- The Magma 2 Editor supports the loading and automatic conversion of 1.x KMF files to Magma 2 flows.
- Due to the changes and advanced features of Magma 2 described above, it is not possible to save new flows in the old KMF format.
- Existing 1.x Krakatoa Channels Modifiers will also be converted to Magma 2 modifiers automatically on scene load
- This behavior can be disabled temporarily for the current session via the Krakatoa System Preferences dialog.
- If you want to open and modify a scene that will be passed back to a user of Krakatoa 1.6.x or 1.5.x, be sure to disable the automatic conversion before opening the file.
- The Krakatoa Channels Modifier of v1.6.1 still ships with Krakatoa MX 2.x and appears on the Modifier list.
- It can be used to create old-style flows and is also there for backwards compatibility with old files.
- If the automatic conversion is on, saving a scene with old-style KCMs and opening it again will have them converted to new Magma 2 modifiers.
- If you intend to pass the scene to a user of Krakatoa 1.6.x or earlier, you don’t have to disable the automatic conversion since it is performed on opening the scene and not on save.
- The actual evaluation of the Krakatoa Channels Modifier however has been disabled, so an old style 1.x modifier will do nothing in Krakatoa MX 2.x.
The Magma 2 Debugger¶
- Magma 2 features a Debug mode which exposes the intermediate values of all nodes for a user-defined range of particles in a list view similar to the Krakatoa Particle Data Viewer.
- The particle data it taken from the actual particle stream of the edited object and reflects the real values flowing through the modifier stack and the Magma nodes.
- In contrast, the Magma 1.x editor used user-defined values to pass through the flow for debugging purposes.
There is currently no graph mode in Magma 2.