Go to: Synopsis. Return value. Related. Flags. Python examples.
vnnCompound(
string string
, [addBackdrop=string], [addIONode=boolean], [addMetaData=[string, string]], [addNode=string], [addStatePorts=[string, string, string]], [canResetToFactory=string], [clearMetaData=string], [connectTo=string], [connected=boolean], [connectedTo=string], [connectedToInput=boolean], [connectedToOutput=boolean], [create=string], [createInputPort=[string, string]], [createOutputPort=[string, string]], [deletePort=string], [explode=string], [hidePort=[string, boolean]], [inputPort=boolean], [listNodes=boolean], [listPortChildren=string], [listPorts=boolean], [moveAnnotationIn=string], [moveNodeIn=string], [movePort=[string, int]], [movePortToIONode=[string, string]], [nodeType=string], [outputPort=boolean], [portFlags=uint], [portOptions=string[]], [portValues=string], [publish=[string, string, string, boolean]], [publishGraph=[string, string, string, string]], [queryAnnotationMetaDataValue=[string, string]], [queryIsImported=boolean], [queryIsReferenced=boolean], [queryMetaData=string], [queryMetaDataAsString=boolean], [queryMetaDatas=boolean], [queryPortDataType=string], [queryPortDefaultValues=string], [queryPortMetaDataValue=[string, string]], [removeAnnotation=string], [removeMetaData=[string, string]], [removeNode=string], [renameAnnotation=[string, string]], [renameNode=[string, string]], [renamePort=[string, string]], [resetPortDefaultValues=string], [resetToFactory=string], [saveAs=string], [setAnnotationMetaDataValue=[string, string, string]], [setIsReferenced=boolean], [setMetaData=[string, string[]]], [setMetaDataFromString=string], [setPortDataType=[string, string]], [setPortDefaultValues=[string, string[]]], [setPortMetaDataValue=[string, string, string]], [specializedTypeName=boolean])
Note: Strings representing object names and arguments must be separated by commas. This is not depicted in the synopsis.
vnnCompound is undoable, NOT queryable, and NOT editable.
The vnnCompound command is used to operate compound and its VNN graph.
The first parameter is the full name of the DG node that contains the VNN graph.
The second parameter is the name of the compound.
string | The result of the operation |
vnn, vnnConnect
addBackdrop, addIONode, addMetaData, addNode, addStatePorts, canResetToFactory, clearMetaData, connectTo, connected, connectedTo, connectedToInput, connectedToOutput, create, createInputPort, createOutputPort, deletePort, explode, hidePort, inputPort, listNodes, listPortChildren, listPorts, moveAnnotationIn, moveNodeIn, movePort, movePortToIONode, nodeType, outputPort, portFlags, portOptions, portValues, publish, publishGraph, queryAnnotationMetaDataValue, queryIsImported, queryIsReferenced, queryMetaData, queryMetaDataAsString, queryMetaDatas, queryPortDataType, queryPortDefaultValues, queryPortMetaDataValue, removeAnnotation, removeMetaData, removeNode, renameAnnotation, renameNode, renamePort, resetPortDefaultValues, resetToFactory, saveAs, setAnnotationMetaDataValue, setIsReferenced, setMetaData, setMetaDataFromString, setPortDataType, setPortDefaultValues, setPortMetaDataValue, specializedTypeName
Long name (short name) |
Argument types |
Properties |
|
addBackdrop(ab)
|
string
|

|
|
Add a backdrop into the compound.
|
|
addIONode(aio)
|
boolean
|

|
|
Add an input or an output node into the compound.
|
|
addMetaData(amd)
|
[string, string]
|
|
|
Add a value to a metatada.
The arguments are, in order, metadata name, metadata value to be added.
|
|
addNode(an)
|
string
|

