Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2010-12-19 10:40:08 +0300
committerCampbell Barton <ideasman42@gmail.com>2010-12-19 10:40:08 +0300
commit4476e4c75c777449f03570a97b70c6a8d004e926 (patch)
tree837a092c81499719a90e5d84b81b65f3f0e9f414 /release
parent73ad13c879696fe45fae3dd0b09557a4b0f6baf8 (diff)
bugfix [#25289] X3D export generates incorrect direction for SpotLight
Diffstat (limited to 'release')
-rw-r--r--release/scripts/op/io_scene_x3d/export_x3d.py9
1 files changed, 3 insertions, 6 deletions
diff --git a/release/scripts/op/io_scene_x3d/export_x3d.py b/release/scripts/op/io_scene_x3d/export_x3d.py
index f8fe6e0efd4..04a752195fb 100644
--- a/release/scripts/op/io_scene_x3d/export_x3d.py
+++ b/release/scripts/op/io_scene_x3d/export_x3d.py
@@ -234,10 +234,7 @@ class x3d_class:
# beamWidth=((lamp.spotSize*math.pi)/180.0)*.37;
cutOffAngle=beamWidth*1.3
- dx,dy,dz=self.computeDirection(mtx)
- # note -dx seems to equal om[3][0]
- # note -dz seems to equal om[3][1]
- # note dy seems to equal om[3][2]
+ dx, dy, dz = self.computeDirection(mtx)
#location=(ob.matrix_world*MATWORLD).translation_part() # now passed
location=(MATWORLD * mtx).translation_part()
@@ -266,7 +263,7 @@ class x3d_class:
ambientIntensity = 0
intensity=min(lamp.energy/1.75,1.0)
- (dx,dy,dz)=self.computeDirection(mtx)
+ dx, dy, dz = self.computeDirection(mtx)
self.file.write("<DirectionalLight DEF=\"%s\" " % safeName)
self.file.write("ambientIntensity=\"%s\" " % (round(ambientIntensity,self.cp)))
self.file.write("color=\"%s %s %s\" " % (round(lamp.color[0],self.cp), round(lamp.color[1],self.cp), round(lamp.color[2],self.cp)))
@@ -924,7 +921,7 @@ class x3d_class:
return s
def computeDirection(self, mtx):
- return (mathutils.Vector((0, -1, 0)) * (MATWORLD * mtx).rotation_part())[:]
+ return (mathutils.Vector((0.0, 0.0, -1.0)) * (MATWORLD * mtx).rotation_part()).normalize()[:]
# swap Y and Z to handle axis difference between Blender and VRML
#------------------------------------------------------------------------