SimplyMaya Forums

Welcome to the forum, feel free to ask questions here.

Home / forum / Animation / Animation / F Curve Question
Register FAQ Members List Calendar Mark Forums Read

New Thread
 
Thread Tools
Old 12-08-2010, 10:10 AM   #1
Jay
Lead Modeler - Framestore
 
Jay's Avatar
 
Join Date: Feb 2003
Location: UK
Posts: 6,276
Thanks: 41
Thanked 428 Times in 384 Posts
Default 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
Jay is offline   Reply With Quote
Old 13-08-2010, 11:33 AM   #2
bullet1968
Lifetime Member
 
bullet1968's Avatar
 
Join Date: Feb 2010
Location: Australia
Posts: 4,255
Thanks: 158
Thanked 651 Times in 621 Posts
Default

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
bullet1968 is offline   Reply With Quote
Old 13-08-2010, 12:33 PM   #3
Jay
Lead Modeler - Framestore
 
Jay's Avatar
 
Join Date: Feb 2003
Location: UK
Posts: 6,276
Thanks: 41
Thanked 428 Times in 384 Posts
Default

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
Jay is offline   Reply With Quote
Old 13-08-2010, 04:43 PM   #4
stwert
EduSciVis-er
 
Join Date: Dec 2005
Location: Toronto
Posts: 3,373
Thanks: 74
Thanked 710 Times in 642 Posts
Default

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.
stwert is offline   Reply With Quote
Old 13-08-2010, 09:59 PM   #5
bullet1968
Lifetime Member
 
bullet1968's Avatar
 
Join Date: Feb 2010
Location: Australia
Posts: 4,255
Thanks: 158
Thanked 651 Times in 621 Posts
Default

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
bullet1968 is offline   Reply With Quote
Old 13-08-2010, 10:38 PM   #6
stwert
EduSciVis-er
 
Join Date: Dec 2005
Location: Toronto
Posts: 3,373
Thanks: 74
Thanked 710 Times in 642 Posts
Default

Sorry, what's SFA?
stwert is offline   Reply With Quote
Old 13-08-2010, 11:43 PM   #7
bullet1968
Lifetime Member
 
bullet1968's Avatar
 
Join Date: Feb 2010
Location: Australia
Posts: 4,255
Thanks: 158
Thanked 651 Times in 621 Posts
Default

Sweet F*** All mate LOL
__________________
bullet1968

"A Darkness at Sethanon", a book I aspire to model some of the charcters and scenes
bullet1968 is offline   Reply With Quote
Old 14-08-2010, 05:21 AM   #8
Xander-0
Registered User
 
Xander-0's Avatar
 
Join Date: Feb 2005
Location: This Place
Posts: 220
Thanks: 0
Thanked 2 Times in 1 Post
Default

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

http://X4nd5r.deviantart.com
Xander-0 is offline   Reply With Quote
Old 14-08-2010, 05:51 AM   #9
stwert
EduSciVis-er
 
Join Date: Dec 2005
Location: Toronto
Posts: 3,373
Thanks: 74
Thanked 710 Times in 642 Posts
Default

Alright, here's my script:

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

It's python, and it may or may not work

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.
stwert is offline   Reply With Quote
Old 14-08-2010, 06:55 AM   #10
bullet1968
Lifetime Member
 
bullet1968's Avatar
 
Join Date: Feb 2010
Location: Australia
Posts: 4,255
Thanks: 158
Thanked 651 Times in 621 Posts
Default

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
bullet1968 is offline   Reply With Quote
Old 14-08-2010, 02:06 PM   #11
Jay
Lead Modeler - Framestore
 
Jay's Avatar
 
Join Date: Feb 2003
Location: UK
Posts: 6,276
Thanks: 41
Thanked 428 Times in 384 Posts
Default

dudes many thanks

I will have a look on monday at work.

cheers
Jay
Jay is offline   Reply With Quote
Old 14-08-2010, 04:05 PM   #12
stwert
EduSciVis-er
 
Join Date: Dec 2005
Location: Toronto
Posts: 3,373
Thanks: 74
Thanked 710 Times in 642 Posts
Default

K, apparently I had an error with the window creation, which didn't show up until I re-opened Maya this morning.

So small update:
http://dl.dropbox.com/u/3447479/highwayMaker.py
stwert is offline   Reply With Quote
New Thread

« Previous Thread | Next Thread »

Thread Tools

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

1 Month

$34

Month-to-month billing
$34/month
Unlimited access to all videos
Project files to download
Easy to cancel at anytime
 
 

3 months

$87

Billing every 3 months
$29/month
Unlimited access to all videos
Project files to download
Easy to cancel at anytime
Save $5 per month or $15 in total compared to monthly billing with this package.

12 months

$288

Billing every 12 months
$24/month
Unlimited access to all videos
Project files to download
Easy to cancel at anytime
Save $10 per month or $120 in total compared to monthly billing with this package.

Your plan will automatically renew. You can cancel at any time via your PayPal account to avoid being charged again.

You can view the FAQ on our video plans here. You can contact us directly here. By clicking one of the buttons above, you agree to our Terms and Privacy Policy.