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 27-01-2003, 02:52 AM   #1
Darkware
Subscriber
 
Darkware's Avatar
 
Join Date: Oct 2002
Location: USA
Posts: 1,172
Thanks: 0
Thanked 4 Times in 4 Posts
Default Dynamically driven gears.

I'm trying to animate a simple gear scene with dynamics, but can't get it to work. I have four gears all the same size and want them to rotate. I was thinking I could make three of them active rigid bodies with hinge constraints and have the other gear be a passive rigid body and simply rotate it, which in turn would rotate the others, but I cannot add an expression or key the rotate Y on the passive body. I tried breaking the connection, which usually works in most cases, but you apparently cannot do this when you're dealing with a rigid body. I know I could key all the gears, but it seems as though there should be a way to do it with dynamics. Any suggestions?
__________________
www.Darkware3D.com
Darkware is offline   Reply With Quote
Old 28-01-2003, 06:00 AM   #2
Calvin
Registered User
 
Join Date: Nov 2002
Location: Philippines
Posts: 134
Thanks: 1
Thanked 3 Times in 3 Posts
Default

Hi, Just a thought, if all the gears are the same size, and all rotations are the same speed, you could set it up with set driven keys instead of dynamics. Have the first gear as the driver, then all the other gears as driven. Just set it up so that if the first rotates clockwise (+value) then the next rotates counterclockwise (-value) and so on. Then all you have to do is key the first gear and the rest should follow.

Back to dynamics, you could try setting Passive Keys. Under the Soft/Rigid Bodies Menu you can set Passive keyframes for passive rigid bodies.

Hope this helps
Calvin is offline   Reply With Quote
Old 28-01-2003, 09:22 PM   #3
Darkware
Subscriber
 
Darkware's Avatar
 
Join Date: Oct 2002
Location: USA
Posts: 1,172
Thanks: 0
Thanked 4 Times in 4 Posts
Default

The set driven kay would probably be the best thing. I had forgotten about that. I actually did figure out how to set keys for the passive rigid body and everything worked. The only problem was that the gears didd not look right when they turned and sometimes one would fly away from its position for no apparent reason. But yes, I will do the set driven key thing. Thanks a lot Calvin!
__________________
www.Darkware3D.com
Darkware is offline   Reply With Quote
Old 28-01-2003, 10:47 PM   #4
ragecgi
Super Moderator
 
ragecgi's Avatar
 
Join Date: Sep 2002
Location: Minnesota, USA
Posts: 3,709
Thanks: 0
Thanked 13 Times in 12 Posts
Default

I'm not quite familiar with constraints, but couldn't you put a "nail" constraint in the pivot of each gear to keep the rigids in place while the colisions are happening?

I kind of agree that setDriven keys are the best and easiest way to go tho....
__________________
Israel "Izzy" Long
Motion and Title Design for Broadcast-Film-DS
izzylong.com
ragecgi is offline   Reply With Quote
Old 29-01-2003, 12:15 AM   #5
Darkware
Subscriber
 
Darkware's Avatar
 
Join Date: Oct 2002
Location: USA
Posts: 1,172
Thanks: 0
Thanked 4 Times in 4 Posts
Default

I used a hinge constraint, which allowed them to rotate properly, but they flew away from the constraint sometimes for no reason at all, which should not have happened.
__________________
www.Darkware3D.com
Darkware is offline   Reply With Quote
Old 29-01-2003, 01:38 AM   #6
Calvin
Registered User
 
Join Date: Nov 2002
Location: Philippines
Posts: 134
Thanks: 1
Thanked 3 Times in 3 Posts
Default

Glad I could help Darkware! I always say Set Driven Key is your best friend in MAYA...


Calvin is offline   Reply With Quote
Old 29-01-2003, 11:41 PM   #7
ryan_godridge
Registered User
 
ryan_godridge's Avatar
 
Join Date: Jan 2003
Location: Brighton UK
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Default Dynamically driven gears.

Hi Darkware,

You might like to try the howto on the AW site that uses the particle system to drive a gear which then drives a further gear.

