@polygonjs/polygonjs
Version:
node-based WebGL 3D engine https://polygonjs.com
28 lines (27 loc) • 976 B
JavaScript
;
import { TypedCopNode } from "./_Base";
import { InputCloneMode } from "../../poly/InputCloneMode";
import { TextureParamsController, TextureParamConfig } from "./utils/TextureParamsController";
import { NodeParamsConfig } from "../utils/params/ParamsConfig";
class TexturePropertiesCopParamsConfig extends TextureParamConfig(NodeParamsConfig) {
}
const ParamsConfig = new TexturePropertiesCopParamsConfig();
export class TexturePropertiesCopNode extends TypedCopNode {
constructor() {
super(...arguments);
this.paramsConfig = ParamsConfig;
this.textureParamsController = new TextureParamsController(this);
}
static type() {
return "textureProperties";
}
initializeNode() {
this.io.inputs.setCount(1);
this.io.inputs.initInputsClonedState([InputCloneMode.FROM_NODE]);
}
async cook(input_contents) {
const texture = input_contents[0];
this.textureParamsController.update(texture);
this.setTexture(texture);
}
}