Page 1 of 1

How can I set PBR Unity Light Component properties by script

PostPosted: Fri Jul 19, 2019 4:02 pm
by neitron
Hi!
I want to set a few properties for Octane Light via PBR Unity Light Component by c# script, just before rendering the final image by Octane renderer.
The options:

// Octane light options available via the editor
Blackbody type
Power for the light
Temperature for the light
IES file for light distribution

// IES options are able to set from Octane but not by the PBR component in the editor. Please provide it through unity component
The 'Gama' for the IES file node
The 'Power' For the IES file node
The 'Projection' for the IES file node

In future, I wish to edit other options as well.
Is there any way to set it without reflection?

Re: Whow can I set PBR Unity Light Component properties by scrip

PostPosted: Fri Jul 19, 2019 9:13 pm
by jakemetz
+1 to this. The ability to use IES files from the Unity Editor to Octane would be a great boost to our pipeline!

Re: How can I set PBR Unity Light Component properties by script

PostPosted: Tue Jul 23, 2019 3:52 pm
by ChrisHekman
We have made PBR Unity Light Components public in the upcomming build. Which will allow you to access Octane.UnityLight and and OctaneUnity.PBRUnityLightComponent.
You should be able to retrieve the emissive node and the ies light node from C#.

Re: How can I set PBR Unity Light Component properties by script

PostPosted: Wed Jul 24, 2019 10:25 am
by neitron
Thank you very much for that!
But how about the projection node?
Could you please provide some examples of how to retrieve exact nodes?
Or maybe there is one tiny example that shows how to edit at least one property of unity light (temperature for example).

Re: How can I set PBR Unity Light Component properties by script

PostPosted: Wed Jul 24, 2019 7:55 pm
by jakemetz
That's great news! Thanks for including that Chris. Much appreciated.

Out of curiosity (so that we can plan), do you have an estimate for when the upcoming build might be released?

Re: How can I set PBR Unity Light Component properties by script

PostPosted: Fri Jul 26, 2019 4:05 pm
by neitron
neitron wrote:Thank you very much for that!
But how about the projection node?
Could you please provide some examples of how to retrieve exact nodes?
Or maybe there is one tiny example that shows how to edit at least one property of unity light (temperature for example).


Please unswerv to this one

Re: How can I set PBR Unity Light Component properties by script

PostPosted: Tue Jul 30, 2019 3:35 pm
by ChrisHekman
neitron wrote:
neitron wrote:Thank you very much for that!
But how about the projection node?
Could you please provide some examples of how to retrieve exact nodes?
Or maybe there is one tiny example that shows how to edit at least one property of unity light (temperature for example).


Please unswerv to this one


In the upcomming build you should be able to do something like this:

Code: Select all
Gameobject targetgameobject; //Your game object
var pbrLight =  targetgameobject.GetComponent<PBRUnityLightComponent>();
Octane.UnityLight OctaneLight = pbrLight.OctaneLight;
Octane.Node MaterialNode = OctaneLight.GetMaterial();
Octane.Node EmissionNode = MaterialNode.GetConnectedNode(Octane.P_EMISSION);
EmissionNode.SetPinFloat(Octane.P_POWER, 400);

Re: How can I set PBR Unity Light Component properties by script

PostPosted: Wed Jul 31, 2019 6:52 am
by mathaig
Hello, could we have an approximate date for the upcoming release ?