[Closed] at time not updating 2008
OK I have had this problem before but can’t find the thread yet. I’m using at time to bake animation to a second layer of controllers. Problem is I’m not getting the anmation values returned correctly from the controllers. I just get one value. Funny thing is if I do a simple script just using at time f tm*inverse parent.tm I get a local changing value, but not when I’m trying to set the values I guess. Using slider time would be increadibly slow, suggestions?
It is definitly the collection of data not the setting. Works on all nodes but four. So right now the only way I can do it is sliderTime=f and then set the values using at time f.
Driving me nuts
I was once told by Autodesk that ‘at time’ could not fail because then that would mean that the scene would also not render correctly as it uses the same function.
[Jedi Mind trick]
At time is not broken.
[/Jedi Mind trick]
I know that helps you zero, but there you have it.
i think using slidertime = f should be ok if you add with redraw off at the begining of your loop. To test i quickly animated 2880 teapots moving around the scene over 100 frames and then run the following test scripts:
-- using at time
st = timestamp()
animate on for t = 0 to 100 do
at time t objects[random 1 objects.count].pos = [(random -100 100),(random -100 100),(random -100 100)]
end = timestamp()
format "processing took % seconds...
" ((end-st)/1000.0)
----------------------------------
-- using at time processing took 0.016 seconds...
----------------------------------
-- using slidertime
st = timestamp()
animate on for t = 0 to 100 do
(
slidertime = t
objects[random 1 objects.count].pos = [(random -100 100),(random -100 100),(random -100 100)]
)
end = timestamp()
format "processing took % seconds...
" ((end-st)/1000.0)
----------------------------------
-- using slidertime processing took 15.047 seconds...
----------------------------------
-- using slidertime with redraw off
st = timestamp()
animate on with redraw off for t = 0 to 100 do
(
slidertime = t
objects[random 1 objects.count].pos = [(random -100 100),(random -100 100),(random -100 100)]
)
end = timestamp()
format "processing took % seconds...
" ((end-st)/1000.0)
----------------------------------
-- using slidertime with redraw off processing took 0.078 seconds...
----------------------------------
as you can see using slidertime with redraw OFF is around 4-5 times slower than using at time BUT around 192 times faster than using slidertime with redraw ON.
hope it works for you – and FYI if you’re using slidertime then you don’t need to use at time as well.
Problem is if it doesn’t redraw it doesn’t update.
Thanks Kees, so you say at time isn’t broken…umm ok…I see…not broken…not broken…not broken…
I should point out as well, higher and lower in the hierarchy I have objects that are beng baked this way. So far I have not been able to determine what the difference is other then I added the four objects later in the process. Why that would make any difference I don’t know.
OK I think this was my doing. I out smarted my self…again! I use modifiers and CA defs to store the functions that script controllers call. This way all my code is nicely contained and I can do way more with it with lots less hassle.
So one of the functions that were being called stored the result to a local variable for use by a second function. This made it so I didn’t have to call the first function when trying to calculate the second. In real time with works but with the at time it does not. So in my current solution I’m just forcing the call to the first function from the second and it works as it should with at time.
[Voodoo chickenFoot=true eyeOfNewtFactor=10]
I’m going to have to rethink now what I’m doing.
[/Voodoo]
Just as another follow up even trying to write the variable to a param block parameter it doesn’t work. I have had to go to the source and pull the value from the object that was using it in the first place.