How can I set PBR Unity Light Component properties by script

A public forum for discussing and asking questions about the Octane for Unity Alpha

Moderator: ChrisHekman

Post Reply
neitron
Posts: 3
Joined: Fri Jul 19, 2019 3:42 pm

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?
Last edited by neitron on Fri Jul 19, 2019 9:14 pm, edited 1 time in total.
jakemetz
Posts: 4
Joined: Tue Oct 16, 2018 10:49 pm

+1 to this. The ability to use IES files from the Unity Editor to Octane would be a great boost to our pipeline!
ChrisHekman
OctaneRender Team
Posts: 1062
Joined: Wed Jan 18, 2017 3:09 pm

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#.
neitron
Posts: 3
Joined: Fri Jul 19, 2019 3:42 pm

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).
jakemetz
Posts: 4
Joined: Tue Oct 16, 2018 10:49 pm

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?
neitron
Posts: 3
Joined: Fri Jul 19, 2019 3:42 pm

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
ChrisHekman
OctaneRender Team
Posts: 1062
Joined: Wed Jan 18, 2017 3:09 pm

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);
mathaig
Posts: 21
Joined: Fri Jun 14, 2019 11:06 am

Hello, could we have an approximate date for the upcoming release ?
Post Reply

Return to “Octane for Unity”