PymelTutorial05

From cgwiki

05 - how to add 0.5 exposure to every light

Wayne keeps asking good questions, cmon everyone else!

Say I have a bunch of lights, and they all have different exposures. How can I add 0.5 to every light with pymel?

Based on what we know so far, we can get every light exposure like this:

[ x.exposure.get() for x in ls(type='phxAreaLight') ]


and we could set them all to the same value with .set()

[ x.exposure.set(2) for x in ls(type='phxAreaLight') ]


to take the current exposure and add a value, you nest the get() inside the set() call:

x.get()
# becomes
x.set(  x.get() + 0.5 )


so to add 0.5 to every light:

[ x.exposure.set( x.exposure.get() + 0.5 ) for x in ls(type='phxAreaLight') ]


similarly, to multiply every light exposure by 0.25:

[ x.exposure.set( x.exposure.get() * 0.25 ) for x in ls(type='phxAreaLight') ]