Difference between revisions of "Node"

From Silhouette Wiki
Jump to navigation Jump to search
Line 41: Line 41:
 
|state
 
|state
 
|a dictionary of any extra node-specific state
 
|a dictionary of any extra node-specific state
 +
|6.0
 +
|-
 +
|connectedInputs
 +
|list of connected input [[Port|Ports]]
 +
|6.0
 +
|-
 +
|connectedOutputs
 +
|list of connected output [[Port|Ports]]
 +
|6.0
 +
|-
 +
|pipes
 +
|list of connected pipes [[Pipe|Pipes]]
 +
|6.0
 +
|-
 +
|ports
 +
|list of all [[Port|Ports]]
 +
|6.0
 +
|-
 +
|matte
 +
|the "obey matte" input [[Port]], or None if the node does not have one
 
|6.0
 
|6.0
 
|}
 
|}
 
  
 
=== Methods ===
 
=== Methods ===
Line 52: Line 71:
 
! scope="col" | Added
 
! scope="col" | Added
 
|-
 
|-
|render(frame, stream=[[Silhouette Module Reference#Stream Type Constants|Stream_Left]])
+
|render(frame, stream=[[Silhouette Module Reference#Stream Type Constants|Stream_Left]], channels=RGBA, depth=None, resolution=Proxy_FullRes, roi=None, port=None)
 
|render at the desired frame and returns a [[Raster]] with the result
 
|render at the desired frame and returns a [[Raster]] with the result
 +
|-
 +
|metadata(frame)
 +
|returns a metadata dictionary derived from up-stream Sources for the specified frame
 +
|6.0
 +
|-
 +
|setState(key, value)
 +
|sets the node state for key to value
 +
|6.0
 +
|-
 +
|disconnect(port)
 +
|disconnect the [[Port]]
 +
|6.0
 +
|-
 +
|port(name)
 +
|return the [[Port]] with the given name
 +
|6.0
 +
|-
 +
|getInput(index=0)
 +
|return the input [[Port]] at <tt>index</tt>
 +
|6.0
 +
|-
 +
|getOutput(index=0)
 +
|return the output [[Port]] at <tt>index</tt>
 +
|6.0
 
|}
 
|}
 
==== Nodes ====
 
* the <tt>Node.outputMask</tt> attribute has been added to query a node for the output streams it can produce.
 
* the <tt>Node.state</tt> attribute allows read-only access to the node's state dictionary
 
* the <tt>Node.metadata(frame)</tt> function returns a metadata dictionary derived from up-stream Sources
 
* <tt>Node.connectedInputs</tt> returns a list of connected input Ports.
 
* <tt>Node.connectedOutputs</tt> returns a list of connected output Ports.
 
* <tt>Node.pipes</tt> returns a list of connected Pipes.
 
* <tt>Node.ports</tt> returns a list of all input/output Ports.
 
* <tt>Node.matte</tt> returns the Obey Matte input Port, or None if the node does not have one
 
* <tt>Node.render()</tt> has a new signature. See [[#Rendering|Rendering]] for more information.
 
* <tt>Node.disconnect(port)</tt> disconnects the specified Port.
 
* <tt>Node.getInput(index=0)</tt> returns the specified input Port
 
* <tt>Node.getOutput(index=0)</tt> returns the specified output Port
 
* <tt>Node.port(name)</tt> returns the Port with the specified name/id.
 

Revision as of 20:35, 25 July 2018

The Node object generates output (usually an image) based on a set of inputs (image data and properties).

Base Class: Object

Creation

Nodes are created with the Node(type) constructor, where type is the "node type id". A list of available nodes can be queried with the global fx.nodes avariable.

Attributes

Attributes are read-only except where noted.

Name Description Added
active True if the active node
enabled True if enabled (read/write)
imageToWorldTransform the Matrix used to transform from image coordinates to world coordinates
inputs List of input Ports
outputs List of output Ports
session the Session the node is in (same as parent)
worldToImageTransform the Matrix used to transform from world coordinates to image coordinates
outputMask the output streams it can produce. 6.0
state a dictionary of any extra node-specific state 6.0
connectedInputs list of connected input Ports 6.0
connectedOutputs list of connected output Ports 6.0
pipes list of connected pipes Pipes 6.0
ports list of all Ports 6.0
matte the "obey matte" input Port, or None if the node does not have one 6.0

Methods

Name Description Added
render(frame, stream=Stream_Left, channels=RGBA, depth=None, resolution=Proxy_FullRes, roi=None, port=None) render at the desired frame and returns a Raster with the result
metadata(frame) returns a metadata dictionary derived from up-stream Sources for the specified frame 6.0
setState(key, value) sets the node state for key to value 6.0
disconnect(port) disconnect the Port 6.0
port(name) return the Port with the given name 6.0
getInput(index=0) return the input Port at index 6.0
getOutput(index=0) return the output Port at index 6.0