controlling point cache playback speed with object travel speed ?

Become a member of the CGSociety

Connect, Share, and Learn with our Large Growing CG Art Community. It's Free!

THREAD CLOSED
 
Thread Tools Search this Thread Display Modes
Old 03 March 2013   #1
controlling point cache playback speed with object travel speed ?

hey guys im looking for a way to control point cache playback speed
via object travel speed

im trying to make a very simple crowd workflow
i was planning on using objects with cached animation , lets say walk cycle
and controlling the speed the animation is played by the speed the object is moving

from what i can see so far i think the way to go is with the "playback graph" option
in playback type rollout

but im not completely sure on how to control that via maxscript

my first idea is to define the correct or "base" speed that looks good with the animation used.
then using a script controller change the speed according to difference in speed compared to the "base" speed .

but im having trouble connecting it to the modifier .

any and all ideas or thoughts would be extremely welcome
 
Old 03 March 2013   #2
As far as I know, the only way to solve things like this is by a script (or something more powerful) since this is history dependent. So I would add a script controller to the playback graph subanim.
This is the pseudo code for the script controller:
  • currentVelocity = currentPos - previousPos
  • newValue = lastValue + currentVelocity * multiplier
  • lastValue = newValue
  • return newValue
you will have to hold a variable in the controller to store the lastValue variable
 
Old 03 March 2013   #3
Interesting

interesting , I forgot about finding the speed of the object first ... Hahaha
Ok I'll give it a try soon , thanks !!
 
Old 03 March 2013   #4
i had an idea of dropping a waveform controller on the "playback frame" of the point cache
because then i would just need to work with the "period" value of the waveform controller
and not mess around with frame numbers , and its good for looping animation.
but i cant find any way of gaining access to the waveform controller via maxscript or wiring
...
back to the drawing board
 
Old 03 March 2013   #5
Originally Posted by splinterD: i had an idea of dropping a waveform controller on the "playback frame" of the point cache
because then i would just need to work with the "period" value of the waveform controller
and not mess around with frame numbers , and its good for looping animation.
but i cant find any way of gaining access to the waveform controller via maxscript or wiring
...
back to the drawing board


I don't remember if I ever tried accessing the waveform controlling via script, but you could easily create your own periodic controller with a simple expression controller using a sin() function. It would also be very efficient.
 
Old 03 March 2013   #6
Originally Posted by splinterD: i had an idea of dropping a waveform controller on the "playback frame" of the point cache because then i would just need to work with the "period" value of the waveform controller and not mess around with frame numbers , and its good for looping animation.


Originally Posted by TzMtN: you could easily create your own periodic controller with a simple expression controller using a sin() function.


am i missing anything? is it not just simple as to set controller's the After Out-of-Range type (ORT) to #loop or #relativeRepeat?
 
Old 03 March 2013   #7
so i set the playback type to "playback graph"
create 2 key frames for start of animation and end of animation
then code something like this :
setAfterORT $Sphere001.modifiers[#Point_Cache].playbackFrame.controller #loop

and then move the last keyframe to control the speed of the animation via max script ?
 
Old 03 March 2013   #8
i played with the idea of just creating 2 keyframes for the point cache modifier playback frame
and tried to move the second keyframe according to a value that right now im getting form
a ExposeTransform distance

my testing file

and it seams to freeze max
i was trying something like this:
while distance > 0 do keyframe2 = distance (pseudo code)

is that the right way to do it ?

i also tried to wire the playback frame to the distance value
it worked but i lost the out of range looping option

can i define in the wire parameters the value to loop or cycle on top of the
distance or speed and playback frame calculation ??

and if so is either one better than the other for large number of objects in performance ?
 
Old 03 March 2013   #9
anything ? anyone ?
 
Old 03 March 2013   #10
Thread automatically closed

This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.
 
Thread Closed share thread



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
CGSociety
Society of Digital Artists
www.cgsociety.org

Powered by vBulletin
Copyright 2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump
Miscellaneous

All times are GMT. The time now is 09:11 AM.


Powered by vBulletin
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.