提交 affbb2b8 编写于 作者: M Mr.doob

Updated builds.

上级 a1d29701
......@@ -11002,27 +11002,43 @@
//
if ( this.geometry !== undefined ) {
function serialise( library, element ) {
if ( meta.geometries[ this.geometry.uuid ] === undefined ) {
if ( library[ element.uuid ] === undefined ) {
meta.geometries[ this.geometry.uuid ] = this.geometry.toJSON( meta );
library[ element.uuid ] = element.toJSON( meta );
}
object.geometry = this.geometry.uuid;
return element.uuid;
}
if ( this.geometry !== undefined ) {
object.geometry = serialise( meta.geometries, this.geometry );
}
if ( this.material !== undefined ) {
if ( meta.materials[ this.material.uuid ] === undefined ) {
if ( Array.isArray( this.material ) ) {
meta.materials[ this.material.uuid ] = this.material.toJSON( meta );
var uuids = [];
}
for ( var i = 0, l = this.material.length; i < l; i ++ ) {
uuids.push( serialise( meta.materials, this.material[ i ] ) );
object.material = this.material.uuid;
}
object.material = uuids;
} else {
object.material = serialise( meta.materials, this.material );
}
}
......@@ -33762,6 +33778,28 @@
if ( name === undefined ) return undefined;
if ( Array.isArray( name ) ) {
var array = [];
for ( var i = 0, l = name.length; i < l; i ++ ) {
var uuid = name[ i ];
if ( materials[ uuid ] === undefined ) {
console.warn( 'THREE.ObjectLoader: Undefined material', uuid );
}
array.push( materials[ uuid ] );
}
return array;
}
if ( materials[ name ] === undefined ) {
console.warn( 'THREE.ObjectLoader: Undefined material', name );
......
因为 它太大了无法显示 source diff 。你可以改为 查看blob
......@@ -10996,27 +10996,43 @@ Object.assign( Object3D.prototype, EventDispatcher.prototype, {
//
if ( this.geometry !== undefined ) {
function serialise( library, element ) {
if ( meta.geometries[ this.geometry.uuid ] === undefined ) {
if ( library[ element.uuid ] === undefined ) {
meta.geometries[ this.geometry.uuid ] = this.geometry.toJSON( meta );
library[ element.uuid ] = element.toJSON( meta );
}
object.geometry = this.geometry.uuid;
return element.uuid;
}
if ( this.geometry !== undefined ) {
object.geometry = serialise( meta.geometries, this.geometry );
}
if ( this.material !== undefined ) {
if ( meta.materials[ this.material.uuid ] === undefined ) {
if ( Array.isArray( this.material ) ) {
meta.materials[ this.material.uuid ] = this.material.toJSON( meta );
var uuids = [];
}
for ( var i = 0, l = this.material.length; i < l; i ++ ) {
uuids.push( serialise( meta.materials, this.material[ i ] ) );
object.material = this.material.uuid;
}
object.material = uuids;
} else {
object.material = serialise( meta.materials, this.material );
}
}
......@@ -33756,6 +33772,28 @@ Object.assign( ObjectLoader.prototype, {
if ( name === undefined ) return undefined;
if ( Array.isArray( name ) ) {
var array = [];
for ( var i = 0, l = name.length; i < l; i ++ ) {
var uuid = name[ i ];
if ( materials[ uuid ] === undefined ) {
console.warn( 'THREE.ObjectLoader: Undefined material', uuid );
}
array.push( materials[ uuid ] );
}
return array;
}
if ( materials[ name ] === undefined ) {
console.warn( 'THREE.ObjectLoader: Undefined material', name );
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册