Forum: Poser Python Scripting


Subject: Getting/Setting Intensity for a light?

OberonRex opened this issue on Nov 13, 2023 ยท 5 posts


Bastep posted Mon, 13 November 2023 at 12:46 PM

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()