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

Merge pull request #12373 from donmccurdy/feat-mesh-refcounting-cleanup

GLTFLoader: Clean up node pre-processing.
......@@ -2230,24 +2230,26 @@ THREE.GLTFLoader = ( function () {
// Nothing in the node definition indicates whether it is a Bone or an
// Object3D. Use the skins' joint references to mark bones.
skins.forEach( function ( skin ) {
for ( var skinIndex in skins ) {
skin.joints.forEach( function ( id ) {
for ( var jointIndex in skins[ skinIndex ].joints ) {
nodes[ id ].isBone = true;
nodes[ jointIndex ].isBone = true;
} );
}
} );
}
// Meshes can (and should) be reused by multiple nodes in a glTF asset. To
// avoid having more than one THREE.Mesh with the same name, count
// references and rename instances below.
//
// Example: CesiumMilkTruck sample model reuses "Wheel" meshes.
nodes.forEach( function ( nodeDef ) {
for ( var nodeIndex in nodes ) {
if ( nodeDef.mesh ) {
var nodeDef = nodes[ nodeIndex ];
if ( nodeDef.mesh !== undefined ) {
if ( meshReferences[ nodeDef.mesh ] === undefined ) {
......@@ -2259,7 +2261,7 @@ THREE.GLTFLoader = ( function () {
}
} );
}
return scope._withDependencies( [
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册