Go to: Synopsis. Return value. Related. Flags. Python examples.

Synopsis

vnnCompound( string string , [addNode=string], [addStatePortUI=boolean], [canResetToFactory=string], [connected=boolean], [connectedTo=string], [connectedToInput=boolean], [connectedToOutput=boolean], [create=string], [createInputPort=[string, string]], [createOutputPort=[string, string]], [deletePort=string], [explode=string], [inputPort=boolean], [listNodes=boolean], [listPortChildren=string], [listPorts=boolean], [moveNodeIn=string], [movePort=[string, int]], [nodeType=string], [outputPort=boolean], [queryIsReferenced=boolean], [queryMetaData=string], [queryPortDataType=string], [queryPortMetaDataValue=[string, string]], [removeNode=string], [renameNode=[string, string]], [renamePort=[string, string]], [resetToFactory=string], [saveAs=string], [setIsReferenced=boolean], [setMetaData=[string, string]], [setPortDataType=[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.

Return value

stringThe result of the operation

Related

vnn, vnnConnect

Flags

addNode, addStatePortUI, canResetToFactory, connected, connectedTo, connectedToInput, connectedToOutput, create, createInputPort, createOutputPort, deletePort, explode, inputPort, listNodes, listPortChildren, listPorts, moveNodeIn, movePort, nodeType, outputPort, queryIsReferenced, queryMetaData, queryPortDataType, queryPortMetaDataValue, removeNode, renameNode, renamePort, resetToFactory, saveAs, setIsReferenced, setMetaData, setPortDataType, setPortMetaDataValue, specializedTypeName
Long name (short name) Argument types Properties
addNode(an) string createmultiuse
Add a node into the compound.
addStatePortUI(spu) boolean create
Pop up a window to add iteration state port.
canResetToFactory(crf) string create
Query if the specified compound can be reset to its initial status.
connected(cn) boolean create
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 createmultiuse
Used with "listNodes" to query all nodes that connect to the specified ports.
connectedToInput(cti) boolean create
Used with "listNodes" to query all nodes which connect to any input ports.
connectedToOutput(cto) boolean create
Used with "listNodes" to query all nodes that connect to any output ports.
create(c) string create
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] createmultiuse
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] createmultiuse
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 createmultiuse
Delete a input or output port from the compound.
explode(ec) string createmultiuse
Explode a specified compound and move the nodes from it to its parent.
inputPort(ip) boolean create
Used with "listPorts" to query all internal ports which connect to any input ports in the compound.
listNodes(ln) boolean create
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 create
List the children of specified port.
listPorts(lp) boolean create
List all internal ports in the compound, including input and output ports. Can be used with other flags, such as "output", "connected" to query some specified ports.
moveNodeIn(mi) string createmultiuse
Move the specified node into the compound.
movePort(mp) [string, int] create
Move a port to the specified index in the compound
nodeType(nt) string create
Used with "listNodes" to query all nodes which are specified node type in the compound.
outputPort(op) boolean create
Used with "listPorts" to query all nodes which connect to any output ports in the compound.
queryIsReferenced(qir) boolean create
Query if the compound is referenced.
queryMetaData(qmd) string create
Query the value(s) of a metadata.
queryPortDataType(qpt) string create
Query the data type of a specified port.
queryPortMetaDataValue(qpm) [string, string] create
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.
removeNode(rmn) string createmultiuse
Remove the specified node from the compound.
renameNode(rn) [string, string] createmultiuse
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] createmultiuse
Rename a port of the compound. The first argument is the old name of the port. The second argument is the new name.
resetToFactory(rtf) string createmultiuse
Reset the specified compound to its initial status. The specified compound must be able to be reset.
saveAs(sa) string create
Used to export Compound in the Compound menu of the Node Editor. The argument is the file path to save.
setIsReferenced(sir) boolean create
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] create
Set the value of a metatada. The arguments are, in order, metadata name, metadata value to be set.
setPortDataType(spt) [string, string] create
Set the data type of a specified compound port.
setPortMetaDataValue(spm) [string, string, string] create
Set the metadata value of a specified compound port. The arguments are, in order, port name, metadata name, metadata value to be set.
specializedTypeName(stn) boolean create
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.

Python examples

import maya.cmds as cmds

# create a bifrost liquid node
# to operate VNN graph of the bifrost container
import maya.cmds as cmds
cmds.file(f=True, new=True)
cmds.polyPlane()
cmds.CreateBifrostLiquid()
# please open bifrost liquid container in node editor

# Create a sub-compound in the graph
cmds.vnnCompound("|bifrostLiquid1|bifrostLiquidContainer1", "liquid", create="subCompound")

# Explode a sub-compound
cmds.vnnCompound("|bifrostLiquid1|bifrostLiquidContainer1", "liquid", explode="subCompound")

# Create an output port in the compound
cmds.vnnCompound("|bifrostLiquid1|bifrostLiquidContainer1", "liquid", createOutputPort=["newOutput","Bifrost::Types::ObjectDescriptor"])

# Create an input port in the compound
cmds.vnnCompound("|bifrostLiquid1|bifrostLiquidContainer1", "liquid", createInputPort=["newInput","Bifrost::Types::ObjectDescriptor"])

