提交 0fa4533c 编写于 作者: D Don McCurdy

Update node and mesh loading for glTF 2.0.

上级 a76db5c9
...@@ -1594,7 +1594,7 @@ THREE.GLTF2Loader = ( function () { ...@@ -1594,7 +1594,7 @@ THREE.GLTF2Loader = ( function () {
var attributeEntry = attributes[ attributeId ]; var attributeEntry = attributes[ attributeId ];
if ( ! attributeEntry ) return; if ( attributeEntry === undefined ) return;
var bufferAttribute = dependencies.accessors[ attributeEntry ]; var bufferAttribute = dependencies.accessors[ attributeEntry ];
...@@ -1923,11 +1923,25 @@ THREE.GLTF2Loader = ( function () { ...@@ -1923,11 +1923,25 @@ THREE.GLTF2Loader = ( function () {
var node = json.nodes[ nodeId ]; var node = json.nodes[ nodeId ];
if ( node.meshes !== undefined ) { var meshes;
if ( node.mesh !== undefined) {
meshes = [ node.mesh ];
} else if ( node.meshes !== undefined ) {
console.warn( 'GLTF2Loader: Legacy glTF file detected. Nodes may have no more than 1 mesh.' );
meshes = node.meshes;
}
if ( meshes !== undefined ) {
for ( var meshId in node.meshes ) { for ( var meshId in meshes ) {
var mesh = node.meshes[ meshId ]; var mesh = meshes[ meshId ];
var group = dependencies.meshes[ mesh ]; var group = dependencies.meshes[ mesh ];
if ( group === undefined ) { if ( group === undefined ) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册