TABLE OF CONTENTS

Graph

The pgYetiGraph command can be used to query and edit values within a graph. The command takes any number of arguments and the name of the Yeti node, for example:


pgYetiGraph -listNodes pgYetiMaya1Shape


will list all of the nodes within the graph. Or


pgYetiGraph -listNodes -type "scatter" pgYetiMaya1Shape


will limited the list to the node type specified.


Once you know what node you want to query you can specify it with the -node parameter and then query the parameter names:


pgYetiGraph -node "scatter01" -listParams pgYetiMaya1Shape


And now that you know what parameters there are for the node, you can used the -param argument to query the parameters value:


pgYetiGraph -node "scatter01" -param "density" -getParamValue pgYetiMaya1Shape


You can also connect two nodes with the -connect argument:


pgYetiGraph -node "scatter01" -connect "grow01" 0 pgYetiMaya1Shape


Will connect the output from scatter01 to the first input of grow01. You can also use the -disconnect argument to remove the connections:


pgYetiGraph -node "grow01" -disconnect 0 pgYetiMaya1Shape


Node Arguments


ArgumentDescription
-createCreates a node of the type defined by the -type argument.
-rename <string newname>Renames the node defined by -node to newname.
-listNodesLists all of the nodes in the graph.
-listParamsLists all of the parameters on the node in a graph, specified with the -node argument.
-typeIs used to specify the type of node to be created or listed.
-node <string nodename>Used to specify which node you want to query.
-nodeTypeReturn the type of the node specified by the -node argument.
-deleteWill delete the node specified by the -node argument.
-setRootNode <string node>Sets node to be the root node of the graph.
-getRootNodeReturns the current root node name.


Node Input/Output Querying


ArgumentDescription
-inputNodeNamewhen specifying a node with -node, will return the name of the node whose output is connected to the node's specified input port.
-outputNodeCountwhen specifying a node with -node, will return the number of outgoing connections from that node's output port.
-outputNodeName <int>when specifying a node with -node, will return the name of the node connected to the ith connection from the node's output port (where 0 <= i < outputNodeCount)
-outputNodeInput <int>same as above, but returns the input port number on the target node

Parameter Arguments

For many of these arguments you will need to specify the -node argument along with the -param argument to select the parameter to query.


ArgumentDescription
-param <string param>Used to specify which parameter you want to query.
-paramNiceNameReturn the name for the parameter used by Yetis UI.
-paramTypeReturn the data type of the parameter.
-getParamValueReturn the value of the parameter, it will be cast to the required data type.
-setParamValueBoolean <bool>Set the specified parameters value if it’s a boolean data type.
-setParamValueScalar <scalar>Set the specified parameters value if it’s a int or float data type.
-setParamValueVector <vector>Set the specified parameters value if it’s a vector, point or color data type.
-setParamValueString <string>Set the specified parameters value if it’s a string data type.
-setParamValueExpr <string>Set the specified parameters value to the passed expression.
-isParamConstantReturns whether or not the value of the parameter is a variable expression or not.


Graph Flow Arguments


ArgumentDescription
-connect <string node> <input>Will connect the output from the node specified with -node to the node/input specified by -connect.
-disconnect <input>Will disconnect the input of the node specified with -node.


Sampler Attachments


ArgumentDescription
-getParamSourceNodeWhen specifying a param with -param, will return the name of the sampler node that is attached to it.
-getParamSourceOutputWhen specifying a param with -param, will return the output number of the sampler node that is attached to it.
-setParamSource <string> <int>When specifying a param with -param, will attach the parameter to the given sampler node and output number.
-clearParamSourcewhen specifying a param with -param, will clear any attachment to samplers that exists for the parameter.


Sampler Output Querying


ArgumentDescription
-outputParamCountwhen specifying a sampler node with -node, will return the number of outgoing connections from that node's specified output port.
-outputParamNode <int>when specifiying a sampler node with -node, will return the name of the node connected to the ith connection from the node's specified output port (where 0 <= i < outputParamCount)
-outputParamName <int>same as above, but returns the name of the parameter the connection is attached to


Graph Editor Selections


ArgumentDescription
-select <string>add the specified node to the selection in the active graph editor. node may be a comma-delimited (no spaces) list of node names.
-deselect <string>remove the specified node to the selection in the active graph editor. node may be a comma-delimited (no spaces) list of node names.
-clearSelectionclear the selection in the active graph editor.
-getSelectionreturn the names of the selected nodes in the active graph editor.


Caching

You can use pgYetiCommand to cache out a select Yeti node using the -writeCache parameter which requires the full pathname as a string, frame padding should be specified using standard C notation ( ie. %04d for 4 digit padding ). Used on it’s own -writeCache will only generate a cache for the current frame, to write a range of caches the -range parameter should be used with a start and end frame. By default Yeti writes 3 samples for each frame, in most cases this should be sufficient but in cases where fast moving characters are the basis for the fur generation sometimes higher samples ( up to 7 ) can be used.


