ジャンプ先: 概要. 戻り値. 関連. フラグ. Python 例.
vnnNode(
string string
, [connected=boolean], [connectedTo=string], [listConnectedNodes=boolean], [listPortChildren=string], [listPorts=boolean], [portDefaultValue=[string, string]], [queryPortDataType=string], [queryPortDefaultValue=string])
注: オブジェクトの名前と引数を表す文字列は、カンマで区切る必要があります。これはシノプシスに示されていません。
vnnNode は、取り消し可能、照会不可能、および編集不可能です。
vnnNode コマンドは、vnnNode を操作して、そのポートと接続を照会する場合に使用します。最初の引数は、VNN ノードが配置されている DG ノードのフル ネームです。2 番目の引数は、VNN ノードのフル パス名です。
vnn, vnnCompound, vnnConnect
connected, connectedTo, listConnectedNodes, listPortChildren, listPorts, portDefaultValue, queryPortDataType, queryPortDefaultValue
フラグはコマンドの作成モードで表示できます
|
フラグはコマンドの編集モードで表示できます
|
フラグはコマンドの照会モードで表示できます
|
フラグに複数の引数を指定し、タプルまたはリストとして渡すことができます。
|
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")