|
|
Add a node into the compound.
|
|
addStatePorts(asp)
|
[string, string, string]
|
|
|
Add new input and output ports, linked together.
The arguments are, in order, the input port name, the output port name
and the data type to assign to both ports.
|
|
canResetToFactory(crf)
|
string
|
|
|
This is not currently implemented by Bifrost.
Query if the specified compound can be reset to its initial status.
|
|
clearMetaData(cmd)
|
string
|
|
|
Remove all the values of a metatada.
The argument is the metadata name.
|
|
connectTo(cot)
|
string
|
|
|
Used with addNode and addIONode, use to connect - when possible,
the newly created node to the given upstream node.
|
|
connected(cn)
|
boolean
|
|
|
Used with "listNodes" or "listPorts" to query the nodes
or internal ports that have connections when the argument is true.
If the arguments is false, return all nodes which
have no connection. The other side of the connection could be
another node or port.
|
|
connectedTo(ct)
|
string
|

|
|
Used with "listNodes" to query all nodes that
connect to the specified ports.
|
|
connectedToInput(cti)
|
boolean
|
|
|
Used with "listNodes" to query all nodes which
connect to any input ports.
|
|
connectedToOutput(cto)
|
boolean
|
|
|
Used with "listNodes" to query all nodes that
connect to any output ports.
|
|
create(c)
|
string
|
|
|
Create a sub compound in the specified compound.
The name of the created sub compound cannot be
used before in the specified compound.
|
|
createInputPort(cip)
|
[string, string]
|

|
|
Create an input port in the compound. The first
argument is the name of the port. The second argument
is the data type of the port.
|
|
createOutputPort(cop)
|
[string, string]
|

|
|
Create an output port in the compound. The first
argument is the name of the port. The second argument is the
data type of the port.
|
|
deletePort(dp)
|
string
|

|
|
Delete a input or output port from the compound.
|
|
explode(ec)
|
string
|

|
|
Explode a specified compound and move the nodes from it to its parent.
|
|
hidePort(hp)
|
[string, boolean]
|
|
|
Not implemented by Bifrost.
Hide or display an input port of a compound
|
|
inputPort(ip)
|
boolean
|
|
|
Used with "listPorts" to query all internal ports which
connect to any input ports in the compound.
|
|
listNodes(ln)
|
boolean
|
|
|
List all nodes in the compound. Can be used with
other flags, such as "dataType", "connectedToInput" to
query some specified nodes. The returned result is
a list of node names.
|
|
listPortChildren(lpc)
|
string
|
|
|
List the children of specified port.
|
|
listPorts(lp)
|
boolean
|
|
|
List all internal ports in the compound, including
input and output ports.
Can be used with flags "inputPort", "outputPort" and
"connected" to narrow the query.
|
|
moveAnnotationIn(mai)
|
string
|

|
|
When creating a new compound, use this argument once for every annotation to move into the new compound
|
|
moveNodeIn(mi)
|
string
|

