Difference between revisions of "Session"

From Silhouette Wiki
Jump to navigation Jump to search
(Created page with "The Session object stores all the Nodes to create the output for a specific shot. ''Base Class: Object'' === Attributes === ''Attributes are read-only except w...")
 
 
(5 intermediate revisions by the same user not shown)
Line 1: Line 1:
The Session object stores all the [[Node|Nodes]] to create the output for a specific shot.
+
The Session object stores all the [[Node|Nodes]] to create the outputs for a specific shot.
  
 
''Base Class: [[Object]]''
 
''Base Class: [[Object]]''
 +
 +
=== Construction ===
 +
<tt>session = Session(label=None, width=None, height=None, pixelAspect=None, depth=None, duration=None, frameRate=None)</tt>
 +
 +
If any arguments are omitted they should be set using the respective [[Property]].
 +
 +
Sessions can be created automatically from a [[Source]] using the <tt>tools.session.SessionBuilder</tt> class.
 +
 +
Add the Session to a [[Project]] using <tt>project.addItem()</tt>.
  
 
=== Attributes ===
 
=== Attributes ===
Line 9: Line 18:
 
! scope="col" | Name
 
! scope="col" | Name
 
! scope="col" class="unsortable" | Description
 
! scope="col" class="unsortable" | Description
 +
| scope="col" | Added
 
|-
 
|-
 
|depth
 
|depth
 
|the session [[Silhouette Module Reference#Depth Constants|depth]] (''read/write'')
 
|the session [[Silhouette Module Reference#Depth Constants|depth]] (''read/write'')
 
|-
 
|-
|color
+
|duration
|the object [[Color]] - not all objects have a way of changing their color (''read/write'')
+
|the duration in frames
 
|-
 
|-
|id
+
|frameRate
|the unique id as string
+
|the frame rate
 
|-
 
|-
|label
+
|nodes
|the object label (''read/write'')
+
|List of [[Node|Nodes]] in the session
 
|-
 
|-
|locked
+
|pixelAspect
|True if locked (''read/write'')
+
|the pixel aspect
 
|-
 
|-
|note
+
|project
|the object note (''read/write'')
+
|the [[Project]] containing the session
 
|-
 
|-
|parent
+
|size
|the parent Object, or None
+
|the size as a Tuple of (width, height)
 
|-
 
|-
|properties
+
|startFrame
|the dictionary of [[Property|Properties]]
+
|the start frame number
 
|-
 
|-
|selected
+
|workRange
|True if selected
+
|the current work range as a Tuple of (start_frame, end_frame) (''read/write'')
 
|-
 
|-
|type
+
|displayWindow
|the object type name
+
|returns the session frame as a [[Recti]]
 +
|6.0
 
|-
 
|-
|visible
+
|outputs
|True if visible (''read/write'')
+
|a list of all output nodes
 +
|6.0
 +
|-
 +
|outputRange
 +
|the output range as a tuple (start, end) - the range is in output frame numbers
 +
|6.0
 +
|-
 +
|renderRange
 +
|the render range as a tuple (start, end) - the range is in 0-based frame numbers
 +
|6.0
 
|}
 
|}
  
Line 49: Line 69:
 
! scope="col" | Name
 
! scope="col" | Name
 
! scope="col" class="unsortable" | Description
 
! scope="col" class="unsortable" | Description
 +
! scope="col" | Added
 
|-
 
|-
|property(name)
+
|node(<nowiki>name|type</nowiki>)
|returns the [[Property]] with the property name, or None
+
|finds the [[Node]] with the name or type, depending on the argument name, or None
 
|-
 
|-
|clone()
+
|getNodes(type)
|returns a deep clone of the object and children
+
|returns a list of [[Node|Nodes]] that match the given type
 +
|6.0
 
|-
 
|-
|getTransform(frame)
+
|addNode(node)
|returns the accumulated [[Matrix|transform]] at the specified time. This is a convenience method only useful for [[Layer|Layers]] and their children.
+
|adds the [[Node]]
|}
+
|6.0
 
+
|-
=== Operators ===
+
|removeNode(node)
 
+
|removes the [[Node]]
{| class="wikitable"
+
|6.0
! scope="col" | Name
 
! scope="col" class="unsortable" | Description
 
 
|-
 
|-
|object[prop_id]
+
|roi(frame)
|the map operator can be used as shorthand for <tt>object.property(prop_id)</tt>
+
|returns the ROI [[Recti]] for the frame
 +
|6.0
 
|}
 
|}

Latest revision as of 13:15, 26 July 2018

The Session object stores all the Nodes to create the outputs for a specific shot.

Base Class: Object

Construction

session = Session(label=None, width=None, height=None, pixelAspect=None, depth=None, duration=None, frameRate=None)

If any arguments are omitted they should be set using the respective Property.

Sessions can be created automatically from a Source using the tools.session.SessionBuilder class.

Add the Session to a Project using project.addItem().

Attributes

Attributes are read-only except where noted.

Name Description Added
depth the session depth (read/write)
duration the duration in frames
frameRate the frame rate
nodes List of Nodes in the session
pixelAspect the pixel aspect
project the Project containing the session
size the size as a Tuple of (width, height)
startFrame the start frame number
workRange the current work range as a Tuple of (start_frame, end_frame) (read/write)
displayWindow returns the session frame as a Recti 6.0
outputs a list of all output nodes 6.0
outputRange the output range as a tuple (start, end) - the range is in output frame numbers 6.0
renderRange the render range as a tuple (start, end) - the range is in 0-based frame numbers 6.0

Methods

Name Description Added
node(name|type) finds the Node with the name or type, depending on the argument name, or None
getNodes(type) returns a list of Nodes that match the given type 6.0
addNode(node) adds the Node 6.0
removeNode(node) removes the Node 6.0
roi(frame) returns the ROI Recti for the frame 6.0