Skip to content

Commit 48f5603

Browse files
authored
Update FBXLoader.js
Clean up.
1 parent 31f7abf commit 48f5603

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

examples/jsm/loaders/FBXLoader.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -573,15 +573,15 @@ class FBXTreeParser {
573573

574574
// 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
575575

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

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

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

582582
if ( parameters.opacity === null ) {
583583

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

586586
}
587587

0 commit comments

Comments
 (0)