light energy

hi guys,
why if i set energy via python between 0.0 and 10.0 it works but if i set a value more than 10.0 the energy doesnt go over this value?
thx

I think this is a known issue and I’ve seen it before, although I don’t remember if any workaround exists. In the meantime I confirm the behavior…

The method for setting the light energy through python (pyattr_set_energy) on KX_Light objects is clamped at 10. It should be pretty simple to extend this range in the KX_Light.cpp source file, but would require compiling blender. If this is a feature that would be useful, I can change it and make a patch and/or submit it for code review. If “10” is insufficient, what maximum value would be appropriate?

-Jon

is it a maximum value something that is needed?

Well, 10.0 is also the maximum value you can set in Blender’s interface, and all objects near the light seem to be fully illuminated at that value. If you’re wanting the light to extend to objects further away, you can increase the distance property which seems to be unbounded.

in blender interface seems there isn’t a maximum value

Ah, you’re right. It’s only limited when using the slider, not when manually entering a value.

Not necessarily.

So, I removed the upper limit for the energy on KX_Light objects (as well as for the distance too). So the energy can be set through python to any positive number, and the distance any positive number 0.01 and up. I put the diff on pasteall.org for anyone that wants to patch blender with this behavior.

I’m not going to create a bug report as it appears to me that the current behavior is what’s intended. But feel free to use this diff for a report or feature request.

-Jon

Hmm. Interesting. Is the light’s distance clamped to a minimum value I wonder? I’ve noticed some strange effects when trying to set distance in python, namely that setting the distance sometimes changes the brightness.