In this new blog series, I will address common questions and useful tidbits of knowledge for Bifrost newbies. Of course – your first port of call should be the official Bifrost tutorials videos posted here on AREA, but there’s still a lot of low-hanging fruit to cover.
So, to start things off, here are 9 questions and answers to get you started:
How do I set the color on the backdrops?
Double-click on the lower-right corner tab/triangle.
How do I bring a mesh into Bifrost?
Just drag and drop it from the outliner.
How do I bring a Bifrost mesh back into Maya?
Output it to an output, go into the node editor, and expand the node-view on the Bifrost graph so you can see the output port for the mesh. Now, create a bifrostGeoToMaya DG-node, and connect the Bifrost graph’s output port to the “Bifrost Geo” input attribute on the bifrostGeoToMaya node. The “Maya Mesh” output attribute contains the Maya mesh which you can now “do Maya things” to, as you would any other Mesh.
How do I optimize the viewport performance when working with TONS of Bifrost points?
The good news is Bifrost can efficiently generate tons of points and particles, and the viewport can’t always catch up. The simplest way to stay interactive in the viewport when dealing with millions of points or more is to use the “set_point_shape” compound right before outputting the points object and use either the “Point” or “Quad” setting on the Shape parameter. Point will just draw all your points as dots while Quad takes into account the point_size property (in case you have varying point-sizes). Those are the fastest drawing modes for tons of points in the viewport. The downside is there isn’t much lighting support – but if you just need to see your points, work interactively, and you have a LOT of them – this is the best setting.
Why am I seeing only a “1” on my watchpoint, when I know there’s an object there with all kinds of juicy data that should be displayed?
When all you see is a single number on a watchpoint, that’s telling you the connection is an array of objects. The number refers to the number of elements in the array, so a “1” means there’s an array of length 1 there. Another dead giveaway that you’re dealing with an array of objects rather than a single object is the shape of the output port from which the connection runs. It will look like a hat instead of a square.
Why does the file_cache compound have two output ports?
Most file-formats support reading and writing multiple objects at once. For example, a VDB file can contain more than one volume. Bifrost’s native .bob files can also contain multiple objects. Because of that, the file_cache node outputs an array of objects, which is usually just one element long – if there is only one object in the file. In order to access the individual object from that array, you’d have to use a “first_in_array” node to extract it. Alternatively, you can just use the “first_object” output port on the file_cache compound, which does that for you. Remember though, if there are more than one objects in the file you’re reading, you’ll only get the first one.
Can I bring in more than one geometry with a single input node, using any kind of regular expressions?
Yes, you can, although the syntax for this is currently Maya-specific. In the Maya scene-graph, geometry paths are written with the transform name first, followed by a slash, followed by the shape node, and they have the same basename. For example, the path to a polygon cube known as “pCube4” in Maya is /pCube4/pCubeShape4. Let’s say there are four such cubes in the Maya scene, named pCube1, pCube2, pCube3, pCube4. You can write a regular expression to bring in ALL of the pCubes with a single input node by using the following path on the input node: /pCube*/pCubeShape*. Note you have to use the asterisk twice – once to collect all the transform nodes and once to collect the shape nodes.
What is the difference between a compound and a graph?
The short answer is: compounds are building-blocks for graphs. The longer answer is best answered in two ways: technically and intent-wise. Technically, the difference is that a compound is a .json file while a graph is a folder containing a .json file, a thumbnail image, a markdown documentation file, and possibly an example scene file. Note that the .json file for a graph IS a compound. Thus, it would be correct to say that a graph is a compound, but a compound is not a graph. With the technicalities out of the way, the more interesting question is why did we differentiate between them, if they are both fundamentally compounds? The answer to that is the “intent” part: graphs are intended to be starting points for entire workflows, shots, or methods, whereas a compound is just a building block for a graph. You can have two compounds like scatter_points and mesh_points, and those are great building blocks for a graph that creates a mesh of scattered points, given some input. It’s quite useful to wrap up a higher-level workflow, functionality or example, using many compounds – and publish that for users to get started with. That’s why we created graphs – which also include thumbnail images, docs, and sample scenes. Another difference is that graphs are intended to be embeddable directly in a host application like Maya. You can make a Bifrost graph directly in the Maya DG, for example, but you cannot make a Bifrost compound directly in the Maya DG.
When I work with larger graphs, why is there is a delay when I change parameters or make edits to the graph?
Currently, the Bifrost JIT-compiler recompiles the entire graph every time you change anything. This is being fixed. However, for the time being, you have two workarounds: (1) Disable the JIT-compiler altogether by "Pausing the graph". This is done by pressing CTRL + . Now you can make a lot of edits without the JIT-Compiler taking any time and when you are done and ready to resume running your Bifrost graph, just press CTRL + . again. (2) If you are only playing with parameter values and not changing graph connections or nodes, you can bypass the JIT-recompilation by exposing those parameters at the Attribute Editor/Channel Box level (in Maya). Do this by creating an input node at the top level of the graph and hooking up the parameters you want to play with to that input node. In the Maya Channel Box, those parameters will now appear, and you can play with those values without incurring a JIT-compile. Again, this issue will soon be resolved, but these are good workarounds for the time being.
For more information on Bifrost for Maya, read my announcement blog post.
Also, make sure to check out the new Bifrost community hub to access pre-built graphs, tutorials, and the latest news on Bifrost development, as well as the new Bifrost forum where you can ask questions and share your own knowledge about creating effects procedurally using Bifrost.