Turn lighting on/off for entity

griminventions

23-01-2006 20:10:59

I'm trying to dynamically turn lighting on and off for an entity (mesh) so that it will appear full-bright so as to blink.

Can I use the functions mentioned in the API doc from subentity? Like subent.material.lightingEnabled = False
That doesn't seem to do anything. So I tried iterating over all the techniques of the material for each subentity, setting lightingEnabled for each, and that didn't do anything, either. I also tried to use selfIllumination but with no results. The model still receives light.

What am I doing wrong? :?
for i in range( mesh.numSubEntities ):
ent = mesh.getSubEntity( i )
for j in range( ent.material.numTechniques ):
tec = ent.material.getTechnique( j )
tec.lightingEnabled = False

dermont

24-01-2006 03:54:18

Try

tec.setLightingEnabled(False)

griminventions

24-01-2006 12:46:23

That did it. :) I guess that function isn't wrapped as a property yet.

Thank you, dermont! You get my vote as a PyOgre MVP. ;)