Browse Source

change Loader to accept opacity

yomotsu 10 years ago
parent
commit
0eecb277fb
2 changed files with 8 additions and 1 deletions
  1. 7 0
      src/loaders/Loader.js
  2. 1 1
      utils/exporters/blender/addons/io_three/constants.py

+ 7 - 0
src/loaders/Loader.js

@@ -316,10 +316,17 @@ THREE.Loader.prototype = {
 
 
 		if ( m.transparency ) {
 		if ( m.transparency ) {
 
 
+			console.warn( 'transparency has been renamed to opacity' );
 			mpars.opacity = m.transparency;
 			mpars.opacity = m.transparency;
 
 
 		}
 		}
 
 
+		if ( m.opacity ) {
+
+			mpars.opacity = m.opacity;
+
+		}
+
 		if ( m.specularCoef ) {
 		if ( m.specularCoef ) {
 
 
 			mpars.shininess = m.specularCoef;
 			mpars.shininess = m.specularCoef;

+ 1 - 1
utils/exporters/blender/addons/io_three/constants.py

@@ -222,7 +222,7 @@ SPECULAR = 'specular'
 SPECULAR_COEF = 'specularCoef'
 SPECULAR_COEF = 'specularCoef'
 SHININESS = 'shininess'
 SHININESS = 'shininess'
 SIDE = 'side'
 SIDE = 'side'
-OPACITY = 'transparency'
+OPACITY = 'opacity'
 TRANSPARENT = 'transparent'
 TRANSPARENT = 'transparent'
 WIREFRAME = 'wireframe'
 WIREFRAME = 'wireframe'
 BLENDING = 'blending'
 BLENDING = 'blending'