Difference between revisions of "Property"

From Silhouette Wiki
Jump to navigation Jump to search
Line 78: Line 78:
 
=== 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
 
|-
 
|-
|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)
 
|}
 
|}
  

Revision as of 20:30, 20 November 2012

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
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
Objects An object list List of Object
Path A shape spline path ShapePath
Point X/Y point Point3D
Source A data source Source
StreamRef A Stream reference Integer
String A UTF-8 string String

Attributes

Read-only unless otherwise noted.

Name Description
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)

Methods

Name Description
__init__(label, menu=None, type=Action, extension=None) Constructor - Initializes the base class. The menu can be listed separately or prefixed to the label with the '|' character.
available() 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.
execute(path=None) Called to execute the Action. UI Actions should be undoable. Importer/Exporter actions are passed the path to the file to operate on.

Constants

Interpolation Type

Name Description
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