Page 1 of 2
Script request: change light intensity through a script
Posted: Fri Mar 28, 2014 5:28 am
by Rikk The Gaijin
Hi, I would like to being able to change the intensity of my HDR texture through a script, for example:
frame 1245 --> intensity 1.00
frame 1259 --> intensity 0.30
Is it possible?
Thank you
Re: Script request: change light intensity through a script
Posted: Sat Mar 29, 2014 12:11 am
by Rikk The Gaijin
Anyone?

Re: Script request: change light intensity through a script
Posted: Sat Mar 29, 2014 9:05 am
by grimm
Yes, I think it could be done.

It would probably be best to modify Roeland's animation render script and add this functionality to it.
Jason
Re: Script request: change light intensity through a script
Posted: Sun Mar 30, 2014 10:20 pm
by grimm
Hey Rikk,
Try this out and see if it works for you. You need to have a texture environment node connect to the render target and have the target selected for it to work. Let me know if you have any problems.
Jason
Re: Script request: change light intensity through a script
Posted: Sun Mar 30, 2014 11:18 pm
by Tugpsx
Thanks, this should come in handy. Maybe you could add an option to add the texture Environment if a node does not exist and connect it to the render target.
Code: Select all
local settings =
{
["renderTargets"] = octane.project.getSceneGraph():findNodes(octane.NT_RENDERTARGET),
}
-- no render targets available -> error out
if #settings.renderTargets == 0 then
error("no render targets to render in project:", projectPath)
else
-- create a texture environment node
texNode = octane.node.create{ type=octane.NT_ENV_TEXTURE, name="HDRI intensity" }
-- evaluate the texture node
texNode:evaluate()
Re: Script request: change light intensity through a script
Posted: Mon Mar 31, 2014 12:29 am
by Rikk The Gaijin
Hey grimm, this looks sweet! But I would like to see the result before start rendering, the script Roeland made changed the scene so I could see the result by just moving the marker on the animation bar, can you do that?
Re: Script request: change light intensity through a script
Posted: Mon Mar 31, 2014 12:39 am
by grimm
Thanks Tugpsx,
That would be a good addition.
Rikk,
Ah, I see, so you need the script to modify the animation and then get out of the way? I will look into it.
Jason
Re: Script request: change light intensity through a script
Posted: Mon Mar 31, 2014 2:17 am
by Rikk The Gaijin
grimm wrote:Thanks Tugpsx,
That would be a good addition.
Rikk,
Ah, I see, so you need the script to modify the animation and then get out of the way? I will look into it.
Jason
Thank you, I really appreciate it.

Re: Script request: change light intensity through a script
Posted: Mon Mar 31, 2014 9:06 am
by grimm
Hi Rikk,
Ok, here is a really rough script that should work. As always let me know if you have any problems with it. You need to have a texture environment node with a float value node connected to the power input pin. The script needs a lot of work still to make it easier to use and more reliable. Right now the start and end time is in frame numbers. When you set the start and end values for the power, every frame before the start will have the same power as the start value, and every frame after the end will equal the end value. The values between the start and end will be smoothly interpolated. Hopefully that isn't too confusing, it's easy to see when you run the script and look at the results. Once you pick the settings you want and select the "build animator" button, close the script and you should be able to scrub the animation and see the effect.
Jason
Re: Script request: change light intensity through a script
Posted: Tue Apr 01, 2014 2:51 am
by Rikk The Gaijin
Thanks a lot grimm, you rock!
