UNPKG

polygonjs-engine

Version:

node-based webgl 3D engine https://polygonjs.com

33 lines (32 loc) 1.07 kB
import {TypedAnimNode} from "./_Base"; import {TimelineBuilder as TimelineBuilder2} from "../../../core/animation/TimelineBuilder"; import {NodeParamsConfig, ParamConfig} from "../utils/params/ParamsConfig"; class PropertyNameAnimParamsConfig extends NodeParamsConfig { constructor() { super(...arguments); this.name = ParamConfig.STRING("position"); } } const ParamsConfig2 = new PropertyNameAnimParamsConfig(); export class PropertyNameAnimNode extends TypedAnimNode { constructor() { super(...arguments); this.params_config = ParamsConfig2; } static type() { return "propertyName"; } initializeNode() { this.io.inputs.setCount(0, 1); this.scene().dispatchController.onAddListener(() => { this.params.onParamsCreated("params_label", () => { this.params.label.init([this.p.name]); }); }); } cook(input_contents) { const timeline_builder = input_contents[0] || new TimelineBuilder2(); timeline_builder.setPropertyName(this.pv.name); this.set_timeline_builder(timeline_builder); } }