Digital humans the art of the digital double
Ever wanted to know how digital doubles are created in the movie industry? This course will give you an insight into how it's done.
# 1 12-08-2010 , 10:10 AM
Jay's Avatar
Lead Modeler - Framestore
Join Date: Feb 2003
Location: UK
Posts: 6,287

F Curve Question

Hi All

I have a small dilemma,
I have a car on a motion path but wish to duplicate it. At the moment the duplicate (with input connections) creates a second car but it shares the one fcurve so I can't offset the second car - does that makes sense? Is there a way of duplicating it but having control of its own fcurve. I could dupe the path but I have hundreds of cars and am looking for a clean solution.

cheers
J

# 2 13-08-2010 , 11:33 AM
bullet1968's Avatar
Lifetime Member
Join Date: Feb 2010
Location: Australia
Posts: 4,255
I dont know enough about it Jay but cant you (maybe Maya doesnt have it) use 'array' to make multi copies of the paths really quick???


bullet1968

"A Darkness at Sethanon", a book I aspire to model some of the charcters and scenes
# 3 13-08-2010 , 12:33 PM
Jay's Avatar
Lead Modeler - Framestore
Join Date: Feb 2003
Location: UK
Posts: 6,287
Not sure mate

we are looking at it here at work, we are just waiting for a TD to be hired but need a fast solution for some previz work we are currently doing

cheers
Jay

# 4 13-08-2010 , 04:43 PM
EduSciVis-er
Join Date: Dec 2005
Location: Toronto
Posts: 3,374
I've thought about the problem a bit, and I think the most efficient solution would be to write a script to handle it. But other than that, I can't really think of a simple solution (with relatively little experience in motion path animation). I've been trying to learn MEL/python, so maybe this would be a good chance to do some practice. I might give it a try after work today, but no guarantees I'll get anything to work :p

So you need ~100 cars on a single motion path, offset only in time?
That is, all the cars will follow the exact same line of motion, but at different times? Do they also need to vary in speed?


Last edited by stwert; 13-08-2010 at 04:46 PM.
# 5 13-08-2010 , 09:59 PM
bullet1968's Avatar
Lifetime Member
Join Date: Feb 2010
Location: Australia
Posts: 4,255
I know SFA stwert but I think thast what he needs. I thought along similar lines...a script that maybe has a random function in it. So car 1 = car 2 = etc etc and maybe another function as you say with different key frame points and frame speed if they need to be different speeds???

keep us posted?

cheers bullet


bullet1968

"A Darkness at Sethanon", a book I aspire to model some of the charcters and scenes
# 6 13-08-2010 , 10:38 PM
EduSciVis-er
Join Date: Dec 2005
Location: Toronto
Posts: 3,374
# 7 13-08-2010 , 11:43 PM
bullet1968's Avatar
Lifetime Member
Join Date: Feb 2010
Location: Australia
Posts: 4,255
Sweet F*** All mate LOL


bullet1968

"A Darkness at Sethanon", a book I aspire to model some of the charcters and scenes
# 8 14-08-2010 , 05:21 AM
Xander-0's Avatar
Registered User
Join Date: Feb 2005
Location: This Place
Posts: 220
Here's a script that will allow you to control an object's position on a path, based on some other object's position. This can be adapted to run objects at different speeds as well. Note - the objects will 'loop' around the ends of the curve (starting back at 0) once they reach the end of the curve (the curve is assumed to be in the range of 0->1)
I originally developed this to control tank treads. You should be able to dump it into the uValue parameter as an expression. I'm afraid you may be on your own for creating duplicate cars, though (never set that part up, I'm afraid).

//general form of equation:
When ((primary tread's path uValue) + (uValue moved from primary tread) less than 1):
(primary tread's uValue) + (uValue moved from primary tread);
Example:
if ((tread0Path.uValue) + (0) < 1) {
tread1Path.uValue = (tread0Path.uValue) + (0);

else:
subtract one from above
Example:
} else {
tread1Path.uValue = -1 + (tread0Path.uValue) + (0);
}


Book Wise

https://X4nd5r.deviantart.com
# 9 14-08-2010 , 05:51 AM
EduSciVis-er
Join Date: Dec 2005
Location: Toronto
Posts: 3,374
Alright, here's my script:

https://dl.dropbox.com/u/3447479/highwayMaker.py

It's python, and it may or may not work user added image

Start with a car, and a path, but not connected to it.
Run the script (in the editor or whatever) which will give a simple UI. Input the number of cars and the number of frames within which all the cars should traverse the path.
Then select the car, select the path, and hit execute.

The cars will begin at the start of the path at the current frame (so watch at what frame you hit execute) and randomly start moving down the path. They all go at the same speed (which is the number of frames/number of cars, you can modify the script to go more dense, more sparse, more randomly).

You can also modify axes, path parameters, max values etc in the script if need be, pretty simple stuff.

I don't know if this fits the bill (I didn't get many parameters to start with :p) but I learned a ton with this exercise about scripting, so I don't really care if no one can use it.


Last edited by stwert; 14-08-2010 at 05:53 AM.
# 10 14-08-2010 , 06:55 AM
bullet1968's Avatar
Lifetime Member
Join Date: Feb 2010
Location: Australia
Posts: 4,255
Xander and stwert...well done. It doesnt matter stwert..you had a go at it. Both of you well done...I must learn Python one day.

bullet


bullet1968

"A Darkness at Sethanon", a book I aspire to model some of the charcters and scenes
# 11 14-08-2010 , 02:06 PM
Jay's Avatar
Lead Modeler - Framestore
Join Date: Feb 2003
Location: UK
Posts: 6,287
dudes many thanks

I will have a look on monday at work.

cheers
Jay

# 12 14-08-2010 , 04:05 PM
EduSciVis-er
Join Date: Dec 2005
Location: Toronto
Posts: 3,374

Posting Rules Forum Rules
You may not post new threads | You may not post replies | You may not post attachments | You may not edit your posts | BB code is On | Smilies are On | [IMG] code is On | HTML code is Off

Similar Threads