Skip to content

Commit

Permalink
Update FBXLoader.js
Browse files Browse the repository at this point in the history
fix some FBX models cannot display colors properly.
  • Loading branch information
ilex0208 authored Nov 12, 2020
1 parent b19cc35 commit 40c5084
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions examples/js/loaders/FBXLoader.js
Original file line number Diff line number Diff line change
Expand Up @@ -495,7 +495,7 @@ THREE.FBXLoader = ( function () {

parameters.color = new THREE.Color().fromArray( materialNode.Diffuse.value );

} else if ( materialNode.DiffuseColor && materialNode.DiffuseColor.type === 'Color' ) {
} else if ( (materialNode.DiffuseColor && (materialNode.DiffuseColor.type === 'Color' || materialNode.DiffuseColor.type === 'ColorRGB') ) {

// The blender exporter exports diffuse here instead of in materialNode.Diffuse
parameters.color = new THREE.Color().fromArray( materialNode.DiffuseColor.value );
Expand All @@ -512,7 +512,7 @@ THREE.FBXLoader = ( function () {

parameters.emissive = new THREE.Color().fromArray( materialNode.Emissive.value );

} else if ( materialNode.EmissiveColor && materialNode.EmissiveColor.type === 'Color' ) {
} else if ( materialNode.EmissiveColor && (materialNode.EmissiveColor.type === 'Color' || materialNode.EmissiveColor.type === 'ColorRGB') ) {

// The blender exporter exports emissive color here instead of in materialNode.Emissive
parameters.emissive = new THREE.Color().fromArray( materialNode.EmissiveColor.value );
Expand Down

0 comments on commit 40c5084

Please sign in to comment.