Skip to content

Commit

Permalink
use lightRange instead of spotLightRange to comply with DTD
Browse files Browse the repository at this point in the history
also move to correct position
  • Loading branch information
paroj committed Jun 27, 2017
1 parent c53115f commit 2f9664e
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions io_ogre/ogre/scene.py
Expand Up @@ -541,13 +541,6 @@ def dot_scene_node_export( ob, path, doc=None, rex=None,
a.setAttribute('y',str(round(-vector[1],3)))
a.setAttribute('z',str(round(-vector[2],3)))

if ob.data.type == 'SPOT':
a = doc.createElement('spotLightRange')
l.appendChild(a)
a.setAttribute('inner',str( ob.data.spot_size*(1.0-ob.data.spot_blend) ))
a.setAttribute('outer',str(ob.data.spot_size))
a.setAttribute('falloff','1.0')

if ob.data.use_diffuse:
a = doc.createElement('colourDiffuse'); l.appendChild( a )
a.setAttribute('r', '%s'%ob.data.color.r)
Expand All @@ -560,6 +553,13 @@ def dot_scene_node_export( ob, path, doc=None, rex=None,
a.setAttribute('g', '%s'%ob.data.color.g)
a.setAttribute('b', '%s'%ob.data.color.b)

if ob.data.type == 'SPOT':
a = doc.createElement('lightRange')
l.appendChild(a)
a.setAttribute('inner',str( ob.data.spot_size*(1.0-ob.data.spot_blend) ))
a.setAttribute('outer',str(ob.data.spot_size))
a.setAttribute('falloff','1.0')

a = doc.createElement('lightAttenuation'); l.appendChild( a )
a.setAttribute('range', '5000' ) # is this an Ogre constant?
a.setAttribute('constant', '1.0') # TODO support quadratic light
Expand Down

0 comments on commit 2f9664e

Please sign in to comment.