I got it going with the first driving a second and then driving a third gear, great fun, all done with dynamics.

I had the same problem of gears flying off but in the end a bit of tweaking solved it all.

It's on AW 'community' 'howtos' 'dynamics howtos' - I've not given you a link cos it looks a bit like it's got sessionid info in.

Cheers

Ryan
ryan_godridge is offline   Reply With Quote
Old 30-01-2003, 04:39 AM   #8
Darkware
Subscriber
 
Darkware's Avatar
 
Join Date: Oct 2002
Location: USA
Posts: 1,172
Thanks: 0
Thanked 4 Times in 4 Posts
Default

Well, I was having too much trouble with set driven keys, so I chose a different path. I have decided to not use dynamics at all since they are turning out to be quite unreliable as far as animating gears go. I decided to use expressions, which gives me a perfect animation with no errors at all. I have 9 gears and can animate them all by rotating only one. What I am wanting to do now is make these gears rotate three wheels. Easy enough - just create a wheel for three gears and parent them to the specified gears. Here's the hard part. I want these wheels to turn a track. One similar to a walking machine, or more specifically - the tracks of a tank. This would be easy if the tracks went in a circle, but thet don't obviously. I'd like for the tracks to be made up of a bunch of flat cubes (rectangles actually) and have them rotate around so it looks like one big track. I want this to be linked via expressions to gear1, which is the gear that drives everything else. Is this even possible?
__________________
www.Darkware3D.com
Darkware is offline   Reply With Quote
Old 30-01-2003, 04:48 AM   #9
Darkware
Subscriber
 
Darkware's Avatar
 
Join Date: Oct 2002
Location: USA
Posts: 1,172
Thanks: 0
Thanked 4 Times in 4 Posts
Default

Here are the expressions used for the gears for those who care to know.....

(odd numbered gears)
Expression for gear2 - gear2.rotateX = -gear1.rotateX;
Expression for gear4 - gear4.rotateX = -gear1.rotateX;
Expression for gear6 - gear6.rotateX = -gear1.rotateX;
Expression for gear8 - gear8.rotateX = -gear1.rotateX;

(even numbered gears)
Expression for gear3 - gear3.rotateX = gear1.rotateX;
Expression for gear5 - gear5.rotateX = gear1.rotateX;
Expression for gear7 - gear7.rotateX = gear1.rotateX;
Expression for gear9 - gear9.rotateX = gear1.rotateX;

Fairly simply, see. The difference between the expressions for the odd and even gears is the negative and positive value for gear1.rotateX. Works like a charm.

EDIT* - Also, I plan to include larger and smaller gears. I figure I can link these to gear1 through expressions the same way. All I have to do is multiply gear1.rotateX by a number for a faster or slower rotation. (bigger gears will have to rotate faster, while smaller gears will have to rotate slower) I'm learning slowly but surely.
__________________
www.Darkware3D.com

Last edited by Darkware : 30-01-2003 at 04:51 AM.
Darkware is offline   Reply With Quote
Old 30-01-2003, 06:21 AM   #10
Calvin
Registered User
 
Join Date: Nov 2002
Location: Philippines
Posts: 134
Thanks: 1
Thanked 3 Times in 3 Posts
Default

Darkware, what trouble did you have with the SetDriven Keys? I've done the gear thing before and I usually get it to work in a few minutes as long as the gears are already built. Also, looking at the expressions, that's exactly what SDK does for you.

Calvin is offline   Reply With Quote
Old 30-01-2003, 06:30 AM   #11
ragecgi
Super Moderator
 
ragecgi's Avatar
 
Join Date: Sep 2002
Location: Minnesota, USA
Posts: 3,709
Thanks: 0
Thanked 13 Times in 12 Posts
Default

With the tread issue, I saw a tut somewhere, sorry can't remember where, but it talked about parenting the tracks to a simple circle, and deform the track/circle combo to the shape you want via a lattice, and the tracks were animated by the driver of the circle rotation within the lattice.

