Skip to content

Commit

Permalink
Update FBXLoader.js
Browse files Browse the repository at this point in the history
Clean up.
  • Loading branch information
Mugen87 authored Oct 2, 2024
1 parent 31f7abf commit 48f5603
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions examples/jsm/loaders/FBXLoader.js
Original file line number Diff line number Diff line change
Expand Up @@ -573,15 +573,15 @@ class FBXTreeParser {

// the transparency handling is implemented based on Blender/Unity's approach: https://github.com/sobotka/blender-addons/blob/7d80f2f97161fc8e353a657b179b9aa1f8e5280b/io_scene_fbx/import_fbx.py#L1444-L1459

parameters.opacity = ( materialNode.TransparencyFactor ? parseFloat( materialNode.TransparencyFactor.value ) : 1 );
parameters.opacity = 1 - ( materialNode.TransparencyFactor ? parseFloat( materialNode.TransparencyFactor.value ) : 0 );

if ( parameters.opacity === 1 || parameters.opacity === 0 ) {

parameters.opacity = ( materialNode.Opacity ? parseFloat( materialNode.Opacity.value ) : null );

if ( parameters.opacity === null ) {

parameters.opacity = ( materialNode.TransparentColor ? parseFloat( materialNode.TransparentColor.value[ 0 ] ) : 1 );
parameters.opacity = 1 - ( materialNode.TransparentColor ? parseFloat( materialNode.TransparentColor.value[ 0 ] ) : 0 );

}

Expand Down

0 comments on commit 48f5603

Please sign in to comment.