If multiple Yeti nodes are selected (or passed as parameters) they will all be cached concurrently, to allow Yeti to save the cache data to node specific files the <NAME> tag can be used.  For example: 

pgYetiCommand -writeCache “/myCacheDir/furryMonster_<NAME>.%04d.fur” -range 1 20


will output cache files named furryMonster_furryMosterShape.0001.fur for the first frame if furryMonsterShape was the provided node name.


ArgumentDescription
-writeCache <string fileName>This tells Yeti you want to write a cache to the specified file name.
-range <int start> <int end>The frame range to export.
-samples <int numberOfSamples>The number of samples to be used for each frame, this is centered around the frame eg. 3 samples will write 2.5, 3.0 and 3.5 if the current frame was 3.
-sampleTimes <string sampleTimes>A string that represents a list of sample times for each frame separated by a space, these are frame offsets. eg. “-0.3 0.0 0.3” will write 2.7, 3.0 and 3.3 to the cache for frame 3.
-updateViewport <boolean>Toggle whether the 3d viewport updates while exporting.
-generatePreview <boolean>Toggle whether a preview is generated in the cache files.
-storeBoundingBox <boolean>store the bounding box of the viewport preview in the exported cache file.


As an example, if you wanted to cache out all the fur from frame 1-100 with 5 motion samples per frame you could used


pgYetiCommand -writeCache "/base/vfx/tmp/myCache.%04d.fur" -range 1 100 -samples 5


Alembic Export

As with caching, you can use the -writeAlembic pgYetiCommand parameter to export the selected Yeti node as an Alembic file. This requires the full pathname as a string, by default all frames and samples are written to a single file unless the -filePerFrame option is used in which case frame padding should be specified using standard C notation ( ie. %04d for 4 digit padding ).


The -range parameter should be used with a start and end frame and by default Yeti writes 3 samples for each frame, in most cases this should be sufficient but in cases where fast moving characters are the basis for the fur generation sometimes higher samples ( up to 7 ) can be used.


By default Yeti will use the current display density, length and width values for the exported data set unless overridden with the -alembicDensity, -alembicLength and -alembicWidth parameters.


If multiple Yeti nodes are selected (or passed as parameters) they will all be cached concurrently, to allow Yeti to save the cache data to node specific files the <NAME> tag can be used. For example: 

pgYetiCommand -writeAlembic “/myCacheDir/furryMonster_<NAME>.abc” -range 1 20


will output Alembic files named furryMonster_furryMosterShape.abc if furryMonsterShape was the provided node name.


ArgumentDescription
-writeAlembic <string fileName>The name of the Alembic file.
-range <int start> <int end>The frame range to export.
-samples <int numberOfSamples>The number of samples to be used for each frame, this is centered around the frame eg. 3 samples will write 2.5, 3.0 and 3.5 if the current frame was 3.
-sampleTimes <string sampleTimes>A string that represents a list of sample times for each frame separated by a space, these are frame offsets. eg. “-0.3 0.0 0.3” will write 2.7, 3.0 and 3.3 to the cache for frame 3.
-updateViewport <boolean>Toggle whether the 3d viewport updates while exporting.
-filePerFrame <bool>Export an Alembic file per frame vs. the whole range in a single file.
-alembicDensity <float value>The density used when evaluating the nodes graph.
-alembicLength <float value>The length used when evaluating the nodes graph.
-alembicWidth <float value>The width used when evaluating the nodes graph.
-asUnrealAbcThe exported Abc file will conform to the Unreal Alembic for Grooms spec.


As an example, if you wanted to cache out all the fur from frame 1-100 with 5 motion samples and a file per frame you could used


pgYetiCommand -writeAlembic "/base/vfx/tmp/myHair.%04d.abc" -range 1 100 -samples 5 -filePerFrame


OBJ Export

pgYetiCommand can also be used with the -objExport to export polygonal geometry from the currently selected Yeti node. This will ignore any fibres and is generally meant to bake out instancing.


pgYetiCommand -objExport [density (float)] [filename (string)] [do_texture_coordinates (bool)] [do_normals (bool)]


pgYetiCommand -objExport 1 "/base/vfx/tmp/myInstances.obj" true true


Epic Unreal Engine Hair/Fur Alembic Export

Yeti can export Alembic files that conform to Epic’s Unreal Engine hair/fur spec for assets to be imported for realtime use. This will use the current Display density so the exported asset will match what is visible in the Maya viewport.


pgYetiCommand -exportUnrealAbc [filename (string)]


Generating Maya Objects

In some instances you may want to generate Maya representations of the objects created by Yeti - to do this you can select the node and either use the “Convert to Maya Objects” option in the Yeti menu or run:


pgYetiCommand -generateMayaObjects


Yeti Node

pgYetiCreate() is used to create a new Yeti node in the Maya scene.


