setTimelineDuration
Sets the duration, in seconds, for the timeline with the given id.
Supported on:
- BooleanOperationNode
- CodeBlockNode
- ComponentNode
- ComponentSetNode
- ConnectorNode
- EllipseNode
- EmbedNode
- FrameNode
- GroupNode
- HighlightNode
- InstanceNode
- InteractiveSlideElementNode
- LineNode
- LinkUnfurlNode
- MediaNode
- PolygonNode
- RectangleNode
- SectionNode
- ShapeWithTextNode
- SliceNode
- SlideGridNode
- SlideNode
- SlideRowNode
- SlotNode
- StampNode
- StarNode
- StickyNode
- TableNode
- TextNode
- TextPathNode
- TransformGroupNode
- VectorNode
- WashiTapeNode
- WidgetNode
Signature
setTimelineDuration(id: string, duration: number): void
Parameters
id
A timeline id read from timelines.
duration
The new timeline duration in seconds. Must be greater than zero.
Remarks
const node = figma.currentPage.selection[0]
const [timeline] = node?.timelines ?? []
if (node && timeline) {
node.setTimelineDuration(timeline.id, 1.2)
}