CGTalk > Software > Autodesk 3ds max > 3dsMax SDK and MaxScript
Login register
Thread Closed share thread « Previous Thread | Next Thread »  
 
Thread Tools Search this Thread Display Modes
Old 03-19-2013, 04:23 PM   #1
splinterD
Frequenter
portfolio
daniel dulitzky
3d generalist and concept artist
miami, USA
 
Join Date: Feb 2005
Posts: 160
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-19-2013, 05:06 PM   #2
MatanH
Character TD
 
MatanH's Avatar
portfolio
Matan Halberstadt
Head of Rigging dpt.
snowball studios
Tel-Aviv, Israel
 
Join Date: Oct 2002
Posts: 379
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-19-2013, 06:25 PM   #3
splinterD
Frequenter
portfolio
daniel dulitzky
3d generalist and concept artist
miami, USA
 
Join Date: Feb 2005
Posts: 160
Interesting

interesting , I forgot about finding the speed of the object first ... Hahaha
Ok I'll give it a try soon , thanks !!
 
Old 03-20-2013, 12:43 AM   #4
splinterD
Frequenter
portfolio
daniel dulitzky
3d generalist and concept artist
miami, USA
 
Join Date: Feb 2005
Posts: 160
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-20-2013, 08:09 AM   #5
MatanH
Character TD
 
MatanH's Avatar
portfolio
Matan Halberstadt
Head of Rigging dpt.
snowball studios
Tel-Aviv, Israel
 
Join Date: Oct 2002
Posts: 379
Quote:
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-20-2013, 03:13 PM   #6
denisT
MAX Doctor
 
denisT's Avatar
portfolio
Denis Trofimov
CA, USA
 
Join Date: Jul 2009
Posts: 9,307
Send a message via ICQ to denisT
Quote:
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.


Quote:
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-21-2013, 12:52 PM   #7
splinterD
Frequenter
portfolio
daniel dulitzky
3d generalist and concept artist
miami, USA
 
Join Date: Feb 2005
Posts: 160
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-30-2013, 03:05 PM   #8
splinterD
Frequenter
portfolio
daniel dulitzky
3d generalist and concept artist
miami, USA
 
Join Date: Feb 2005
Posts: 160
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-31-2013, 07:21 PM   #9
splinterD
Frequenter
portfolio
daniel dulitzky
3d generalist and concept artist
miami, USA
 
Join Date: Feb 2005
Posts: 160
anything ? anyone ?
 
Old 03-31-2013, 07:21 PM   #10
CGTalk Moderation
Lord of the posts
CGTalk Forum Leader
 
Join Date: Sep 2003
Posts: 1,066,481
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.
__________________
CGTalk Policy/Legalities
Note that as CGTalk Members, you agree to the terms and conditions of using this website.
 
Thread Closed share thread


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 11:14 PM.


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