Animate Entire Environment

Forums: Animate Entire Environment
Forum for OctaneRender Lua scripting examples, discussion and support.

Animate Entire Environment

Postby Notiusweb » Sat Jun 10, 2017 7:04 am

Notiusweb Sat Jun 10, 2017 7:04 am
Hello,
I took Beppe's Animate Value script and am trying to accomplish the following-

His script:
Modify (1) a single float value, from (2) start to (3) end, over (4) time period

I am trying to:
Modify (1) all pins in an entire environment node, from (2) start to (3) end, over (4) time period

Code: Select all
local AnimateValueScript = {}


local mStart
local mStop
local mSec
local mOutput


function AnimateValueScript.onInit(self, graph)
    graph:updateProperties({name = "AnimateEntireEnvironment"})

    -- create input linkers
    local inputs = graph:setInputLinkers
    {
        {
            type            = octane.PT_ENVIRONMENT,
            label           = "Start Value",
            defaultNodeType = octane.NT_ENV_DAYLIGHT,
            defaultValue    = 1
        },
        {
            type            = octane.PT_ENVIRONMENT,
            label           = "End value",
            defaultNodeType = octane.NT_ENV_DAYLIGHT,
            defaultValue    = 1
        },
        {
            type            = octane.PT_FLOAT,
            label           = "Time in seconds",
            defaultNodeType = octane.NT_FLOAT,
            defaultValue    = 10
        }
    }
    mStart      = inputs[1]
    mStop       = inputs[2]
    mSec        = inputs[3]
       
    -- create output linker
   local outputs = graph:setOutputLinkers
        {
            {
                type = octane.PT_ENVIRONMENT,
                label = "Animated Value",
                defaultNodeType=octane.NT_OUT_FLOAT
            }
        }
    mOutput = outputs[1]
 
end


function AnimateValueScript.onEvaluate(self, graph)
    local startVal  = mStart:getInputNode(octane.P_INPUT):getAttribute(octane.A_VALUE)
    local endVal    = mStop:getInputNode(octane.P_INPUT):getAttribute(octane.A_VALUE)
    local totalT    = mSec:getInputNode(octane.P_INPUT):getAttribute(octane.A_VALUE)
    local Output = octane.node.create
        {
            type       = octane.NT_ENV_DAYLIGHT,
            name       = "Ani Value",
            graphOwner = graph
        }
    Output:setAnimator(octane.A_VALUE, { 0 }, { startVal, endVal}, totalT[1])
    octane.changemanager.update()
    mOutput:connectTo(octane.P_INPUT, Output)
    AnimateValueScript:setEvaluateTimeChanges(true)
   
end


return AnimateValueScript



When I modified script to accomplish this environment pin morphing, it is telling me I can't index a nil figure. I imagine it has to do with the table not being able to take in all the data from the entire environment node's pins via the command I am giving it.
But I am now curious, is this even possible, to set an entire placeholder environment node (all floating & boolean sub-nodes and all), and then have that be read and fed into the active environment node channel, with the timeline, like Beppe was able to do with the single float value.

I was able to establish the physical shell (I have to select Daylight or texture), and it connects out to the environment node of a render target, but it never establishes the animation timeline like the working script from Beppe.


If anyone can give some insight that would be great. I am curious if I cannot do this at all, and what might make this work.

EntireEnvironment.jpg


THANKS!
Notuiusweb
Win 10 Pro 64, Xeon E5-2687W v2 (8x 3.40GHz), G.Skill 64 GB DDR3-2400, ASRock X79 Extreme 11
Mobo: 1 Titan RTX, 1 Titan Xp
External: 6 Titan X Pascal, 2 GTX Titan X
Plugs: Enterprise
User avatar
Notiusweb
Licensed Customer
Licensed Customer
 
Posts: 1233
Joined: Mon Nov 10, 2014 4:51 am

Re: Animate Entire Environment

Postby Notiusweb » Sat Jun 10, 2017 7:04 pm

Notiusweb Sat Jun 10, 2017 7:04 pm
Maybe I need to instruct the script to create the nodes, and not just reference them?
I see that is a common thing that comes up...
I guess only time will tell...Or will it...yes, it will. No wait...it might not?

Hmmm...Does anyone know a Lua script to go into the future?
Win 10 Pro 64, Xeon E5-2687W v2 (8x 3.40GHz), G.Skill 64 GB DDR3-2400, ASRock X79 Extreme 11
Mobo: 1 Titan RTX, 1 Titan Xp
External: 6 Titan X Pascal, 2 GTX Titan X
Plugs: Enterprise
User avatar
Notiusweb
Licensed Customer
Licensed Customer
 
