Python | Light Values: Intensity (Luminous) and Temperature (Kelvin)

Python | Light Values: Intensity (Luminous) and Temperature (Kelvin)

5inch
Contributor Contributor
655 Views
2 Replies
Message 1 of 3

Python | Light Values: Intensity (Luminous) and Temperature (Kelvin)

5inch
Contributor
Contributor

Hi Vred Pros,

 

brief and simple question I guess?

 

In Vred Pro 2022.1,

I need to edit Light Values: Intensity (Luminous) and Temperature (Kelvin).

LightEditor.png

I tried:

 

light = getSelectedNode()

temperatureValue = vrFieldAccess(light.fields().setReal32("intensity", 123.456))

temperatureValue = vrFieldAccess(light.fields().setUInt16("temperature", 5000))

 

 

but this seems not to work.

Can you please drop a tip for me.

 

Many thanks,

Best regards!

0 Likes
Accepted solutions (1)
656 Views
2 Replies
Replies (2)
Message 2 of 3

michael_nikelsky
Autodesk
Autodesk
Accepted solution

You can´t really access this with the old python interface since that is very low level and just gives you the internally stored values. You should use the new python interface for this, the vrdBaseLightNode should provide all you need:

 

file:///C:/Program%20Files/Autodesk/VREDPro-14.1/doc/v2/class_vrdBaseLightNode.html#vredvrdbaselight...

 

So simple something like this should do what you want:

pointLight = vrNodeService.findNode("point light")
pointLight.setLightUnit(vrLightTypes.Unit.Lumen)
pointLight.setIntensity(500.0)
pointLight.setUseLightTemperature(true)
pointLight.setTemperature(4000)

 

 



Michael Nikelsky
Sr. Principal Engineer
Message 3 of 3

5inch
Contributor
Contributor

oh, thanks for the super fast reply!

Easy solution, I did not see this in the docs, sorry for this.

Have a great week Michael.

Best support as always!

Cheers!

0 Likes