Difference between revisions of "Shape"

From Silhouette Wiki
Jump to navigation Jump to search
Line 7: Line 7:
 
=== Attributes ===
 
=== Attributes ===
  
''Attributes are read-only unless noted.''
 
 
{| class="wikitable"
 
{| class="wikitable"
 
! scope="col" | Name
 
! scope="col" | Name
 
! scope="col" class="unsortable" | Description
 
! scope="col" class="unsortable" | Description
 +
| scope="col" | Added
 
|-
 
|-
 
|blendMode
 
|blendMode
Line 32: Line 32:
 
|shapeType
 
|shapeType
 
|the [[#Shape Type|shape type]]
 
|the [[#Shape Type|shape type]]
 +
|-
 +
|capStyle
 +
|the open shape end-cap style (Shape.FlatCap or Shape.RoundCap)
 +
|6.0
 +
|-
 +
|featherType
 +
|the feathering type (read-only, Shape.LegacyFeather or Shape.PerPointFeather)
 +
|6.0
 
|}
 
|}
  
Line 39: Line 47:
 
! scope="col" | Name
 
! scope="col" | Name
 
! scope="col" class="unsortable" | Description
 
! scope="col" class="unsortable" | Description
 +
! scope="col" | Added
 
|-
 
|-
 
|createPath()
 
|createPath()
Line 66: Line 75:
 
|setPath(path, frame)
 
|setPath(path, frame)
 
|set the [[ShapePath|path]] as a keyframe at <tt>frame</tt>
 
|set the [[ShapePath|path]] as a keyframe at <tt>frame</tt>
 +
|-
 +
|convertToBezier()
 +
|creates and returns a Bezier version of the current shape
 
|}
 
|}
  
Line 84: Line 96:
 
|Xspline
 
|Xspline
 
|an X-Spline shape
 
|an X-Spline shape
 +
|}
 +
 +
=== ShapePath Methods ===
 +
 +
{| class="wikitable"
 +
! scope="col" | Name
 +
! scope="col" class="unsortable" | Description
 +
| scope="col" | Added
 +
|-
 +
|insertPoint(t)
 +
|inserts a new control point at <tt>t</tt>
 +
|6.0
 +
|-
 +
|deletePoint(index)
 +
|deletes the point at <tt>index<tt>
 +
|6.0
 +
|-
 +
|evalNormal(t)
 +
|returns the normal at <tt>t</tt>
 +
|6.0
 +
|-
 +
|evalPoint(t)
 +
|returns the point information  at <tt>t</tt>
 +
|6.0
 +
|}
 +
 +
{| class="wikitable"
 +
! Shape Type!!No Feather!!Per-point Feather
 +
|-
 +
|Closed Bezier||(in_tangent, point, out_tangent)||(in_tangent, point, out_tangent, feather_point, feather_in_tangent, feather_out_tangent)
 +
|-
 +
|Open Bezier||(in_tangent, point, out_tangent)||(in_tangent, point, out_tangent, stroke_width, feather_width)
 +
|-
 +
|Closed Bspline||(point, repeat, weight)||(point, repeat, weight, feather_point, feather_weight)
 +
|-
 +
|Open Bspline||(point, repeat, weight)||(point, repeat, weight, width, feather_width)
 +
|-
 +
|Closed Xspline||(point, weight)||(point, weight, feather_point, feather_weight)
 +
|-
 +
|Open Xspline||(point, weight)||(point,  weight, width, feather_width)
 +
|-
 
|}
 
|}

Revision as of 13:26, 26 July 2018

The Shape object represents a Bézier, B-Spline, or X-Spline shape that can animate over time.

Base Class: StereoscopicObject

Shapes can be created with Shape(type, label=None).

Attributes

Name Description Added
blendMode the blend mode
blurType the blur type
closed True if the shape is closed
inverted True if the shape alpha should be inverted
path the path property (same as shape.property('path') or shape['path'])
range the shape's t-range as a tuple (start, end)
shapeType the shape type
capStyle the open shape end-cap style (Shape.FlatCap or Shape.RoundCap) 6.0
featherType the feathering type (read-only, Shape.LegacyFeather or Shape.PerPointFeather) 6.0

Methods

Name Description Added
createPath() create and return a new empty path - set with setPath()
createPath(frame) create and return a new empty path and set a key at frame
evalPath(frame) interpolate and return a path at the desired frame
isPointSelected(index) return True if the control point index is selected
selectAllPoints(state=True) select (or deselect) all of the control points
selectedPoints() return a List of selected control point indexes
selectPoint(index, state=True) select (or deselect) the control point at index
selectPoints(indexes, state=True) select (or deselect) the List of control point at indexes
setPath(path, frame) set the path as a keyframe at frame
convertToBezier() creates and returns a Bezier version of the current shape

Constants

Shape Type

Name Description
Bezier a Bézier shape
Bspline a B-Spline shape
Xspline an X-Spline shape

ShapePath Methods

Name Description Added
insertPoint(t) inserts a new control point at t 6.0
deletePoint(index) deletes the point at index 6.0
evalNormal(t) returns the normal at t 6.0
evalPoint(t) returns the point information at t 6.0
Shape Type No Feather Per-point Feather
Closed Bezier (in_tangent, point, out_tangent) (in_tangent, point, out_tangent, feather_point, feather_in_tangent, feather_out_tangent)
Open Bezier (in_tangent, point, out_tangent) (in_tangent, point, out_tangent, stroke_width, feather_width)
Closed Bspline (point, repeat, weight) (point, repeat, weight, feather_point, feather_weight)
Open Bspline (point, repeat, weight) (point, repeat, weight, width, feather_width)
Closed Xspline (point, weight) (point, weight, feather_point, feather_weight)
Open Xspline (point, weight) (point, weight, width, feather_width)