Difference between revisions of "WhatsNew"

From Silhouette Wiki
Jump to navigation Jump to search
Line 2: Line 2:
 
There have been many scripting enhancements in V6. The biggest change was to the rendering loop, which is now implemented entirely in Python. Now that a Session can have multiple output nodes, as well as multiple Paint and Roto nodes, many Actions were updated to support the new workflow.  
 
There have been many scripting enhancements in V6. The biggest change was to the rendering loop, which is now implemented entirely in Python. Now that a Session can have multiple output nodes, as well as multiple Paint and Roto nodes, many Actions were updated to support the new workflow.  
 
=== Changes ===
 
=== Changes ===
* there can be multiple nodes of each time in a Session, including Roto, Paint, and Output
+
* there can be multiple nodes of each type in a Session, including Roto, Paint, Output, and various OFX nodes
* the rendering loop is implemented in scripts/tools/renderer.py
+
* the complete rendering loop is implemented in <tt>scripts/tools/renderer.py</tt>
* rendering is triggered with scripts/actions/render.py
+
* rendering is triggered with the new Action in <tt>scripts/actions/render.py</tt>
* bundled actions that target specific nodes are updated to handle a connected Output node
+
* bundled actions that target specific nodes are updated to handle connected Output nodes
* shape path data now contains per-point feathering information
+
* shape path data can now contain per-point feathering information if per-point feathering is used
  
 
=== New Scripting Features ===
 
=== New Scripting Features ===

Revision as of 16:50, 21 November 2016

What's New in Silhouette V6

There have been many scripting enhancements in V6. The biggest change was to the rendering loop, which is now implemented entirely in Python. Now that a Session can have multiple output nodes, as well as multiple Paint and Roto nodes, many Actions were updated to support the new workflow.

Changes

  • there can be multiple nodes of each type in a Session, including Roto, Paint, Output, and various OFX nodes
  • the complete rendering loop is implemented in scripts/tools/renderer.py
  • rendering is triggered with the new Action in scripts/actions/render.py
  • bundled actions that target specific nodes are updated to handle connected Output nodes
  • shape path data can now contain per-point feathering information if per-point feathering is used

New Scripting Features

  • nodes can be created, added, and removed from a Session
  • nodes can be connected and disconnected
  • new hooks: attach_pipe, remove_pipe, triggered when nodes are wired up or disconnected in the UI
  • new hook: object_created, triggered when a new Node, Shape, Layer, or Tracker is created in the UI
  • user-defined properties can be added and removed from Objects
  • multi-part output format API
  • new hook: output_node, triggered for each output node
  • drop hooks: hooks can be called when a registered mime type is dropped in the new Trees view

Creating Nodes

Nodes must be created using their interal node name. Registered node names can be queried using fx.nodes. Note that internal nodes have named like RotoNode and PaintNode. Most of the rest of the stock Silhouette nodes are implemented using OFX, and have node IDs such as com.digitalfilmtools.ofx.silhouette.sfx_composite and com.digitalfilmtools.ofx.silhouette.blur.

Nodes can be connected to other nodes using pipes and ports. Ports have specific types (usuallying image or data) and can only be connected to other ports with the same type. Output ports can have multiple pipes connected to them but input ports may only have one.

roto = Node("RotoNode")
activeSession().addNode(roto)

slapComp = Node("com.digitalfilmtools.ofx.silhouette.slapComp")
activeSession().addNode(slapComp)

roto.port("output").connect(slapComp.port("input"))

Hooks are only triggered from the UI, so if you want hooks triggered when nodes are created or connected, you must do so manually.

import hook

roto = Node("RotoNode")
activeSession().addNode(roto)
hook.run("object_created", roto)

pipe = roto.output(0).connect(slapComp.input(0))
hook.run("attach_pipe", pipe)

New Hooks

Hook name Description Added
object_created
called after a new object is created in the UI. The object is passed as the argument. 6.0
attach_pipe
called after a new pipe connects two nodes 6.0
remove_pipe
called just before a pipe is removed 6.0
output_node
called after an Output node finishes writing all of its parts. A meta-data dictionary of useful information is passed. 6.0

Rendering