From the course: Maya: Bifrost Extension

Creating a basic graph - Maya Tutorial

From the course: Maya: Bifrost Extension

Start my 1-month free trial

Creating a basic graph

- [Narrator] Now we know enough about the bifrost graph in order to make our first attempt at building a graph using the stock compound, which is the basic arrow graph. We'll want to have some sort of object to generate the arrow simulation and we can use any Maya mesh object to do that. Let's keep it simple, we'll just create a sphere. Go to the create menu, and choose polygon primitive sphere. With that object still selected, we can make it an input to the graph automatically, so pSphereShape1 is currently selected, we can go back into the menus to create bifrost graph and when that graph loads we see there's a input node in it, and if we select the input node in the parameters, we see the path to the object that was selected when we created that graph and we can actually just type this path in directly to any input node to grab the shape node for any object in the Maya scene. It just has to have this syntax it has to start with a slash, then the transform node name, another slash, and then the shape node name. We can also just simply middle mouse drag nodes from the outliner, and that has the convenience of changing the input node for us. So let's delete this input node, I'll select it and press the delete key, go to the Maya outliner, and middle mouse drag the sphere into the bifrost graph. And it's labeled pSphereShape1. We've got a output node automatically and if we click on the mesh port of that input node labeled pSphereShape1, we can drag over to the plus sign on the output node, release the mouse, and a connection is made, and in the process, a new port was created on that output node and it's labeled mesh1. Once we've connected something to the output node, now we actually have an output here in the outliner, it's the bifrost shape node, bif1. Just for a moment I'm going to investigate that by minimizing the bifrost graph editor, I'll select that bif1 node, which is actually the transform of that bif shape node, grab the move tool, and just move it over to the side, just to show that we now have an input object, which is the original pSphereShape1, and an output object which is just the bifrost shape. Okay I'm just going to send that back to its original position, set its just translate x value to zero, and go back to the bifrost graph editor again, now that we've got inputs and outputs working, let's actually create a simple, basic arrow graph, and we can break the connection that we have here, there's a keyboard shortcut for that, which is to hold down Shift and Alt and click and drag across that connection, and that'll break that connection. And now we're ready to create a new basic arrow graph, and the way to do that is to press the Tab key in the graph and you'll get a popup menu with a list of categories of all of the installed nodes and compounds. And also a search field. And if you know the name of what you're trying to create then you can just type it in here. And in this case I know I'm looking for a basic arrow graph, so I can just start typing that in, B-A-S, and it actually is the first one on the list, basic arrow graph, click on that, and we get a new compound here, basic arrow graph, and I know that this is a referenced compound, because it's got a little blue diamond next to it. And that's Maya iconography to indicate that this is a reference, it's a link to a file on disk, and if I double click on that node, we'll go inside it. Let's maximize the graph editor so we can see better. And inside that referenced basic arrow graph, we see a bunch of other compounds, let's just automatically organize the graph here with the keyboard shortcut which is L. As we saw earlier, we've got some high level compounds, including the simulation node, source air collider, and arrow solver settings, and we've also got an input and output node and those exist in order to make connections outside of this nested compound, in other words, we need to connect to what's happening here at the top level of the graph. So if we go back into that basic arrow graph, we'll see that we've got an input and an output but they're not connected to anything, and we also see down here at the bottom because we went inside a referenced compound, we're not able to edit the structure that we see in the graph here. In the current condition we actually cannot use this graph, we can't connect these inputs and outputs to anything here, because this compound is not editable. Hmm, well that's kind of strange. We could make this editable, there is a way to do that. We can go back up to the top level here, and right click on that compound and choose make editable. Once we do that the little blue diamond disappears, and now this compound has been imported into the current graph in the current Maya scene. But the compounds inside this compound have not been imported. So if we double-click and go inside there, we'll see that although we're able to make and break connections, the compounds internal to this compound are still referenced, and that tells met hat the make editable compound command is not recursive, and that really is the case across bifrost, the commands are not recursive in general. Okay, we could connect a whole bunch of stuff into these input and output nodes to expose them at the higher level of the graph, but that's way more work than we really need to do, there's an easier way to do this. So I'll go back up to the top level of the graph, and use the undo command to go back a few steps. I'll just press the Z key once, and press the Z key again, and now we're back where we were with a referenced compound. Instead of making that compound editable, we can explode the compound, and that's going to actually make things a lot easier in this case, and that is the preferred workflow with one of these basic graphs. So you bring that graph in with the Tab key, and then immediately right-click on it, and choose explode. And we can re-organzine the graph again, click in the graph and press the L key. When we explode a compound, that compound gets deleted and its contents are promoted to the current level of the graph, in this case the root level. The internal input and output nodes inside that compound are deleted as well. And again these nested compounds are not exploded, nor are they made editable, because that explode command is not recursive. But now we're actually in a good position to make the connections we need to make. So we can just bring our input node over here and connect its mesh output to the geometry input of the source_air compound. Then over here we have the simulate compound, which is the engine that runs the simulation. We want to connect it's arrow volume port and create a new port, so drag over to the plus sign and release the mouse, and we get a new port labeled arrow volume. Now we don't need this mesh port anymore, it's not connected to anything, so it's not a problem, but if we want, we can just right-click on the port, and from the popup menu choose delete port, and we just clean that up. So now we've got a basic arrow simulation, and we can minimize the bifrost graph editor, maybe get a little closer in the viewport here, and press play, and that will make the simulation run, it'll take a moment, but we'll start to see some arrow volume effect appearing, and it's being emitted from the sphere that we created in Maya. And that's how to create a new graph using the stock basic arrow graph compound.

Contents