Difference between revisions of "ShapeEditor"

From Silhouette Wiki
Jump to navigation Jump to search
(Created page with "The ShapeEditor object can be used to manipulate shape control points on specific keys or over a range of keys. === Methods === {| class="wikitable" ! scope="col" | Name ! s...")
 
 
Line 1: Line 1:
 
The ShapeEditor object can be used to manipulate shape control points on specific keys or over a range of keys.
 
The ShapeEditor object can be used to manipulate shape control points on specific keys or over a range of keys.
 +
 +
=== Construction ===
 +
<tt>editor = ShapeEditor(shape, frame=0.0)</tt>
  
 
=== Methods ===
 
=== Methods ===
Line 18: Line 21:
 
|copyPoints(src_shape, src_index, target_index, count)
 
|copyPoints(src_shape, src_index, target_index, count)
 
|Copies the points in the range (src_index, src_index + count) from the source shape into the range (target_index, target_index + count) in the edited shape
 
|Copies the points in the range (src_index, src_index + count) from the source shape into the range (target_index, target_index + count) in the edited shape
 +
|-
 +
|execute()
 +
|Executes the edits and registers them with the undo system. This should be called after any other editing operations are performed.
 
|}
 
|}

Latest revision as of 15:30, 26 July 2018

The ShapeEditor object can be used to manipulate shape control points on specific keys or over a range of keys.

Construction

editor = ShapeEditor(shape, frame=0.0)

Methods

Name Description
makeKey(frame) Makes a new key on the specified frame
deletePoints(selected=False, index=-1) If selected is True, deletes the selected control points, otherwise deletes the point at index if >= 0
addPoints(index, count=1) Adds count points to the shape, starting at index. The points will be a copy of the point at index and should be updated immediately
copyPoints(src_shape, src_index, target_index, count) Copies the points in the range (src_index, src_index + count) from the source shape into the range (target_index, target_index + count) in the edited shape
execute() Executes the edits and registers them with the undo system. This should be called after any other editing operations are performed.