I start a self-compiled blender 2.55.1 r33689 on 64 bit Linux.
Now I click on File / Export / X3D Extensible 3D (.x3d)
I select a filename to export the default scene to and then click on "Export X3D".
The X3D exporter release/scripts/op/io_scene_x3d/export_x3d.py (recently changed due to #25209 in revision r33651)
crashes with this Python stack trace:
uwe@pacomp:~/info/blender/2.5> /usr/self/src/blender/2.5/install/bin/blender
Info: starting X3D export to '/home/uwe/untitled.x3d'...
Traceback (most recent call last):
File "/usr/self/src/blender/2.5/install/share/blender/2.55/scripts/op/io_scene_x3d/__init__.py", line 45, in execute
return export_x3d.save(self, context, **self.as_keywords(ignore=("check_existing", "filter_glob")))
File "/usr/self/src/blender/2.5/install/share/blender/2.55/scripts/op/io_scene_x3d/export_x3d.py", line 1108, in save
EXPORT_TRI=use_triangulate,
File "/usr/self/src/blender/2.5/install/share/blender/2.55/scripts/op/io_scene_x3d/export_x3d.py", line 828, in export
self.writeIndexedFaceSet(ob, me, ob_mat, world, EXPORT_TRI = EXPORT_TRI)
File "/usr/self/src/blender/2.5/install/share/blender/2.55/scripts/op/io_scene_x3d/export_x3d.py", line 421, in writeIndexedFaceSet
self.writeMaterial(mat, self.cleanStr(mat.name,''), world)
File "/usr/self/src/blender/2.5/install/share/blender/2.55/scripts/op/io_scene_x3d/export_x3d.py", line 655, in writeMaterial
emitR= max(min(emitR, 1.0), 0.0)
UnboundLocalError: local variable 'emitR' referenced before assignment
location:<unknown location>:-1
location:<unknown location>:-1
The reason is clear:
The variables emitR, emitG, and emitB are created only if a special condition is met (line 639)
but they are used in any case later on (lines 655ff). Because these 3 variables are not used
after clamping them into the interval 0..1, I assume this is a typo. Probably these 3 variables
should be named emisR, emisG, and emisB. The variables with "s" are defined before in any
case and are used later on also.
Uwe