@polygonjs/polygonjs
Version:
node-based WebGL 3D engine https://polygonjs.com
28 lines (23 loc) • 683 B
text/typescript
/**
* Simply makes a copy of the texture
*
*/
import {Texture} from 'three';
import {TypedCopNode} from './_Base';
import {NodeParamsConfig} from '../utils/params/ParamsConfig';
import {InputCloneMode} from '../../poly/InputCloneMode';
const ParamsConfig = new NodeParamsConfig();
export class NullCopNode extends TypedCopNode<NodeParamsConfig> {
override paramsConfig = ParamsConfig;
static override type() {
return 'null';
}
override initializeNode() {
this.io.inputs.setCount(1);
this.io.inputs.initInputsClonedState(InputCloneMode.NEVER);
}
override async cook(input_contents: Texture[]) {
const texture = input_contents[0];
this.setTexture(texture);
}
}