UNPKG

@tokens-studio/graph-engine

Version:

An execution engine to handle Token Studios generators and resolvers

34 lines 1.09 kB
import { FloatCurveSchema, Vec2Schema } from '../../schemas/index.js'; import { Node } from '../../programmatic/node.js'; export default class NodeDefinition extends Node { static title = 'Deconstruct Float Curve'; static type = 'studio.tokens.curve.deconstructFloat'; static description = 'Deconstructs a float curve into its parts'; constructor(props) { super(props); this.addInput('curve', { type: FloatCurveSchema }); this.addOutput('segments', { type: { type: 'array', items: Vec2Schema } }); this.addOutput('controlPoints', { type: { type: 'array', items: { type: 'array', items: Vec2Schema } } }); } execute() { const { curve } = this.getAllInputs(); this.outputs.segments.set(curve.segments); this.outputs.controlPoints.set(curve.controlPoints); } } //# sourceMappingURL=deconstructFloatCurve.js.map