Maya Training

Introduction to Hard Surface Modeling

Maya Training

Interiors and Furniture Vol 1 & 2 - Modeling & Cloth

Maya Training

Shading, Lighting and Rendering the Bedroom in MR

Maya Training

Robot volume one - Modeling with animation in mind

Maya Training

Spach-Alspaugh House the complete courseware

Maya Training

Burt The Cartoon Dinosaur Vol 01 - Modeling

New Maya Training

Robot Volume 02 - Hybrid Rigging
You are here > Home > SimplyMaya Community Forums
Loading

Welcome to Simply Maya

Please Sign in or Sign up for an account

Member Login

Lost your password?

Not a member yet? Sign Up!

Old 12-08-2010, 11:10 AM   #1
Jay
Senior Modeler - Framestore
 
Jay's Avatar
 
Join Date: Feb 2003
Location: UK
Posts: 6,234
Thanks: 39
Thanked 425 Times in 381 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, 12:33 PM   #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, 01:33 PM   #3
Jay
Senior Modeler - Framestore
 
Jay's Avatar
 
Join Date: Feb 2003
Location: UK
Posts: 6,234
Thanks: 39
Thanked 425 Times in 381 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, 05:43 PM   #4
stwert
EduSciVis-er
 
Join Date: Dec 2005
Location: Toronto
Posts: 3,371
Thanks: 74
Thanked 709 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 05:46 PM.
stwert is offline   Reply With Quote
Old 13-08-2010, 10: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, 11:38 PM   #6
stwert
EduSciVis-er
 
Join Date: Dec 2005
Location: Toronto
Posts: 3,371
Thanks: 74
Thanked 709 Times in 642 Posts
Default

Sorry, what's SFA?
stwert is offline   Reply With Quote
Old 14-08-2010, 12:43 AM   #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, 06: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, 06:51 AM   #9
stwert
EduSciVis-er
 
Join Date: Dec 2005
Location: Toronto
Posts: 3,371
Thanks: 74
Thanked 709 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 06:53 AM.
stwert is offline   Reply With Quote
Old 14-08-2010, 07: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, 03:06 PM   #11
Jay
Senior Modeler - Framestore
 
Jay's Avatar
 
Join Date: Feb 2003
Location: UK
Posts: 6,234
Thanks: 39
Thanked 425 Times in 381 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, 05:05 PM   #12
stwert
EduSciVis-er
 
Join Date: Dec 2005
Location: Toronto
Posts: 3,371
Thanks: 74
Thanked 709 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

A little bit about who we are
Links you might find useful
Catch up with SimplyMaya
SimplyMaya specialises in Maya tutorials. We offer over 1,000 individual Maya training videos, ranging from basic Maya tutorials through to intermediate Maya tutorials. Our tutorials are created by instructors with industry experience and are designed to get you up and running in Maya quickly without making it seem like hard work.

Copyright © 1999-2015 SimplyMaya - vBulletin® Copyright © 2000-2015, Jelsoft Enterprises Ltd.