浏览代码

Merge branch 'wip/3DMLoader' of https://github.com/mcneel/three.js into wip/3DMLoader

Luis Fraguada 4 年之前
父节点
当前提交
c0b0026498
共有 2 个文件被更改,包括 4 次插入1 次删除
  1. 1 0
      examples/jsm/loaders/3DMLoader.d.ts
  2. 3 1
      examples/jsm/loaders/3DMLoader.js

+ 1 - 0
examples/jsm/loaders/3DMLoader.d.ts

@@ -9,6 +9,7 @@ export class Rhino3dmLoader extends Loader {
 	constructor( manager?: LoadingManager );
 	constructor( manager?: LoadingManager );
 
 
 	load( url: string, onLoad: ( object: Object3D ) => void, onProgress?: ( event: ProgressEvent ) => void, onError?: ( event: ErrorEvent ) => void ): void;
 	load( url: string, onLoad: ( object: Object3D ) => void, onProgress?: ( event: ProgressEvent ) => void, onError?: ( event: ErrorEvent ) => void ): void;
+	parse( data: ArrayBufferLike, onLoad: ( object: Object3D ) => void, onError?: ( event: ErrorEvent ) => void ): void;
 	setLibraryPath( path: string ): Rhino3dmLoader;
 	setLibraryPath( path: string ): Rhino3dmLoader;
 	setWorkerLimit( workerLimit: number ): Rhino3dmLoader;
 	setWorkerLimit( workerLimit: number ): Rhino3dmLoader;
 	dispose(): Rhino3dmLoader;
 	dispose(): Rhino3dmLoader;

+ 3 - 1
examples/jsm/loaders/3DMLoader.js

@@ -334,7 +334,9 @@ Rhino3dmLoader.prototype = Object.assign( Object.create( Loader.prototype ), {
 
 
 					}
 					}
 
 
-					_object.visible = data.layers[ attributes.layerIndex ].visible;
+					var layer = data.layers[ attributes.layerIndex ]
+					
+					_object.visible = layer ? data.layers[ attributes.layerIndex ].visible : true;
 
 
 					if ( attributes.isInstanceDefinitionObject ) {
 					if ( attributes.isInstanceDefinitionObject ) {