CheckerEditor.js 498 B

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