Posts: 1233
Joined: Mon Nov 10, 2014 4:51 am

Re: Animate Entire Environment

Postby grimm » Sat Jun 10, 2017 10:04 pm

grimm Sat Jun 10, 2017 10:04 pm
can't index a nil figure


This usually means that you are trying to access a variable that doesn't exist. I would double check your code for misspellings or where you might be attempting to assign data of different types.

Jason
Linux Mint 19 x64 | Nvidia GTX 980 4GB (displays) RTX 2070 8GB| Intel I7 5820K 3.8 Ghz | 32Gb Memory | Nvidia Driver 440.59
User avatar
grimm
Licensed Customer
Licensed Customer
 
Posts: 1215
Joined: Wed Jan 27, 2010 8:11 pm
Location: Spokane, Washington, USA

Re: Animate Entire Environment

Postby Notiusweb » Sun Jun 11, 2017 2:21 am

Notiusweb Sun Jun 11, 2017 2:21 am
grimm wrote:
can't index a nil figure


This usually means that you are trying to access a variable that doesn't exist. I would double check your code for misspellings or where you might be attempting to assign data of different types.

Jason


Hello, thank you very much for giving some feedback to me! I appreciate that very much.
I understand what you are saying about the misspellings. Beppe wrote the base script, and I know that Octane developers and team do in fact have terrible spelling, so I will double check this. I also understand what you are saying about assigning data of different types. I thought I was being inclusive and unbiased in this approach. But I now realize I may inadvertently have been the prejudiced one in this equation...

Maybe there is some force that does not want me to animate, or "change" the environment. Maybe it is all a neo-fascist conspiracy to hush those bringing attention to the environment, but I will put this aside for now.
What I see is that the Environment node is not "a value", as in a single value, but rather an array of values, or a list of values, a collection, a grouped package of some sort. I think I need to look into how to get the linkage from the node to the animator, by having all the pins of data be connected, welcomed, if you will...A big happy family of values sitting at the table of data. I will use all of my psychic powers and press on.
Thank you for your explanation!
-Notiusweb
Win 10 Pro 64, Xeon E5-2687W v2 (8x 3.40GHz), G.Skill 64 GB DDR3-2400, ASRock X79 Extreme 11
Mobo: 1 Titan RTX, 1 Titan Xp
External: 6 Titan X Pascal, 2 GTX Titan X
Plugs: Enterprise
User avatar
Notiusweb
Licensed Customer
Licensed Customer
 
Posts: 1233
Joined: Mon Nov 10, 2014 4:51 am

Re: Animate Entire Environment

Postby Notiusweb » Sun Jun 11, 2017 1:43 pm

Notiusweb Sun Jun 11, 2017 1:43 pm
LOL...
In progressing and testing I came up with a script that crashes Octane, predictably as soon as it is run...
Wonderful!
Win 10 Pro 64, Xeon E5-2687W v2 (8x 3.40GHz), G.Skill 64 GB DDR3-2400, ASRock X79 Extreme 11
Mobo: 1 Titan RTX, 1 Titan Xp
External: 6 Titan X Pascal, 2 GTX Titan X
Plugs: Enterprise
User avatar
Notiusweb
Licensed Customer
Licensed Customer
 
Posts: 1233
Joined: Mon Nov 10, 2014 4:51 am

Re: Animate Entire Environment

Postby Notiusweb » Wed Jun 14, 2017 2:18 pm

Notiusweb Wed Jun 14, 2017 2:18 pm
Closing in...

My issue is that I know how to link a single value, but not the node in its entirety. Meaning, I wanted to link the environment node itself as the single 'value'.

Well, take a look at this:

[ Play Quicktime file ] CarCombiner(3).mp4 [ 5.07 MiB | Viewed 2083 times ]

Win 10 Pro 64, Xeon E5-2687W v2 (8x 3.40GHz), G.Skill 64 GB DDR3-2400, ASRock X79 Extreme 11
Mobo: 1 Titan RTX, 1 Titan Xp
External: 6 Titan X Pascal, 2 GTX Titan X
Plugs: Enterprise
User avatar
Notiusweb
Licensed Customer
Licensed Customer
 
Posts: 1233
Joined: Mon Nov 10, 2014 4:51 am

Return to Lua Scripting


Who is online

Users browsing this forum: No registered users and 1 guest

Fri Apr 10, 2020 7:30 am [ UTC ]