pgYetiCreateOnMesh() can be used to expedite the process of adding an initial input object, make sure a mesh has been selected prior to using the command.


pgYetiAddGroom( string $groom, string $pgYetiMayaNode ) will add the groom $groom as an input to $pgYetiMayaNode.


pgYetiRemoveGroom( string $groom, string $pgYetiMayaNode ) will remove the groom $groom as an input to $pgYetiMayaNode.


pgYetiAddGeometry( string $object, string $pgYetiMayaNode ) will add the geometry $object as an input to $pgYetiMayaNode.


pgYetiRemoveGeometry( string $object, string $pgYetiMayaNode ) will remove the geometry $object as an input to $pgYetiMayaNode.


pgYetiAddGuideSet( string $set, string $pgYetiMayaNode ) will add the maya set, containing guide curves, $set as an input to $pgYetiMayaNode.


pgYetiRemoveGuideSet( string $set, string $pgYetiMayaNode ) will remove the maya set $set as an input to $pgYetiMayaNode.


pgYetiRemoveAllConnections( string $pgYetiMayaNode ) will remove any and all connections on the Yeti node.


pgYetiForceUpdate( string $pgYetiMayaNode ) forces the specified node to re-evaluate it’s graph.


Groom Node

pgYetiCreateGroomOnMesh() creates a new Groom node on a selected mesh object.


pgYetiAddCollisionGeometry( string $object, string $pgYetiMayaGroomNode ) will add the geometry $object to $pgYetiMayaGroomNode’s list of collision geometry.


pgYetiRemoveCollisionGeometry( string $object, string $pgYetiMayaGroomNode ) will remove the geometry $object to $pgYetiMayaGroomNodes’s list of collision geometry.


pgYetiAddField( string $field, string $pgYetiMayaGroomNode ) attaches $field to $pgYetiMayaGroomNode to affect dynamic simulation.


pgYetiRemoveField( string $field, string $pgYetiMayaGroomNode ) detaches $field from $pgYetiMayaGroomNode.


pgYetiCommand -removeDuplicates <distance> is used to remove duplicate strands within the distance threshold.


pgYetiCommand -strandCount will return the number of strands in a Groom.


Utilities

pgYetiConvertGuideSetToGroom( string $guide_set, string $mesh_object, float $stepSize ) is used to convert a guide curve set into a Yeti Groom node for combing, $guide_set is the set that you want to convert and $mesh_object is the object the guides are to be growing from. Step size should be 0.1 by default, but other values may be passed to refine the detail of the output strands.


pgYetiImportGroomFileFromNode( string $pgYetiMayaNode ) will rebuild a graph and groom nodes stored in a GRM file currently referenced by $pgYetiMayaNode.


pgYetiExtractGroomFromNode( string $in_groom, string $yetiNode, string $postFix ) is used to extract and rebuild a single groom stored in a GRM or cache file currently referenced by $pgYetiMayaNode.


pgYetiSwapGeometry( string $originalGeometry, string $newGeometry ) is a utility to swap all the Yeti connections on one mesh to another, possibly a when a model updates.


pgYetiCommaned -currentHash will return the current hash value for the selected Yeti node.


License Utilities

pgYetiCommand -licenseAvailable returns true ( 1 ) if a license is available and/or if the license is already successfully checked out.


pgYetiCommand -numberOfLicensesAvailable returns the number of available licenses as reported by the license server.


pgYetiCommand -returnLicense can be used to forcibly return the Yeti license checked out by the current user.


pgYetiCommand -licenseStatus or -batchLicenseStatus with return true/false if you are currently using a license.


Rendering

Yeti has a separate render command that is used by a few of the different rendering integration tools ( it conforms to what 3delight needs and is used by RMS ) to provide a means of sampling the scene as well as saving a cache. Below are the commands that are supported that may be of interest to others building integration tools.


pgYetiRenderCommand -addStep -sampleTime <time> -frame <frame> $yeti_shape_node is used to add a sample for the specified Yeti node. <sampleTime> is the current time and <frame> is the whole frame number.


pgYetiRenderCommand -list returns a list of Yeti shape nodes currently in a state of being sampled.


pgYetiRenderCommand -flush flushes all of the stores cached data for previously cached nodes, this should be done before you start and after you’ve written a cache to disk.


pgYetiRenderCommand -remove $yeti_shape_node will remove all off the stored samples/data for the specified shape node, this is similar to flush except on a per shape basis.


pgYetiRenderCommand -contains $yeti_shape_node returns true if the specified shape node has data to be written to disk/emitted.


pgYetiRenderCommand -preRenderCache -fileName <file> $yeti_shape_node can be used to save and/or query the file name used for rendering the current node with a result being the filename resolved. The -fileName parameter is optional, if specified this will override any temporary or cache file name.


pgYetiRenderCommand -emit $yeti_shape_name will stored the cache samples to disk and emit the Renderman calls to include the shape and Yeti node in the Rib files.