未验证 提交 4f4c11a1 编写于 作者: L Luis E. Fraguada 提交者: GitHub

3dmLoader: Fix bug in texture type checking (#21784)

* extract name and value properties from objects

* Extract object userStrings

* 3dmLoader: refactor es6

* Remove unnecessary imports.

* adding some error catching related to PBR mats

* fix bug in texturetype checking
上级 0f0d05d1
......@@ -944,15 +944,13 @@ function Rhino3dmWorker() {
if ( _pbrMaterial.supported ) {
console.log( 'pbr true' );
for ( let j = 0; j < pbrTextureTypes.length; j ++ ) {
const _texture = _material.getTexture( textureTypes[ j ] );
const _texture = _material.getTexture( pbrTextureTypes[ j ] );
if ( _texture ) {
const image = doc.getEmbeddedFileAsBase64( _texture.fileName );
let textureType = textureTypes[ j ].constructor.name;
let textureType = pbrTextureTypes[ j ].constructor.name;
textureType = textureType.substring( 12, textureType.length );
const texture = { type: textureType, image: 'data:image/png;base64,' + image };
textures.push( texture );
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册