Log In
New Account
Home My Page Projects Blender 2.x BF release
Summary Activity Tracker SCM Files

Blender 2.6 Bug Tracker: Browse

[#25246] export default scene to X3D crashes exporter

Date:
2010-12-15 21:07
Priority:
3
State:
Closed
Submitted by:
Uwe Girlich (girlich)
Assigned to:
Campbell Barton (campbellbarton)
Category:
Import/Export
Status:
Fixed / Closed
Relates to:
[#25209]
Duplicates:
Patches:
 
Summary:
export default scene to X3D crashes exporter
Detailed description
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

Followup

Message
  • Date: 2010-12-16 06:02
  • Sender: Campbell Barton
  • fixed r33703. also did minor cleanup of color handling, all colors clamped now.
 

Attached Files:

No Files Currently Attached

Changes:

Field Old Value Date By
status_idOpen2010-12-16 06:02campbellbarton
close_dateNone2010-12-16 06:02campbellbarton
assigned_tonone2010-12-16 06:02campbellbarton
StatusNew2010-12-16 06:02campbellbarton