CheckerEditor.js 516 B

123456789101112131415161718192021222324252627
  1. import { LabelElement } from '../../libs/flow.module.js';
  2. import { BaseNode } from '../core/BaseNode.js';
  3. import { CheckerNode, UVNode } from 'three/nodes';
  4. const defaultUV = new UVNode();
  5. export class CheckerEditor extends BaseNode {
  6. constructor() {
  7. const node = new CheckerNode( defaultUV );
  8. super( 'Checker', 1, node, 200 );
  9. const field = new LabelElement( 'UV' ).setInput( 2 );
  10. field.onConnect( () => {
  11. node.uvNode = field.getLinkedObject() || defaultUV;
  12. } );
  13. this.add( field );
  14. }
  15. }