Closed GoogleCodeExporter closed 9 years ago
checking
Original comment by goatman.py@gmail.com
on 26 Jun 2011 at 10:36
The problem is this line:
elif ob.type == 'LAMP' and ob.data.name in 'POINT SPOT SUN'.split():
It should be ob.data.type not ob.data.name.
I also added a few things which you may find useful.
elif ob.type == 'LAMP' and ob.data.type in 'POINT SPOT SUN'.split():
Report.lights.append( ob.name )
l = doc.createElement('light')
o.appendChild(l)
if ob.data.type == 'POINT': l.setAttribute('type', 'point')
elif ob.data.type == 'SPOT': l.setAttribute('type', 'spot')
elif ob.data.type == 'SUN': l.setAttribute('type', 'directional')
l.setAttribute('name',ob.name)
if ob.data.type == 'SPOT' or ob.data.type == 'SUN':
vector = (mathutils.Euler.to_matrix(ob.rotation_euler)[2])
a = doc.createElement('direction')
l.appendChild(a)
a.setAttribute('x',str(round(-vector.x,3)))
a.setAttribute('y',str(round(-vector.z,3)))
a.setAttribute('z',str(round(vector.y,3)))
if ob.data.type == 'SPOT':
a = doc.createElement('spotLightRange')
l.appendChild(a)
a.setAttribute('inner',str(ob.data.spot_size))
a.setAttribute('outer',str(ob.data.spot_size))
a.setAttribute('falloff','1.0')
The direction does not take into account the swap axis mode, so it might need
to be changed. Also, for the colorDiffuse and specular, it should be spelled
colourDiffuse and colourSpecular according to the dtd here -
https://ogreaddons.svn.sourceforge.net/svnroot/ogreaddons/trunk/dotsceneformat/S
ource/Graphics%20Engine/trunk/main/SceneFormats/DotSceneFormat/Documentation/dot
Scene.dtd
Original comment by mohdakra...@gmail.com
on 26 Jun 2011 at 11:43
fixed in 0.4.4
Original comment by goatman.py@gmail.com
on 30 Jun 2011 at 6:57
Original issue reported on code.google.com by
mohdakra...@gmail.com
on 26 Jun 2011 at 3:22