Wednesday, April 6, 2016

Sharing nodes in a team


When working in a larger group or company it can be useful to share nodes.
Not just share them, but also be able to share updates to shader networks more easily.

For example technical artists or programmers may want to make a set of shading nodes that artists can use that match with their game engine.

ShaderFX has this build into its group-nodes.

Here is an example of how to create your own custom shader nodes for your company and share them over the network with your team members.

With Maya closed, you can add a user variable to your system variables:

SHADERFX_CUSTOMGROUPPATH

\\autodesk.com/game_title_group_nodes/

With this set, the next time you start up Maya, it will now pull its custom group nodes from this network folder.

(Note that I believe we added this system environment variable somewhere in 2016, but I cannot remember what extension)


Now lets build a set of custom nodes.
We will use the Custom Code node, since it allows technical artists and programmers to enter their own code more quickly instead of using lots of complicated shader graphs.

Enable "Advanced Mode" in shaderfx.
Add a custom code node.
Customize its code by selecting it and pressing "Edit".
(Here we just input and output a color, but please see the Maya help for more details on the Custom Code node)


Select the node and use "Create Group"


Select the left node of the group
Supply Class, Category and Sub menu name for the group.
Press Group / Save Group

This will save the node into your network path you provided for SHADERFX_CUSTOMGROUPPATH



If all went well, it will now show the new group node in the right-click menu:


Add it to the scene and connect any inputs it needs.
Save your Maya scene and close Maya.


Re-open Maya (could even open it on a team-members machine)
Create the Group node you created.
Open it and make some changes to it.

NOTE: make sure you create a valid node. If you break the node, your original Maya scene will give a shading error.


Save the edited group.
Re-open the Maya scene you saved previously.

Notice that now the scene has been updated to use your new node.
(See the new input we added and the object is now purple)


3 comments:

  1. I noticed you are in Maya 2017 there - does this definitely work in 2016? I'm on the latest 2016 Ext 2 SP1, but can't get it to work.

    I also tried the "shaderfx -setUserPath" command, but this only works until you try to reload the file, when it gets reset and all the shaders with custom group nodes break.

    ReplyDelete
  2. Hi Andrew, you probably need the latest SP for Maya/LT.
    I think we are up to SP5 or 6.

    ReplyDelete
  3. I had 2016 SP6 but couldn't get the env working, so then I tried Extension 2 - 2016.5 SP1 - which I think is the very latest version, but still no luck.

    Anyway, the solution I came up with was to use the "mklink" dos command to map our shared group node location to the default C:\ documents location.

    ReplyDelete