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.
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?
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
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);
}
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.
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