Go to: Synopsis. Return value. Related. Flags. Python examples.
vnnNode(
string string
, [connected=boolean], [connectedTo=string], [listConnectedNodes=boolean], [listPortChildren=string], [listPorts=boolean], [portDefaultValue=[string, string]], [queryPortDataType=string], [queryPortDefaultValue=string])
Note: Strings representing object names and arguments must be separated by commas. This is not depicted in the synopsis.
vnnNode is undoable, NOT queryable, and NOT editable.
The vnnNode command is used to operate vnnNode and query its port and connections.
The first argument is the full name of the DG node that the VNN node is in.
The second argument is the name of the full path of the VNN node.
string | The result of the operation |
vnn, vnnCompound, vnnConnect
connected, connectedTo, listConnectedNodes, listPortChildren, listPorts, portDefaultValue, queryPortDataType, queryPortDefaultValue
Long name (short name) |
Argument types |
Properties |
|
connected(c)
|
boolean
|
|
|
Used with "listPorts" to query the connected or
unconnected ports.
|
|
connectedTo(ct)
|
string
|
|
|
Used with "listConnectedNodes" to query the nodes
that are connected to the specified ports.
|
|
listConnectedNodes(lcn)
|
boolean
|
|
|
Used to list nodes which are connected to the specified
node. The returned result is a list of node names.
|
|
listPortChildren(lpc)
|
string
|
|
|
List the children of specified port.
|
|
listPorts(lp)
|
boolean
|
|
|
List ports on the specified node.
Can be used with "connected" to determine if
the returned ports have connections.
|
|
portDefaultValue(pdv)
|
[string, string]
|
|
|
Set the default value to a node port
The port cannot be connected.
|
|
queryPortDataType(qpt)
|
string
|
|
|
Query the data type of a specified port.
|
|
queryPortDefaultValue(qpv)
|
string
|
|
|
Query the default value of a node port
|
|
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
# 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()
# List all ports on the node
cmds.vnnNode("|bifrostLiquid1|bifrostLiquidContainer1", "liquid.postSimulationStep.if", listPorts=True)
# List the ports on the node which has connections
cmds.vnnNode("|bifrostLiquid1|bifrostLiquidContainer1", "liquid.postSimulationStep.if", listPorts=True, connected=True)
# List the ports on the node which has no connections
cmds.vnnNode("|bifrostLiquid1|bifrostLiquidContainer1", "liquid.postSimulationStep.if", listPorts=True, connected=False)
# List all connected nodes
cmds.vnnNode("|bifrostLiquid1|bifrostLiquidContainer1", "liquid.postSimulationStep.if", listConnectedNodes=True)
# List the connected nodes which are connected to the port "trueCase"
cmds.vnnNode("|bifrostLiquid1|bifrostLiquidContainer1", "liquid.postSimulationStep.if", listConnectedNodes=True, connectedTo="trueCase")
#
# Example of setting and querying the default value of a port
#
# Init scene and VNN objects
cmds.bifrost(g="vnnNodeCmdTest")
cmds.vnnCompound("|bifrostVnnNodeCmdTest1|bifrostVnnNodeCmdTestContainer1", "vnnNodeCmdTest", addNode="Bifrost,Amino,if")
cmds.vnnCompound("|bifrostVnnNodeCmdTest1|bifrostVnnNodeCmdTestContainer1", "vnnNodeCmdTest", addNode="Bifrost,Bifrost::Nodes::Math,valueInt")
# Set the port default value
cmds.vnnNode("|bifrostVnnNodeCmdTest1|bifrostVnnNodeCmdTestContainer1", "vnnNodeCmdTest.valueInt", portDefaultValue=["val", "233"])
# Get the port default value
portValue = cmds.vnnNode("|bifrostVnnNodeCmdTest1|bifrostVnnNodeCmdTestContainer1", "vnnNodeCmdTest.valueInt", queryPortDefaultValue="val")
print portValue
# [u'233']
# query the data type of a specified port
cmds.vnnNode("|bifrostLiquid1|bifrostLiquidContainer1", "liquid.postSimulationStep.if", queryPortDataType="outputValue")
# query the children of a specified port
cmds.vnnNode("|bifrostLiquid1|bifrostLiquidContainer1", "liquid", listPortChildren="portName")