Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 6 additions & 14 deletions examples/js/loaders/FBXLoader.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ THREE.FBXLoader = ( function () {

}

//console.log( FBXTree );
// console.log( fbxTree );

var textureLoader = new THREE.TextureLoader( this.manager ).setPath( resourceDirectory ).setCrossOrigin( this.crossOrigin );

Expand Down Expand Up @@ -743,14 +743,6 @@ THREE.FBXLoader = ( function () {

for ( var i = 0; i < relationships.children.length; i ++ ) {

if ( i === 8 ) {

console.warn( 'FBXLoader: maximum of 8 morph targets supported. Ignoring additional targets.' );

break;

}

var child = relationships.children[ i ];

var morphTargetNode = deformerNodes[ child.ID ];
Expand Down Expand Up @@ -2001,7 +1993,7 @@ THREE.FBXLoader = ( function () {
if ( morphTarget === null ) return;

parentGeo.morphAttributes.position = [];
parentGeo.morphAttributes.normal = [];
// parentGeo.morphAttributes.normal = []; // not implemented

var self = this;
morphTarget.rawTargets.forEach( function ( rawTarget ) {
Expand All @@ -2010,7 +2002,7 @@ THREE.FBXLoader = ( function () {

if ( morphGeoNode !== undefined ) {

self.genMorphGeometry( parentGeo, parentGeoNode, morphGeoNode, preTransform );
self.genMorphGeometry( parentGeo, parentGeoNode, morphGeoNode, preTransform, rawTarget.name );

}

Expand All @@ -2022,7 +2014,7 @@ THREE.FBXLoader = ( function () {
// in FBXTree.Objects.Geometry, however it can only have attributes for position, normal
// and a special attribute Index defining which vertices of the original geometry are affected
// Normal and position attributes only have data for the vertices that are affected by the morph
genMorphGeometry: function ( parentGeo, parentGeoNode, morphGeoNode, preTransform ) {
genMorphGeometry: function ( parentGeo, parentGeoNode, morphGeoNode, preTransform, name ) {

var morphGeo = new THREE.BufferGeometry();
if ( morphGeoNode.attrName ) morphGeo.name = morphGeoNode.attrName;
Expand Down Expand Up @@ -2056,7 +2048,7 @@ THREE.FBXLoader = ( function () {
var morphBuffers = this.genBuffers( morphGeoInfo );

var positionAttribute = new THREE.Float32BufferAttribute( morphBuffers.vertex, 3 );
positionAttribute.name = morphGeoNode.attrName;
positionAttribute.name = name || morphGeoNode.attrName;

preTransform.applyToBufferAttribute( positionAttribute );

Expand Down Expand Up @@ -2890,7 +2882,7 @@ THREE.FBXLoader = ( function () {
parse: function ( text ) {

this.currentIndent = 0;
console.log("FBXTree: ", FBXTree);

this.allNodes = new FBXTree();
this.nodeStack = [];
this.currentProp = [];
Expand Down