STEAM GROUP
Open Source Filmmaker osfm
STEAM GROUP
Open Source Filmmaker osfm
367
IN-GAME
2,539
ONLINE
Founded
15 August, 2012
bernt 5 Dec, 2012 @ 4:53pm
Parametric Motion Script
I've been playing around with DAG scripts the last few days, came up with this script this afternoon. Basically, you select a node, enter some equations for X, Y, and Z, and then the script creates a path. This could be used (for example) to create a realistic trajectory, or a sine wave, circle, spiral, etc.

The script itself if super rough around the edges. I don't really know how useful it may be in practice but I'll toss it out to the public anyway.

See here for a visual overview[imgur.com]

To install:
-Download .py file here[dl.dropbox.com]
-Place the file in "[SourceFilmmaker]/game/platform/scripts/sfm/dag/exact/count1"

To use:
-Select a period of time in the motion editor.
-Right click a bone, go to DAG utilities, and select "parametric_motion"
-A dialog will pop up. Enter equations for X, Y, and Z (and rotations) in the variable 't'. The range for t is 0 <= t < nframes; t is equal to the number of frames elapsed since the first frame.
-Press OK, and the script will do its thing

Notes:
-Like I said, it's rough. It will probably crash if you give it invalid input, or do anything terribly out of the ordinary (also keep an eye out for math errors, ie div by 0, inputs outside a function's range, etc). You have been warned.
-The script uses python's 'eval()' for the equations, so any valid Python expression that returns a number should work. Refer to this page[docs.python.org] for a list of available math functions (you need not type "math." before each function).

Updated 4 April 2013
Last edited by bernt; 4 Apr, 2013 @ 10:16am
< >
Showing 1-2 of 2 comments
Iiuboto 4 Apr, 2013 @ 6:34am 
brilliant, thanks for sharing
can you update the download link please.
< >
Showing 1-2 of 2 comments
Per page: 1530 50