UNPKG

polygonjs-engine

Version:

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

27 lines (26 loc) 1.01 kB
import {TypedCopNode} from "./_Base"; import {InputCloneMode as InputCloneMode2} from "../../poly/InputCloneMode"; import {TextureParamsController as TextureParamsController2, TextureParamConfig} from "./utils/TextureParamsController"; import {NodeParamsConfig} from "../utils/params/ParamsConfig"; class TexturePropertiesCopParamsConfig extends TextureParamConfig(NodeParamsConfig) { } const ParamsConfig2 = new TexturePropertiesCopParamsConfig(); export class TexturePropertiesCopNode extends TypedCopNode { constructor() { super(...arguments); this.params_config = ParamsConfig2; this.texture_params_controller = new TextureParamsController2(this); } static type() { return "textureProperties"; } initializeNode() { this.io.inputs.setCount(1); this.io.inputs.initInputsClonedState([InputCloneMode2.FROM_NODE]); } async cook(input_contents) { const texture = input_contents[0]; this.texture_params_controller.update(texture); this.set_texture(texture); } }