This topic describes basic methods for working in the Max Creation Graph Editor.
Note: Most functions in the Max Creation Graph editor are not undoable. Thus it's a generally a good practice to save a graph in a state you might want to restore later.
Add nodes to the graph:
Important: To view a brief description of a node, whether in a list or in the graph, hover the mouse cursor over the node's title bar or name. After a moment, the description appears in a tooltip attached to the mouse cursor.
To view a more-detailed description in the Operator Description pane, click the node in the Operator Nodes list or in the graph.
- Find the node to use in the Operator Nodes list on the left side of the editor to the graph window, then drag it into the graph window. To find a particular node quickly, enter part of its name into the search field just above the list. If you precede the search text with an asterisk (*), it will find the text anywhere within the node name.
- Double-click a node in the Operator Nodes list. This adds the node to the center of the graph window.
- To create a node and wire it at the same time, drag from a node's connector in the graph to an empty spot in the graph window. When you release the mouse button, a list of compatible node opens. You can narrow the list by entering part of the desired node's name from the keyboard. When you choose a node from the list, it is added to the graph, already wired. Note: If the node you choose has multiple compatible connectors, a list appears at the mouse pointer; click the connector to use.
- Type X to open the search dialog, with an alphabetized list of all nodes. Optionally, to restrict the list to items matching a search string, type any part of the node name. Then scroll the list, if necessary, to find the desired node, and add the node to the graph via one of the following methods:
- Click the node name in the list.
- Use the up or down arrow key to highlight the node name in the list, then press Enter.
After you add a node to the graph, its name in the graph is preceded by a unique numeric identifier, starting with 0 and incrementing by 1 for each additional node of the same type. Debugging messages refer to this number to help you find the particular node in which an error occurs.
Note: When you change the contents of the graph, for instance by adding or deleting a node, an asterisk appears next to the graph's name in the window tab to indicate unsaved changes. To minimize the accidental loss of data, be sure to save your graph regularly.
Alternatively, you can let Max Creation Graph automatically generate input and parameter nodes for existing nodes, as described following.
Generate inputs or parameters for a node automatically:
Most nodes require one or more inputs or parameters. An input is an incoming value that's defined within the graph; a parameter is an incoming value that the user defines from the tool's user interface. Max Creation Graph can create appropriate input and parameter nodes for any node's empty input connectors quickly and easily.
- Select the node for which you want to generate inputs or parameters.
- Right-click in the graph window and choose Generate Inputs or Generate Parameters.
Max Creation graph creates compatible nodes and wires them to the appropriate input connectors of the selected nodes.
Duplicate nodes in the graph:
- While holding Shift, drag an existing node within the graph window.
- Select one or more nodes in the graph window, then do either of the following:
- Right-click and choose Copy, then right-click and choose Paste. The pasted nodes appear where you right-clicked the second time.
- Open the Edit menu, choose Copy, then open the Edit menu again and choose Paste. The pasted nodes appear in the center of the graph window.
These latter methods work within a single view, but also let you move and copy nodes between different views.
Insert a node into a wire between two other nodes:
- Press and hold the Ctrl key, then drag the node to the wire. When the mouse cursor is near the wire, the wire changes in appearance to a yellow dashed line. Now you can release the mouse button to insert the node.
Note: When you release the mouse button, if multiple connectors of the dragged qualify for the insertion, a list of qualifying connectors appears at the mouse cursor location. Choose the desired connector to complete the insertion.
Remove a node from the graph:
- Press and hold the Alt key, then drag the node away from its present location. As soon as you start to drag, the node is removed from its wired connections, and you can release the mouse button. If the connection between the two remaining nodes is still valid, they stay wired.
Work with tabs in the graph window:
By default, the Graph Editor provides a single view and its associated tab. You can create new views, save the contents of each view in a separate view, move and duplicate nodes between tabs, and more.
- To add a new tab, do one of the following:
- Open the Carbon menu on the main menu bar and choose New Graph.
- Right-click the blank area next to existing tabs and choose Create New View.
- Open the File menu in the graph editor and choose New.
By default, a new tab is named Untitled. To rename the tab, save the graph to an XML file (see following). After doing so, the file name appears on the tab.
- To save a graph as an XML file, do one of the following:
- Activate the tab of the graph to save, then open the File menu and choose Save or Save As.
- Right-click the tab of the graph to save and choose Save or Save As.
- To change all tabs' docked position (left/right/top/bottom), right-click the blank area next to existing tabs and then choose the desired option from the context menu.
- To move a tab, drag it to the desired location.
- To close a view, click the X button next to the tab's name or simply middle-button-click the tab. If the view's graph contains unsaved changes, you're prompted to save.
Work with group nodes in the graph window:
You can use groups to organize your graph and add descriptions and comments to the graph.
- To group one or more nodes, select them, then right-click and choose Create Group Node. The selection can be any combination of group nodes and operator nodes. You can nest group nodes to any extent.
This creates a group containing the selected nodes with the default title Group.
- To rename a group node, double-click its title and use the keyboard.
- To add descriptive text to a group node, double-click an empty area inside the node; this creates an outlined text box. Use the keyboard and mouse to enter and edit the text as with any standard text editor. To finish editing, click outside the text box.
- To change a group node's color, right-click the node and choose Change Background Color. Use the Color Selector dialog to choose a new color.
- To move a node into a group node, drag it over the group node so that the group node background highlights, then release the mouse button.
- To remove nodes from a group node, select them, right-click, and choose Remove Selected From Group. You can then optionally drag them out of the group node.
- To rearrange nodes within a group node, simply drag them. Moving a node toward the group node border expands the node as necessary to fit.
Tip: By default, moving a node away from the group node border doesn't reduce the node size, but you can opt for this behavior if you like. Right-click the group node, and on the context menu turn on Auto Fit To Content.
Wire and unwire nodes:
You create graphs by placing nodes in the graph window and connecting them with wires. Wires are depicted in the editor as arrows that point in the direction of data flow. Each arrow assumes the color of the output connector it's wired to.
- To wire two nodes together, drag between an output connector of one and an input connector of the other. The direction you drag in doesn't matter; the data always flow from the output connector to the input connector. You can wire a single output to any number of inputs, but not vice-versa. Wiring a node to an input connector that is already wired to another node automatically deletes the first connection.
Important: To wire two connectors, both must use the same data type, as signified by their coloring. The only exception is the green connector, which can be wired to any other type of connector.
- To create a node and wire it at the same time, drag from a connector to an empty spot. When you release the mouse button, a small dialog for choosing and searching for a compatible node opens. When you choose the desired node, it is added to the graph, already wired. Note: If the node you choose has multiple compatible input connectors, a list appears at the mouse pointer; click the connector to use.
- To remove a wire, do either of the following:
- Right-click the wire, then choose Disconnect Edge.
- Select any number of wires using standard methods (the same as selecting objects in the viewport). Then press the Delete key.
Delete nodes:
- To delete one or more nodes, first select them, then do one of the following:
- Press the Delete key on the keyboard.
- Right-click and choose Delete Selection.
- Open the Edit menu and choose Delete.
Use and modify a Max Creation Graph package:
A package is a self-contained MCG graph that includes all dependencies, such as custom compounds. It is designed to simplify the installation and use of a custom tool without having to open the MCG Graph Editor. However, if you want to examine and modify the graph, this procedure shows you how to access it.
- Use either of the following menu commands to install a tool. This makes the tool available for use by placing it in the appropriate UI location.
- Scripting (or Script, with enhanced menus) menu
Install Max Creation Graph (.mcg) Package
- Max Creation Graph Editor
File menu
Install Max Creation Graph
After installing the package, you can open and view the graph, for example if you want to modify the tool.
- Use the Open Graph command from either menu location.
- Navigate to the C:\Users\[username]\Autodesk\3ds Max 2017\Max Creation Graph\Tools\Downloads folder.
- Find the .maxtool file with the same name as the tool you installed and open it (for example, PushRandom.maxtool).
Note: If the tool contains any compounds, you can find them in the \[toolname]\Compounds\ folder within the Downloads folder. Using the same example, this would be the \PushRandom\Compounds\ folder.
Use a procedural graph from within a MAXScript script:
- The following script fragment (with comments) lets you load and compile a graph file:
bridgePath = (symbolicPaths.getPathValue "$max") + @"\Viper3dsMaxBridge.dll"
dotNet.loadAssembly bridgePath // load the .NET Assembly that contains the class and method that loads a graph xml
bridge = dotNetClass "Viper3dsMaxBridge.Main" // create an instance of the class called Main
bridge.CompileGraph <path to the xml graph file> // call Main.CompileGraph() to load and compile a given graph file