Sorry... does that make any sense?
__________________
Israel "Izzy" Long
Motion and Title Design for Broadcast-Film-DS
izzylong.com
ragecgi is offline   Reply With Quote
Old 30-01-2003, 11:31 AM   #12
Darkware
Subscriber
 
Darkware's Avatar
 
Join Date: Oct 2002
Location: USA
Posts: 1,172
Thanks: 0
Thanked 4 Times in 4 Posts
Default

That helps. I've never used lattices before, so I guess I'll dive into that.

About SDK's. I just couldn't get it to work quick. I fiddled around a bit, but no results. I'll have to take some time out and relearn how to do them again I guess. Another reasons I didn't choose SDK's was because it's harder to do a continuous animation. With the last tut I did, you could increase or decrease a single value to drive everything. The drawback however, was that this value could only be increased or decreased to -10 or 10. This makes it difficult to animate gears because they don't just rotate from -360 to 360 degrees. With expressions I knew all I had to do was rotate gear1 as much as I wanted and had no limit.

Can you do what I've done with expressions with SDK's? Because if you can, I'll try that out. Thanks for all the help again.
__________________
www.Darkware3D.com
Darkware is offline   Reply With Quote
Old 31-01-2003, 02:00 AM   #13
Calvin
Registered User
 
Join Date: Nov 2002
Location: Philippines
Posts: 134
Thanks: 1
Thanked 3 Times in 3 Posts
Default

Ok, here goes... Don't think I don't like expressions, but I'm just a big proponent of SDK's.

Assume you have 2 gears. Gear 1 is the driver, gear 2 is the driven. Load them both appropriately then select rotate X for both of them. Now hit the Key button in the SDK window. Select your first gear then rotate it 360 on X. Then select the second gear and rotate it -360 on X. Then hit Key again.

Now, set your keyframes on the X rotation of the 1st gear. Then go to the graph editor. Select the graph for the X rotation of the 1st gear then go to Curves > Post Infinity >Cycle. The animation should go on for ever and ever and ever....

To adjust the speed, just adjust the keyframes on Gear1, and the rest should follow.

Ok, so maybe SDK doesn't do EXACTLY what your expression does on it's own, but it does with a little help from Infinity Curves

Hope this helps some more.

Calvin is offline   Reply With Quote
Old 31-01-2003, 03:35 AM   #14
Darkware
Subscriber
 
Darkware's Avatar
 
Join Date: Oct 2002
Location: USA
Posts: 1,172
Thanks: 0
Thanked 4 Times in 4 Posts
Default

Izzy! That works perfectly! I figured out how to do it in mere seconds! You take a circle and a cube and position the cube on the edge of the circle. You then parent the cube to the circle so it moves with the rotation of the circle. Select both, then create a latice. Scale the lattice out, then scale the circle in for proper deformation with you rotate it, and walaa! The only problem I see right now is that the cube is being deformed too much. I'm sure if I play around with it enough I can get it perfect. Maybe increase the lattice size and decrease the circle - I don't know, I've just worked with it a few seconds.

Calvin, thanks again! I see what I was doing wrong the first time with SDK's. If you have Alias|Wavefront's Character Rigging and Animation book, you have probably gone through the chapter where you set up the animation of fingers with SDK's. The driver was a slider of some sort on a locator and the driven was the finger joints. This is what threw me off. For some reason I thought you were not able to use the rotation of an object for the driver. I only knew about the slider thing the chapter went over. Anyway, thanks for clearing things up!

Izzy - just thought of something. I wonder what would happen if I only put the circle in the lattice. You think that would still work? If it did, the cube would still move with the circle, but would not be deformed at all, which is good. *two minutes later* Nope. Didn't work. The cube rotates with the original form of the circle before it was put in the lattice. Oh well, I'll just play around some more and see what I can come up with.
__________________
www.Darkware3D.com
Darkware is offline   Reply With Quote
Old 31-01-2003, 03:59 AM   #15
Calvin
Registered User
 
Join Date: Nov 2002
Location: Philippines
Posts: 134
Thanks: 1
Thanked 3 Times in 3 Posts
Default

Again, Glad to help. I think I'll try that thing with the circle and lattice too...

:banana:
Calvin 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.