Difference between revisions of "Property"

From Silhouette Wiki
Jump to navigation Jump to search
 
(12 intermediate revisions by the same user not shown)
Line 4: Line 4:
  
 
{| class="wikitable"
 
{| class="wikitable"
+ Silhouette Property Types
+
|+ Silhouette Property Types
 
! scope="col" | Type
 
! scope="col" | Type
 
! scope="col" | Description
 
! scope="col" | Description
 
! scope="col" | Data-type
 
! scope="col" | Data-type
 
! scope="col" | Animated
 
! scope="col" | Animated
 +
! scope="col" | Added
 
|-
 
|-
 
|Boolean
 
|Boolean
Line 43: Line 44:
 
|A slider or spin-box with with min/max range
 
|A slider or spin-box with with min/max range
 
|Integer or Float
 
|Integer or Float
 +
|align="center" | ✓
 +
|-
 +
|Object
 +
|An object reference
 +
|[[Object]]
 +
|
 +
|-
 +
|Objects
 +
|An object list
 +
|List of [[Object]]
 +
|
 +
|-
 +
|Path
 +
|A shape spline path
 +
|[[ShapePath]]
 
|align="center" | ✓
 
|align="center" | ✓
 
|-
 
|-
Line 49: Line 65:
 
|[[Point3D]]
 
|[[Point3D]]
 
|align="center" | ✓
 
|align="center" | ✓
 +
|-
 +
|Recti
 +
|2D integer rectangle
 +
|[[Recti]]
 +
|align="center" | ✓
 +
|5.2
 
|-
 
|-
 
|Source
 
|Source
Line 56: Line 78:
 
|-
 
|-
 
|StreamRef
 
|StreamRef
|A stream reference
+
|A [[Silhouette Module Reference#Stream Type Constants|Stream]] reference
 
|Integer
 
|Integer
 
|
 
|
Line 65: Line 87:
 
|
 
|
 
|}
 
|}
 +
 
=== Attributes ===
 
=== Attributes ===
  
''These attributes are read-only.''
+
''Read-only unless otherwise noted.''
 
{| class="wikitable"
 
{| class="wikitable"
 
! scope="col" | Name
 
! scope="col" | Name
 
! scope="col" class="unsortable" | Description
 
! scope="col" class="unsortable" | Description
 +
| scope="col" | Added
 
|-
 
|-
|actionType
+
|constant
|The [[#Action Type|Action Type]]
+
|True if animation is turned off (''read/write'')
 
|-
 
|-
|extension
+
|hidden
|If the Action implements an importer or exporter, the file extension the action works with
+
|True if hidden in the UI
 
|-
 
|-
|id
+
|keyframable
|The Action class name
+
|True if can be animated
 
|-
 
|-
|label
+
|keys
|The Action label that appears in the Actions menu
+
|List of keyframe times if keyframeable, None otherwise (can be empty if animation is disabled for this property)
 +
|-
 +
|name
 +
|property name/id
 +
|-
 +
|numKeys
 +
|the number if key-frames (always 0 if not keyframeable, can be non-zero even if constant)
 +
|-
 +
|numObjects
 +
|the number of child [[Object|objects]] if property is an object container
 +
|-
 +
|range
 +
|Tuple (first, last) of key times, or None if no keys
 +
|-
 +
|selected
 +
|True if selected
 +
|-
 +
|type
 +
|property type name
 +
|-
 +
|writable
 +
|True if property is saved to project file (False for transient properties)
 +
|-
 +
|dynamic
 +
|True if this is a "dynamic property"
 +
|6.0
 +
|-
 +
|item
 +
|if the property is of type List, the current value as a string, or None
 +
|6.0
 +
|-
 +
|items
 +
|if the property is of type List, the list of item strings
 +
|6.0
 +
|-
 +
|obsolete
 +
|True if the property as marked as obsolete
 +
|6.0
 +
|-
 +
|userDefined
 +
|True if the property is user-defined
 +
|6.0
 +
|-
 +
|value
 +
|the current value if the property is constant, or has no key-frames
 +
|6.0
 
|}
 
|}
  
Line 90: Line 159:
 
! scope="col" | Name
 
! scope="col" | Name
 
! scope="col" class="unsortable" | Description
 
! scope="col" class="unsortable" | Description
 +
! scope="col" | Added
 
|-
 
|-
|__init__(label, menu=None, type=Action, extension=None)
+
|addObjects(objects)
|Constructor - Initializes the base class. The menu can be listed separately or prefixed to the label with the '<nowiki>|</nowiki>' character.
+
|add the List of [[Object|objects]] to the child list if the property is of type '''Objects'''
 
|-
 
|-
|available()
+
|getKeyIndex(frame)
|Should return True (the default) if the Action is available. The Action should examine the current state in this method and assert (with an optional error message) that conditions are good for execution.
+
|return the index of the keyframe if it is one, or None
 +
|5.2
 
|-
 
|-
|execute(path=None)
+
|getNextKeyTime(frame)
|Called to execute the Action. UI Actions should be undoable. Importer/Exporter actions are passed the path to the file to operate on.
+
|return the frame of the next keyframe, or None
 +
|5.2
 +
|-
 +
|getPrevKeyTime(frame)
 +
|return the frame of the previous keyframe, or None
 +
|5.2
 +
|-
 +
|getValue(frame=0.0)
 +
|return the value at <tt>frame</tt>. If constant, returns the constant value otherwise interpolates a value from the appropriate key-frames
 +
|-
 +
|interpolation(index)
 +
|returns the [[#Interpolation Type Constants|Interpolation Type]] for the key with <tt>index</tt>
 +
|-
 +
|isKey(frame)
 +
|return True if frame is a keyframe
 +
|5.2
 +
|-
 +
|removeObjects(objects)
 +
|remove the List of [[Object|objects]] from the child list if the property is of type '''Objects'''
 +
|-
 +
|setValue(value, frame=0.0)
 +
|set the value at <tt>frame</tt>. If constant, sets the constant value otherwise sets a key-frame.
 +
|-
 +
|isKeyExtrapolated(index)
 +
|True if the key index is set to extrapolate
 +
|6.0
 +
|-
 +
|moveKeys(offset)
 +
|moves the selected keys by <tt>offset</tt> frames
 +
|6.0
 +
|-
 +
|moveKeys(offset)
 +
|moves the selected keys by <tt>offset</tt> frames
 +
|6.0
 
|}
 
|}
  
 
=== Constants ===
 
=== Constants ===
  
==== Action Type ====
+
==== Interpolation Type ====
  
 
{| class="wikitable"
 
{| class="wikitable"
 
! scope="col" | Name
 
! scope="col" | Name
 
! scope="col" class="unsortable" | Description
 
! scope="col" class="unsortable" | Description
 +
! scope="col" | Added
 +
|-
 +
|Hold
 +
|holds value until next key
 +
|-
 +
|Linear
 +
|linear interpolation to next key
 
|-
 
|-
|Action
+
|EaseIn
|A normal action that appears in the Actions menu (the default)
+
|ease in to next key
 
|-
 
|-
|ShapeImporter
+
|EaseOut
|An Action that should appear in the Shape Import menu
+
|ease out to next key
 
|-
 
|-
|ShapeExporter
+
|EaseInOut
|An Action that should appear in the Shape Export menu
+
|ease out from this key and in to next key
 
|-
 
|-
|Extension
+
|CatmullRom
|An Action that implements core functionality is bound using some other means
+
|smooth spatial interpolation
 +
|7.0
 
|}
 
|}
 +
 +
==== Interpolation ====
 +
"Catmull-Rom" interpolation was added in v7.0. Shapes can now be animated using smooth Catmull-Rom interpolation that will match up in "Nuke" using the latest Nuke exporter. Catmull-Rom can be combined with Hold on Shapes when the Shape -> Interpolation Engine preference is set to Spatial. If it s combined with non-spatial interpolation types such as EaseIn/Out, shape animation may not match up in Nuke.

Latest revision as of 13:02, 26 July 2018

A Property is a single constant or animated parameter. Silhouette supports many types of properties.

Property Types

Silhouette Property Types
Type Description Data-type Animated Added
Boolean On/Off check-box Bool
Color RGBA color picker Color
Flags A bit-mask with multiple check boxes Integer
Join An object link Object
List List of predefined options Integer
Matrix A transform matrix Matrix
Number A slider or spin-box with with min/max range Integer or Float
Object An object reference Object
Objects An object list List of Object
Path A shape spline path ShapePath
Point X/Y point Point3D
Recti 2D integer rectangle Recti 5.2
Source A data source Source
StreamRef A Stream reference Integer
String A UTF-8 string String

Attributes

Read-only unless otherwise noted.

Name Description Added
constant True if animation is turned off (read/write)
hidden True if hidden in the UI
keyframable True if can be animated
keys List of keyframe times if keyframeable, None otherwise (can be empty if animation is disabled for this property)
name property name/id
numKeys the number if key-frames (always 0 if not keyframeable, can be non-zero even if constant)
numObjects the number of child objects if property is an object container
range Tuple (first, last) of key times, or None if no keys
selected True if selected
type property type name
writable True if property is saved to project file (False for transient properties)
dynamic True if this is a "dynamic property" 6.0
item if the property is of type List, the current value as a string, or None 6.0
items if the property is of type List, the list of item strings 6.0
obsolete True if the property as marked as obsolete 6.0
userDefined True if the property is user-defined 6.0
value the current value if the property is constant, or has no key-frames 6.0

Methods

Name Description Added
addObjects(objects) add the List of objects to the child list if the property is of type Objects
getKeyIndex(frame) return the index of the keyframe if it is one, or None 5.2
getNextKeyTime(frame) return the frame of the next keyframe, or None 5.2
getPrevKeyTime(frame) return the frame of the previous keyframe, or None 5.2
getValue(frame=0.0) return the value at frame. If constant, returns the constant value otherwise interpolates a value from the appropriate key-frames
interpolation(index) returns the Interpolation Type for the key with index
isKey(frame) return True if frame is a keyframe 5.2
removeObjects(objects) remove the List of objects from the child list if the property is of type Objects
setValue(value, frame=0.0) set the value at frame. If constant, sets the constant value otherwise sets a key-frame.
isKeyExtrapolated(index) True if the key index is set to extrapolate 6.0
moveKeys(offset) moves the selected keys by offset frames 6.0
moveKeys(offset) moves the selected keys by offset frames 6.0

Constants

Interpolation Type

Name Description Added
Hold holds value until next key
Linear linear interpolation to next key
EaseIn ease in to next key
EaseOut ease out to next key
EaseInOut ease out from this key and in to next key
CatmullRom smooth spatial interpolation 7.0

Interpolation

"Catmull-Rom" interpolation was added in v7.0. Shapes can now be animated using smooth Catmull-Rom interpolation that will match up in "Nuke" using the latest Nuke exporter. Catmull-Rom can be combined with Hold on Shapes when the Shape -> Interpolation Engine preference is set to Spatial. If it s combined with non-spatial interpolation types such as EaseIn/Out, shape animation may not match up in Nuke.