[Bf-extensions-cvs] SVN commit: /data/svn/bf-extensions [2020] trunk/py/scripts/addons/ io_scene_x3d/export_x3d.py: correction to h3d texture export.

Campbell Barton ideasman42 at gmail.com
Wed Jun 8 16:45:26 CEST 2011


Revision: 2020
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-extensions&revision=2020
Author:   campbellbarton
Date:     2011-06-08 14:45:25 +0000 (Wed, 08 Jun 2011)
Log Message:
-----------
correction to h3d texture export.

Modified Paths:
--------------
    trunk/py/scripts/addons/io_scene_x3d/export_x3d.py

Modified: trunk/py/scripts/addons/io_scene_x3d/export_x3d.py
===================================================================
--- trunk/py/scripts/addons/io_scene_x3d/export_x3d.py	2011-06-08 06:57:29 UTC (rev 2019)
+++ trunk/py/scripts/addons/io_scene_x3d/export_x3d.py	2011-06-08 14:45:25 UTC (rev 2020)
@@ -935,6 +935,10 @@
                     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 @@
                             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')
                             



More information about the Bf-extensions-cvs mailing list