Forum Moderators: Staff
Poser Python Scripting F.A.Q (Last Updated: 2024 Sep 18 2:50 am)
You grab the parameter from the actor and then you can use Value() or SetValue() to read and write it.
Renderosity forum reply notifications are wonky. If I read a follow-up in a thread, but I don't myself reply, then notifications no longer happen AT ALL on that thread. So if I seem to be ignoring a question, that's why. (Updated September 23, 2019)
Its simple:
#----------------------------------------------------------------------------------
# DimLights.py
# Makes the light brighter or darker
#
# Date: 13.11.2023 19:31:50
# Letzte Aenderung: 13.11.2023 19:31:52
# Author: Bastep
# Contact: via Renderocity
#
# This is free to use.
#----------------------------------------------------------------------------------
import poser
def main():
light = poser.Scene().CurrentActor() # Retrieves the selected Actor from the scene.
if light.IsLight: # Is the Actor a light?
intensity = light.Parameter('Intensity') # Retrieves the intensity parameter from the parameter list
print(intensity.Value()) # Shows the current value
intensity.SetValue(0.5) # Assigns the new value. The values refer to 1. 1 = 100% intensity
print(intensity.Value()) # Shows the new value
if __name__ == "__main__":
main()
This site uses cookies to deliver the best experience. Our own cookies make user accounts and other features possible. Third-party cookies are used to display relevant ads and to analyze how Renderosity is used. By using our site, you acknowledge that you have read and understood our Terms of Service, including our Cookie Policy and our Privacy Policy.
I can write Python code to loop over the lights and tell if they're on or off. I can set them on or off. And I've just failed miserably at finding how to get and set the intensity. Sure looks like "Intensity" is the magic word, but I'm missing something.
For an individual light, I can access light.LightType, LightOn, SetLightOn, SetLightOff, but, sigh, I cannot find how to get/set intensity.
Has to be simple but I can't figure it out.
So -- what's the secret, eh?