# Rename a port
cmds.vnnCompound("|bifrostLiquid1|bifrostLiquidContainer1", "liquid", renamePort=["newOutput","outputValue"])

# Move a port
cmds.vnnCompound("|bifrostLiquid1|bifrostLiquidContainer1", "liquid", movePort=["newInput", 0])

# Delete a port
cmds.vnnCompound("|bifrostLiquid1|bifrostLiquidContainer1", "liquid", deletePort="newInput")

# set the type of a internal port of the compound
cmds.vnnCompound("|bifrostLiquid1|bifrostLiquidContainer1", "liquid", setPortDataType=["outputValue","string"])

# query the data type of a specified port
cmds.vnnCompound("|bifrostLiquid1|bifrostLiquidContainer1", "liquid", queryPortDataType="outputValue")

# set the state value of specified port
cmds.vnnCompound("|bifrostLiquid1|bifrostLiquidContainer1", "liquid", setPortMetaDataValue=["portName","metaDataName","value"])

# query the current state value of specified port
cmds.vnnCompound("|bifrostLiquid1|bifrostLiquidContainer1", "liquid", queryPortMetaDataValue=["portName","metaDataName"])

# query the children of a specified port
cmds.vnnCompound("|bifrostLiquid1|bifrostLiquidContainer1", "liquid", listPortChildren="portName")

# Add a new node into VNN graph of the bifrost container
cmds.vnnCompound("|bifrostLiquid1|bifrostLiquidContainer1", "liquid", addNode="Bifrost,Bifrost::Nodes::Math,add")

# Rename a node
cmds.vnnCompound("|bifrostLiquid1|bifrostLiquidContainer1", "liquid", renameNode=["add","plus"])

# Remove the node
cmds.vnnCompound("|bifrostLiquid1|bifrostLiquidContainer1", "liquid", removeNode="plus")

# Pop up a window to add input or output port and set their data type
cmds.vnnCompound("|bifrostLiquid1|bifrostLiquidContainer1", "liquid", addStatePortUI=True)

# Query the specialized type name
cmds.vnnCompound("|bifrostLiquid1|bifrostLiquidContainer1", "liquid", specializedTypeName=True)

# Query if the compound is referenced
cmds.vnnCompound("|bifrostLiquid1|bifrostLiquidContainer1", "liquid", queryIsReferenced=True)

# Make the compound private
cmds.vnnCompound("|bifrostLiquid1|bifrostLiquidContainer1", "liquid", setIsReferenced=False)

# List all child nodes in the specified compound
cmds.vnnCompound("|bifrostLiquid1|bifrostLiquidContainer1", "liquid", listNodes=True)

# List the nodes in the specified compound which are of a specific type
cmds.vnnCompound("|bifrostLiquid1|bifrostLiquidContainer1", "liquid", listNodes=True, nodeType="Math")

# List all the nodes in the specified compound which have no connections
cmds.vnnCompound("|bifrostLiquid1|bifrostLiquidContainer1", "liquid", listNodes=True, connected=False)

# List nodes in the specified compound which are connected to the parent's internal input
cmds.vnnCompound("|bifrostLiquid1|bifrostLiquidContainer1", "liquid", listNodes=True, connectedToInput=True)

# List nodes in the specified compound which are connected to the parent's internal output
cmds.vnnCompound("|bifrostLiquid1|bifrostLiquidContainer1", "liquid", listNodes=True, connectedToOutput=True)

# List nodes in the specified compound which are connected to both the parent's internal input and output port
cmds.vnnCompound("|bifrostLiquid1|bifrostLiquidContainer1", "liquid", listNodes=True, connectedToInput=True, connectedToOutput=True)

# 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("|bifrostLiquid1|bifrostLiquidContainer1", "liquid", listNodes=True, connectedTo="Solid")
# Result: SetDescriptorFromObject1.value #

# List the names of all compound's internal ports
cmds.vnnCompound("|bifrostLiquid1|bifrostLiquidContainer1", "liquid", listPorts=True)

# List the names of the compound's internal input ports
cmds.vnnCompound("|bifrostLiquid1|bifrostLiquidContainer1", "liquid", listPorts=True, inputPort=True)

# List the names of the compound's internal output ports
cmds.vnnCompound("|bifrostLiquid1|bifrostLiquidContainer1", "liquid", listPorts=True, outputPort=True)

# List all the compound's internal unconnected input and output port
cmds.vnnCompound("|bifrostLiquid1|bifrostLiquidContainer1", "liquid", listPorts=True, connected=False)

# List all the compound's internal connected input and output port
cmds.vnnCompound("|bifrostLiquid1|bifrostLiquidContainer1", "liquid", listPorts=True, connected=True)

# Query if the specified compound can be reset to factory
cmds.vnnCompound("|bifrostLiquid1|bifrostLiquidContainer1", "liquid", canResetToFactory="CompoundName")

# Reset the specified compound to factory
cmds.vnnCompound("|bifrostLiquid1|bifrostLiquidContainer1", "liquid", resetToFactory="CompoundName")