|
|
When creating a new compound, use this argument once for every node to move into the new compound
|
|
movePort(mp)
|
[string, int]
|
|
|
Move a port to the specified index in the compound
|
|
movePortToIONode(mpn)
|
[string, string]
|
|
|
Move a port to another i/o node of the compound
|
|
nodeType(nt)
|
string
|
|
|
Used with "listNodes" to query all nodes which are
specified node type in the compound.
|
|
outputPort(op)
|
boolean
|
|
|
Used with "listPorts" to query all nodes which
connect to any output ports in the compound.
|
|
portFlags(cpf)
|
uint
|
|
|
Used with "createInputPort" or "createOutputPort" to specify
the flags on the port. See vnnPort command.
|
|
portOptions(cpo)
|
string[]
|
|
|
Used with "createInputPort" or "createOutputPort" to specify
a list of options on the created port.
|
|
portValues(cpv)
|
string
|
|
|
Used with "createInputPort" or "createOutputPort" to specify the default value of a new port
|
|
publish(pub)
|
[string, string, string, boolean]
|
|
|
Used to publish the compound.
The arguments are, in order, the file path where to save,
the namespace where to store the compound, the name to use for
the nodedef, and a boolean to indicate whether the compound is
overloadable or not.
|
|
publishGraph(pbg)
|
[string, string, string, string]
|
|
|
Used to publish the compound as a graph.
The arguments are, in order, the file path where to save,
the namespace where to store the compound, the name to use for
the nodedef, and a string containing a json property list which
will contain the metadata to be associated with the graph.
The json property list must be a simple set of key value pairs enclosed in
curly braces.
|
|
queryAnnotationMetaDataValue(qam)
|
[string, string]
|
|
|
Query the metadata value of a specified annotation.
The first argument is the annotation to query, the second is the type of metadata to query.
|
|
queryIsImported(qii)
|
boolean
|
|
|
Query if the compound is imported.
|
|
queryIsReferenced(qir)
|
boolean
|
|
|
Query if the compound is referenced.
|
|
queryMetaData(qmd)
|
string
|
|
|
Query the value(s) of a metadata.
|
|
queryMetaDataAsString(mas)
|
boolean
|
|
|
Gets all metadata as a string. The format is documented with the setMetaDataFromString flag
|
|
queryMetaDatas(qms)
|
boolean
|
|
|
Query all the available metadatas.
|
|
queryPortDataType(qpt)
|
string
|
|
|
Query the data type of a specified port.
This is normally used with the vnnNode command, even when the node is a compounds.
When used with the vnnCompound command, the ports modified are the internal ones.
|
|
queryPortDefaultValues(qpv)
|
string
|
|
|
Get the default value of a port when it is not connected. For ports with scalar
data types (e.g., float or string), this will return a single string value. For
ports with structure data types (e.g., a vector or matrix of floats like float3
or float3x3), this will return an array of string values.
This command is typically used with the vnnNode command, even when the node is a
compound. When used with the vnnCompound command, it applies to the internal
ports.
|
|
queryPortMetaDataValue(qpm)
|
[string, string]
|
|
|
Query the metadata value of a specified port.
The first argument is the port to query, the second is the type of metadata
to query.
This is normally used with the vnnNode command, even when the node is a compounds.
When used with the vnnCompound command, the ports modified are the internal ones.
|
|
removeAnnotation(rma)
|
string
|

|
|
Remove the specified annotation from the compound.
|
|
removeMetaData(rmd)
|
[string, string]
|
|
|
Remove a value from a metatada.
The arguments are, in order, metadata name, metadata value to be removed.
|
|
removeNode(rmn)
|
string
|

|
|
Remove the specified node from the compound.
|
|
renameAnnotation(ra)
|
[string, string]
|

|
|
Rename an annotation in the compound. The first argument
is the old name of the annotation. The second argument is
the new name.
|
|
renameNode(rn)
|
[string, string]
|

|
|
Rename a node in the compound. The first argument
is the old name of the node. The second argument is
the new name.
|
|
renamePort(rp)
|
[string, string]
|

|
|
Rename a port of the compound. The first argument
is the old name of the port. The second argument is
the new name.
|
|
resetPortDefaultValues(rpv)
|
string
|
|
|
Not currently implemented by Bifrost.
Resets the default value(s) of a compound port
The port cannot be connected.
The argument is the port name.
This is normally used with the vnnNode command, even when the node is a compounds.
When used with the vnnCompound command, the ports modified are the internal ones.
|
|
resetToFactory(rtf)
|
string
|

