Sidebar.Geometry.Modifiers.js 574 B

1234567891011121314151617181920212223242526272829303132
  1. import { UIRow, UIButton } from './libs/ui.js';
  2. function SidebarGeometryModifiers( editor, object ) {
  3. var signals = editor.signals;
  4. var container = new UIRow().setPaddingLeft( '90px' );
  5. var geometry = object.geometry;
  6. // Compute Vertex Normals
  7. var button = new UIButton( 'Compute Vertex Normals' );
  8. button.onClick( function () {
  9. geometry.computeVertexNormals();
  10. geometry.attributes.normal.needsUpdate = true;
  11. signals.geometryChanged.dispatch( object );
  12. } );
  13. container.add( button );
  14. //
  15. return container;
  16. }
  17. export { SidebarGeometryModifiers };