instance an animation, need to activate it in non-linear way

   4617   4   1
User Avatar
Member
412 posts
Joined: July 2005
Offline
So I'm hoping this is capable, but i want to be able to activiate an animation through some kind of expression (probably if statement) linked to either a spare channel or chop or channel of any kind really. the simple expression should be no problem to get working, i.e. if(blablabla>=10,0,1), or something on those lines..

but what i am having problems with is how to activate an actual animation (series of bgeo's) with that expression in a non-linear type way. i know how to bring in the series through a file chop, but after that it becomes more difficult.

as a test, i rendered out a 14 frame bgeo series of a sphere pulsating (just getting larger and smaller again fast). now i want to bring that animation back in (file sop) and play it from frame 1 when i say so. what i have attempted so far is basically this:

1. create a sin wave in chops and exported to the pt0y channel of an add sop (the y direction of pt 0). this is just to have an animated channel originated from chops and brought in to sop level to reference from.

2. i then have two file sops plugged into a switch sop. the first file input is pointed to impulse0.bgeo, and the second file input is impulse`($F-1)%14`.bgeo. the $F-1 is because they start at 0, so at frame 1, it needs to be at 0. and the %14 is so it will loop over and over. so if i hit play at this point and slide my switch param from 0 to 1, it switches between the first still frame and the complete impulse animation.

3. now, in the switch input, i put the following expression: if((ch(“../add1/pt0y”))>=0,0,1) . when played back, the still frame is shown when pt0 from my add sop is above 0, and the animation is shown when it's below 0.

ok, now this is somewhat good. i have a sin wave generated in chops and it activates an animation whenever it's below 0. which is everything i wanted except for one thing. since the second switch file input is looping starting since frame 1, whenever my sin wave dips below 0 and the animation activates, it activates wherever the loop exists at that frame. and what i want is it to activate starting only at impulse0.bgeo. that is pretty much what i meant by it being non-linear. i want this channel to activate the animation from it's begining always. let it finish out it's animation and send it back to bgeo # 0 and sit there until activated again.

i don't know if this can be done through expressions or what, but i am dying trying to figure it out here. the only other thing i thought of was having 14 file sops (each sop would be the consecutive bgeo in the animation) plugged into the switch sop and somehow attempt it that way. no luck there either, but maybe someone else could do it. it would almost be nice if the file sop itself could take an expression. so i could just write if(blablabla, impulse0.bgeo, impulse$F.bgeo).

if anyone can help me on this one, that would be soooo great.

thanks everyone for reading the long post.

dave

oh, and one more thing. the actual animation doesn't have to exist within a series of bgeo's brought in from a file sop. it can actually exist in the same hip file in another obj or wherever. i just considered it that way to keep it cleaner and easier. so if it's easier to do that way, then im all ears.
Dave Quirus
User Avatar
Member
225 posts
Joined: July 2005
Offline
I think you can do the whole thing in chops, using a copy chop. Works a lot like the copy sop, Each time the source channel (template) reaches a threshold it will play the sequence from the start regardless of which frame you are on.

Fetch the file sop's file channel (one with expression) and copy it onto the sin chop. You'll need to reverse the sin wave since you want to trigger below 0
User Avatar
Member
7745 posts
Joined: July 2005
Offline
I haven't tried this before but in *any* string field, you can always use an expression if you enclose it in backticks (`). So try doing something like:
`if(blablabla, impulse0.bgeo, impulse$F.bgeo)` as the file name.
User Avatar
Member
225 posts
Joined: July 2005
Offline
i checked later and you'll need a geometry chop, not a fetch. It works fine though
User Avatar
Member
412 posts
Joined: July 2005
Offline
yea, i kinda ended up doing a montage of things.

after i noticed that fetching the file sop really had no curve, i went a different route. this was before i saw your geometry chop post talkien.

and the expression worked in the file sop edward. but had to be tweaked so that the expression was only containing the suffix of the filename and the prefix sat outside, before it. so it ended up looking like this:

impulse`(if(blablabla, 0, $F))`.bgeo

although, i completely forgot that it wouldn't matter anyways since it's still refering back to $F and is dependant upon the linear timeline of my project. so if i kept the expression that way, it would red error if past frame 14, and if i replaced $F with ($F%14), then it would just occur within some frame of the loop and not frame 1 of it.

so i ended up going the copy chop route, but slightly modified.

first i made 14 file sops, each pointing to the respective frame number. they all plugged into one switch.

i then went to chops and threw down a wave chop with “Constant” as it's type. I also set a ramp of 30 (i.e. so this matches my frame rate:30fps). so now i have a linear slope that at frame 14, it's at value 14. and 12 at 12. 5 at 5. and so on and so on. so i started the line at frame 0 and ended it at frame 13 and exported that to my switch sop. so now, if i go to sop space, my frame range animates via the switch driven by the wave chop at 30fps.

now i made another wave chop set to the default sin wave. i throw down a copy chop. plug the sine wave in to the template input of the copy chop. and finally plug my linear wave (ramped from 0 to 13) in to the copy input of the copy chop. export that to my switch sop and now whenever my sin wav crosses 0 in to the positive, it triggers my linear wave to drive the switch (or the animation).

so phew. that was a lot. but actually works very well and is pretty clean and simple. but that was the test with the sin wave. now on to using audio in place of it and getting it to be a little more complex. so now i will be using a combination of envelope, maths, copies, and sample rates. its getting confusing at times, but is getting very close to work.

thanks for all your help guys. ill let you know if there ends up being more. :wink:

dave
Dave Quirus
  • Quick Links