Просмотр исходного кода

Editor: Improve geometry sidebar with interleaved and instanced support.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Mr.doob 1 месяц назад
Родитель
Сommit
86c5b3e9af
2 измененных файлов с 14 добавлено и 5 удалено
  1. 13 4
      editor/js/Sidebar.Geometry.BufferGeometry.js
  2. 1 1
      editor/js/Sidebar.Geometry.js

+ 13 - 4
editor/js/Sidebar.Geometry.BufferGeometry.js

@@ -34,7 +34,7 @@ function SidebarGeometryBufferGeometry( editor ) {
 
 			if ( index !== null ) {
 
-				containerAttributes.add( new UIText( strings.getKey( 'sidebar/geometry/buffer_geometry/index' ) ).setWidth( '80px' ) );
+				containerAttributes.add( new UIText( strings.getKey( 'sidebar/geometry/buffer_geometry/index' ) ).setWidth( '70px' ) );
 				containerAttributes.add( new UIText( editor.utils.formatNumber( index.count ) ).setFontSize( '12px' ) );
 				containerAttributes.add( new UIBreak() );
 
@@ -46,8 +46,17 @@ function SidebarGeometryBufferGeometry( editor ) {
 
 				const attribute = attributes[ name ];
 
-				containerAttributes.add( new UIText( name ).setWidth( '80px' ) );
-				containerAttributes.add( new UIText( editor.utils.formatNumber( attribute.count ) + ' (' + attribute.itemSize + ')' ).setFontSize( '12px' ) );
+				containerAttributes.add( new UIText( name ).setWidth( '70px' ) );
+
+				let info = editor.utils.formatNumber( attribute.count ) + ' (' + attribute.itemSize + ')';
+
+				if ( attribute.isInterleavedBufferAttribute ) {
+
+					info += ' (' + attribute.data.stride + ')';
+
+				}
+
+				containerAttributes.add( new UIText( info ).setFontSize( '12px' ) );
 				containerAttributes.add( new UIBreak() );
 
 			}
@@ -75,7 +84,7 @@ function SidebarGeometryBufferGeometry( editor ) {
 
 					const morphTargets = morphAttributes[ name ];
 
-					containerMorphAttributes.add( new UIText( name ).setWidth( '80px' ) );
+					containerMorphAttributes.add( new UIText( name ).setWidth( '70px' ) );
 					containerMorphAttributes.add( new UIText( editor.utils.formatNumber( morphTargets.length ) ).setFontSize( '12px' ) );
 					containerMorphAttributes.add( new UIBreak() );
 

+ 1 - 1
editor/js/Sidebar.Geometry.js

@@ -267,7 +267,7 @@ function SidebarGeometry( editor ) {
 
 				parameters.clear();
 
-				if ( geometry.type === 'BufferGeometry' ) {
+				if ( geometry.type === 'BufferGeometry' || geometry.type === 'InstancedBufferGeometry' ) {
 
 					parameters.add( new SidebarGeometryModifiers( editor, object ) );
 

粤ICP备19079148号