Krakatoa MX Documentation
RSS< Twitter< etc

<<Back to Krakatoa User Reference

Krakatoa Magma 2

Available in Krakatoa MX v2.0.0 and higher.
For documentation of the obsolete Magma 1 in Krakatoa v1.6.1 and earlier, see here.

Magma is the name of the Channel Data Editing system of Krakatoa MX. It was first introduced in Krakatoa 1.5.0. It is currently NOT available in Krakatoa SR.

Magma 2 introduced in Krakatoa MX 2 has been refactored from the ground up and 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 MagmaFlow 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 now fully exposed to MAXScript - all operations performed in the MagmaFlow 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 creation of MagmaFlows is now fully and natively supported, and the MagmaFlow Editor employs automatically generated MAXScript code for all file operations like 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, Undoing and Redoing 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 MagmaFlow, for example.

Other output formats lile Python or XML are possible and could be implemented in future versions with little effort.

Accessing Magma 2

Magma 2 is available on the modifier stack of 3ds Max through a new Magma Modifier which was implemented as pure C++ plugin to improve performance. Node and Texture Map references are now 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.

MagmaFlow 2 Editor

The MagmaFlow Editor is the user interface dialog that facilitates the creation of particle data channel editing operations including the modification of existing particle data and the creation of new channels.

Like its predecessor, the MagmaFlow 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 MagmaFlow Editors

  • Each Magma Modifier can open its own independent MagmaFlow Editor. There is no limit to the number of MagmaFlow Editor instances that can be opened at the same time. This allows the parallel editing, comparison, copying of nodes between editors etc. 
  • In contrast, MagmaFlow 1.x had a single window displaying the content of every modifier.

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 MagmaFlow 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.

Multiple Output Sockets Per Operator

  • Each MagmaFlow 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 MagmaFlow 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 or if the socket in question does not support a default value. 
  • In contrast, MagmaFlow 1.x required an explicit Input value node for every socket or the flow would be considered invalid.

Advanced Node Creation And Connection Workflows

  • Most automatic connection workflows of MagmaFlow 1.x are still supported - for examle creating new nodes while other nodes are selected in the editor will attempt to connect them.
  • MagmaFlow 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. 
  • For example, dragging from the Geometry input of IntersectRay 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 of 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 form 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 socket 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 MagmaFlow 1.6.1, the same operation requires 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 MagmaFlow 1.x, but in MagmaFlow 2 it can be set via the Default Value, unless the value requires keyframe animation...

The bottom line: The MagmaFlow 2 solution required only one modifier with 11 nodes, while the MagmaFlow 1.6.1 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 MagmaFlow 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 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 MagmaFlow 2 Debugger

MagmaFlow 2 features a Debug mode which exposes the intermediate values of all nodes for a user-defined range of particles in a list view not unlike 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 MagmaFlow 1.x editor used user-defined values to pass through the flow for debugging purposes.

There is currently no graph mode in MagmaFlow 2.