瀏覽代碼

GLTFExporter: Make attribute prefix more robust. (#33357)

Michael Herzog 1 月之前
父節點
當前提交
84335585d4
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      examples/jsm/exporters/GLTFExporter.js

+ 1 - 1
examples/jsm/exporters/GLTFExporter.js

@@ -1848,7 +1848,7 @@ class GLTFWriter {
 			const validVertexAttributes =
 			const validVertexAttributes =
 					/^(POSITION|NORMAL|TANGENT|TEXCOORD_\d+|COLOR_\d+|JOINTS_\d+|WEIGHTS_\d+)$/;
 					/^(POSITION|NORMAL|TANGENT|TEXCOORD_\d+|COLOR_\d+|JOINTS_\d+|WEIGHTS_\d+)$/;
 
 
-			if ( ! validVertexAttributes.test( attributeName ) ) attributeName = '_' + attributeName;
+			if ( ! validVertexAttributes.test( attributeName ) && ! attributeName.startsWith( '_' ) ) attributeName = '_' + attributeName;
 
 
 			if ( cache.attributes.has( this.getUID( attribute ) ) ) {
 			if ( cache.attributes.has( this.getUID( attribute ) ) ) {
 
 

粤ICP备19079148号