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

git.blender.org/blender-addons.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2011-06-08 18:45:25 +0400
committerCampbell Barton <ideasman42@gmail.com>2011-06-08 18:45:25 +0400
commit3060d466ea87cb0c93127057d54ba6373b2e0740 (patch)
tree10f76cd09f09c71a442a2f903bfdb7c33cf1177e /io_scene_x3d
parent76a657bf4e61e17be51420fa8ee365974a856838 (diff)
correction to h3d texture export.
Diffstat (limited to 'io_scene_x3d')
-rw-r--r--io_scene_x3d/export_x3d.py16
1 files changed, 9 insertions, 7 deletions
diff --git a/io_scene_x3d/export_x3d.py b/io_scene_x3d/export_x3d.py
index 6e6d9189..19f4cc6b 100644
--- a/io_scene_x3d/export_x3d.py
+++ b/io_scene_x3d/export_x3d.py
@@ -935,6 +935,10 @@ def export(file,
else:
assert(0)
+ elif uniform['type'] == gpu.GPU_DYNAMIC_LAMP_DYNENERGY:
+ # not used ?
+ assert(0)
+
elif uniform['type'] == gpu.GPU_DYNAMIC_LAMP_DYNVEC:
if uniform['datatype'] == gpu.GPU_DATA_3F:
value = '%.6g %.6g %.6g' % (mathutils.Vector((0.0, 0.0, 1.0)) * (global_matrix * bpy.data.objects[uniform['lamp']].matrix_world).to_quaternion()).normalized()[:]
@@ -968,20 +972,18 @@ def export(file,
value = []
for i in range(0, len(tex) - 1, 4):
col = tex[i:i + 4]
- value += ['0x%.8x' % (col[0] + (col[1] << 8) + (col[2] << 16) + (col[3] << 24))]
- print(len(value))
-
-
+ value.append('0x%.2x%.2x%.2x%.2x' % (col[0], col[1], col[2], col[3]))
+
fw('%s<field name="%s" type="SFNode" accessType="inputOutput">\n' % (ident, uniform['varname']))
ident += '\t'
ident_step = ident + (' ' * (-len(ident) + \
fw('%s<PixelTexture \n' % ident)))
- fw(ident_step + 'repeatS="true"\n')
- fw(ident_step + 'repeatT="true"\n')
+ fw(ident_step + 'repeatS="false"\n')
+ fw(ident_step + 'repeatT="false"\n')
- fw(ident_step + 'image="1 256 4 %s"\n' % " ".join(value))
+ fw(ident_step + 'image="%s 1 4 %s"\n' % (len(value), " ".join(value)))
fw(ident_step + '/>\n')