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?
How can I set PBR Unity Light Component properties by script
Moderator: ChrisHekman
- ChrisHekman
- 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#.
You should be able to retrieve the emissive node and the ies light node from C#.
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).
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 oneneitron 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).
- ChrisHekman
- Posts: 1062
- Joined: Wed Jan 18, 2017 3:09 pm
In the upcomming build you should be able to do something like this:neitron wrote:Please unswerv to this oneneitron 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).
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);