Amazon VERSION 2.0V1 Uživatelská příručka Strana 158

  • Stažení
  • Přidat do mých příruček
  • Tisk
  • Strana
    / 264
  • Tabulka s obsahem
  • KNIHY
  • Hodnocené. / 5. Na základě hodnocení zákazníků
Zobrazit stránku 157
158
example:
help( NodegraphAPI.CreateNode )
Referencing a Node
You can reference a node using the function GetNode(). For example, to reference a node called PrimitiveCreate
to the name node use:
node = NodegraphAPI.GetNode( 'PrimitiveCreate' )
Referencing a Parameter
Parameters are referenced in a similar way to nodes, using the function getParameter(). For example, to reference
the type parameter of a node called PrimitiveCreate, to the name nodeType use:
nodeType = NodegraphAPI.GetNode('PrimitiveCreate').getParameter( 'type' )
NOTE: Shift+middle-drag to the Python tab from a node in the Node Graph tab, or a parameter in the
Parameters tab to automatically create the path to that node or parameter. For example, dragging from
a node PrimitiveCreate in the Node Graph produces:
NodegraphAPI.GetNode( 'PrimitiveCreate' )
Node Position
The function SetNodePosition() sets the position of a node in the Node Graph UI. For example, to create then
position a PrimitiveCreate node:
# Get the root node
root = NodegraphAPI.GetRootNode()
# Create a new node at root level
node = NodegraphAPI.CreateNode( 'PrimitiveCreate', root )
# Define X & Y values
x = 0
y = 100
position = ( x, y )
# Set node position
NodegraphAPI.SetNodePosition( node, position )
23 NODEGRAPH API |
Zobrazit stránku 157
1 2 ... 153 154 155 156 157 158 159 160 161 162 163 ... 263 264

Komentáře k této Příručce

Žádné komentáře