|
|
This is not currently implemented by Bifrost.
Reset the specified compound to its initial status.
The specified compound must be able to be reset.
|
|
saveAs(sa)
|
string
|
|
|
Used to export Compound as a file.
For Bifrost, the argument is the directory to save where json will be saved.
|
|
setAnnotationMetaDataValue(sam)
|
[string, string, string]
|
|
|
Set the metadata value of a specified compound annotation. The arguments are, in order,
annotation name, metadata name, metadata value to be set.
|
|
setIsReferenced(sir)
|
boolean
|
|
|
Change the referenced status of the compound.
If -sir/setIsReferenced is true, the compound will be made public,
else the compound will be made private to its parent compound.
|
|
setMetaData(smd)
|
[string, string[]]
|
|
|
Set the value of a metatada.
The arguments are, in order, metadata name, metadata values to be set.
|
|
setMetaDataFromString(mfs)
|
string
|
|
|
Set metadata using a string. This allows creating hierarchies of metadata.
The values of keys that already exist will be replaced with the new values.
The format is key=values separated by semi-colons, and braces
to define a sub-list of key/value pairs. Quotes are optional, but strings
using spaces or separators must be quoted. Quotes and backslashes can be escaped
with a backslash. Python-style single quotes are not accepted.
Example of format:
"house=red;car="blue and green"
"house=red,blue,yellow;hat={color=yellow;height="high"};cake={flavor="choco";topping="plenty"}
|
|
setPortDataType(spt)
|
[string, string]
|
|
|
Set the data type of a specified compound port.
This is normally used with the vnnNode command, even when the node is a compounds.
When used with the vnnCompound command, the ports modified are the internal ones.
|
|
setPortDefaultValues(spv)
|
[string, string[]]
|
|
|
Set the value of a port when it is not connected. The arguments are the port
name and the corresponding value(s). The value argument is an array of strings
that must contain the correct number of elements based on the data type of the
port (e.g., three elements for a float3 data type). For scalar data types (e.g.,
float or string), a single string value can be used.
This command is typically used with the vnnNode command, even when the node is a
compound. When used with the vnnCompound command, the ports that are modified
are the internal ones.
|
|
setPortMetaDataValue(spm)
|
[string, string, string]
|
|
|
Set the metadata value of a specified compound port. The arguments are, in order,
port name, metadata name, metadata value to be set.
This is normally used with the vnnNode command, even when the node is a compounds.
When used with the vnnCompound command, it refers to the internal ports.
|
|
specializedTypeName(stn)
|
boolean
|
|
|
Used to query the specialized implementation class names
such as "Bifrost_DoWhile", or "Compound" for a normal compound
|
|
Flag can appear in Create mode of command
|
Flag can appear in Edit mode of command
|
Flag can appear in Query mode of command
|
Flag can have multiple arguments, passed either as a tuple or a list.
|
import maya.cmds as cmds
import maya.mel as mel
cmds.file(f=1, new=1)
mel.eval("createNewBifrostGraphCmd()")
cmds.vnnCompound("bifrostGraphShape1", "/", create="MyCompound")
# Create a sub-compound in the graph
cmds.vnnCompound("bifrostGraphShape1", "/MyCompound", create="subCompound")
# Create an output port in the compound
cmds.vnnCompound("bifrostGraphShape1", "/MyCompound", createOutputPort=["newOutput", "float"])
# Create an input port in the compound
cmds.vnnCompound("bifrostGraphShape1", "/MyCompound", createInputPort=["input1", "float"])
# Rename a port
cmds.vnnCompound("bifrostGraphShape1", "/MyCompound", renamePort=["newOutput", "outputValue"])
# Move a port
cmds.vnnCompound("bifrostGraphShape1", "/MyCompound", createInputPort=["input0", "float"])
cmds.vnnCompound("bifrostGraphShape1", "/MyCompound", movePort=["input0", 0])
# set the default value of specified port for an integer data type
# use the vnnNode command for this, not vnnCompound
cmds.vnnNode("bifrostGraphShape1", "/MyCompound", setPortDefaultValues=["input1", "18"])
# set the type of a internal port of the compound
cmds.vnnCompound("bifrostGraphShape1", "/MyCompound", setPortDataType=["outputValue", "string"])
# query the data type of a specified port
cmds.vnnCompound("bifrostGraphShape1", "/MyCompound", queryPortDataType="outputValue")
# set the port default values for a float3 data type
cmds.vnnCompound("bifrostGraphShape1", "/MyCompound", createInputPort=["newInput2", "Math::float3"])
cmds.vnnNode("bifrostGraphShape1", "/MyCompound", setPortDefaultValues=["newInput2", "{1.5, 1.2, 1.3}'"])
# query the default value of specified port for an integer data type
cmds.vnnCompound("bifrostGraphShape1", "/MyCompound", queryPortDefaultValues="newInput")
# Result: 18 //
# query the default value of specified port for an float3 data type
cmds.vnnCompound("bifrostGraphShape1", "/MyCompound", queryPortDefaultValues="newInput2")
# Result: 1.5 1.2 1.3 //
# set metadata on an internal port
cmds.vnnCompound("bifrostGraphShape1", "/MyCompound", setPortMetaDataValue=["portName", "metaDataName", "value"])
# query metadata on an internal port
cmds.vnnCompound("bifrostGraphShape1", "/MyCompound", queryPortMetaDataValue=["portName", "metaDataName"])
# query the children of a specified internal port
cmds.vnnCompound("bifrostGraphShape1", "/MyCompound", listPortChildren="portName")
# Add a new node into VNN graph of the bifrost container
cmds.vnnCompound("bifrostGraphShape1", "/MyCompound", addNode="BifrostGraph,Core::Math,add")
# Add a new node in the bifrost container and connect it
cmds.vnnCompound("bifrostGraphShape1", "/MyCompound", addNode="BifrostGraph,Core::Math,add", connectTo="subCompound")
# Create a new input node
cmds.vnnCompound("bifrostGraphShape1", "/MyCompound", addIONode=True)
# Create a new output node
cmds.vnnCompound("bifrostGraphShape1", "/MyCompound", addIONode=False)
# Rename a node
cmds.vnnCompound("bifrostGraphShape1", "/MyCompound", renameNode=["add", "sum"])
# Remove a node
cmds.vnnCompound("bifrostGraphShape1", "/MyCompound", addNode="BifrostGraph,Core::Math,max")
cmds.vnnCompound("bifrostGraphShape1", "/MyCompound", removeNode="max")
# Create two state ports of type float
cmds.vnnCompound("bifrostGraphShape1", "/", addNode="BifrostGraph,Core::Iterators,do_while")
cmds.vnnCompound("bifrostGraphShape1", "/do_while", addStatePorts=["in_name", "out_name", "float"])
# Query the specialized type name
cmds.vnnCompound("bifrostGraphShape1", "/do_while", specializedTypeName=1)
# Query if the compound is referenced
cmds.vnnCompound("bifrostGraphShape1", "/MyCompound", queryIsReferenced=1)
# Query if the compound is imported
cmds.vnnCompound("bifrostGraphShape1", "/MyCompound", queryIsImported=1)
# Make the compound private
cmds.vnnCompound("bifrostGraphShape1", "/MyCompound", setIsReferenced=False)
# List all child nodes in the specified compound
cmds.vnnCompound("bifrostGraphShape1", "/MyCompound", listNodes=1)
# List the nodes in the specified compound which are of a specific type
cmds.vnnCompound("bifrostGraphShape1", "/MyCompound", listNodes=1, nodeType="Math")
# List all the nodes in the specified compound which have no connections
cmds.vnnCompound("bifrostGraphShape1", "/MyCompound", listNodes=1, connected=False)
# List nodes in the specified compound which are connected to the parent's internal input
cmds.vnnCompound("bifrostGraphShape1", "/MyCompound", listNodes=1, connectedToInput=1)
# List nodes in the specified compound which are connected to the parent's internal output
cmds.vnnCompound("bifrostGraphShape1", "/MyCompound", listNodes=1, connectedToOutput=1)
# List nodes in the specified compound which are connected to both the parent's internal input and output port
cmds.vnnCompound("bifrostGraphShape1", "/MyCompound", listNodes=1, connectedToInput=1, connectedToOutput=1)
# Query the name of the node that is connected to a specified port
# It could be either an input port or an output port
cmds.vnnCompound("bifrostGraphShape1", "/MyCompound", listNodes=1, connectedTo="Solid")
# Result: SetDescriptorFromObject1.value
# List the names of all compound's internal ports
cmds.vnnCompound("bifrostGraphShape1", "/MyCompound", listPorts=1)
# List the names of the compound's internal input ports
cmds.vnnCompound("bifrostGraphShape1", "/MyCompound", listPorts=1, inputPort=1)
# List the names of the compound's internal output ports
cmds.vnnCompound("bifrostGraphShape1", "/MyCompound", listPorts=1, outputPort=1)
# List all the compound's internal unconnected input and output port
cmds.vnnCompound("bifrostGraphShape1", "/MyCompound", listPorts=1, connected=False)
# List all the compound's internal connected input and output port
cmds.vnnCompound("bifrostGraphShape1", "/MyCompound", listPorts=1, connected=True)