UVEditor.js 529 B

123456789101112131415161718192021222324252627
  1. import { SelectInput, LabelElement } from 'flow';
  2. import { BaseNodeEditor } from '../BaseNodeEditor.js';
  3. import { uv } from 'three/nodes';
  4. export class UVEditor extends BaseNodeEditor {
  5. constructor() {
  6. const node = uv();
  7. super( 'UV', node, 200 );
  8. this.setOutputLength( 2 );
  9. const optionsField = new SelectInput( [ '0', '1', '2', '3' ], 0 ).onChange( () => {
  10. node.index = Number( optionsField.getValue() );
  11. this.invalidate();
  12. } );
  13. this.add( new LabelElement( 'Channel' ).add( optionsField ) );
  14. }
  15. }