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

Merge pull request #10833 from donmccurdy/feat-gltf-2.0-meshes

[glTF] Update node and mesh loading for glTF 2.0.
......@@ -1594,7 +1594,7 @@ THREE.GLTF2Loader = ( function () {
var attributeEntry = attributes[ attributeId ];
if ( ! attributeEntry ) return;
if ( attributeEntry === undefined ) return;
var bufferAttribute = dependencies.accessors[ attributeEntry ];
......@@ -1923,11 +1923,25 @@ THREE.GLTF2Loader = ( function () {
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 ];
if ( group === undefined ) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册