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 08-06-2003, 10:32 PM   #1
Alan
Moderator
 
Alan's Avatar
 
Join Date: Oct 2002
Location: London, UK
Posts: 2,800
Thanks: 0
Thanked 5 Times in 5 Posts
Default Simple Slider Control

Hi guys I want to create a simple slider control to control the rotations of a group of objects and I am finding this really hard for some reason!! from the MEL command reference I got this code:

window;
columnLayout -adjustableColumn true;
floatSlider -min -25 -max 25 -value 0 -step 1;
showWindow;

And that's fine, exactly what I want! Now how the heck do i get the value that the slider is set to when it's dragged? Do i need a procedure to do this?!

Please guys any help is greatly appreciated.

Alan
__________________
Technical Director - Framestore

Currently working on: Your Highness

IMDB
Alan is offline   Reply With Quote
Old 08-06-2003, 11:07 PM   #2
Darkware
Subscriber
 
Darkware's Avatar
 
Join Date: Oct 2002
Location: USA
Posts: 1,172
Thanks: 0
Thanked 4 Times in 4 Posts
Default

I don't know much about mels and the like, so I'm no help there. Why don't you just set up a set driven key for the group?
__________________
www.Darkware3D.com
Darkware is offline   Reply With Quote
Old 08-06-2003, 11:09 PM   #3
Alan
Moderator
 
Alan's Avatar
 
Join Date: Oct 2002
Location: London, UK
Posts: 2,800
Thanks: 0
Thanked 5 Times in 5 Posts
Default

could you explain roughly how to do that?
__________________
Technical Director - Framestore

Currently working on: Your Highness

IMDB
Alan is offline   Reply With Quote
Old 09-06-2003, 12:05 AM   #4
Darkware
Subscriber
 
Darkware's Avatar
 
Join Date: Oct 2002
Location: USA
Posts: 1,172
Thanks: 0
Thanked 4 Times in 4 Posts
Default

Select your group. Choose Modify>Add Atribute. Under the "new" tab, type in the attribute's name. (rotateYaxis or something like that) Check the "Make Attribute Keyable" box, make sure the data type is "float", and make sure the attribute type is "scalar." Type in 0 for Minimun value, 10 for maximum, and 0 for default. Press ok. In the channel box, you will see a new attribute for your group.

Now that you have your attribute, it's time to set up a set driven key. With your group selected, choose Animate>Set Driven Key>Set options box. With set driven key, you use one thing to "drive" another. The top section of the window shows the driver - the thing that will drive the driven. The bottom section of the window shows the driven - the thing that will be driven by the driver. (Say that ten times fast.)

Ok, since you had your group selected already, it should appear in the bottom section. The bottom right-hand box shows all the attributes of your group. Since we want to set up a slider for the rotation on the Y axis, select rotateY. Now click "Load Driver" at the bottom. Since we had the group selected, it is now the driver as well. In the upper right-hand box, select rotateYaxis or whatever you named the new attribute we created.

We now have everything set up. Next, is the hard part that most people mess up on. Do this carefully. Rotate your group however you want it when the slider is at 0. (for this example we will assume your group's rotateY is at 0) Press the "Key" button near the bottom. This tells Maya that when rotateYaxis is at 0, the rotateY of your group is 0. In the channel box, change rotateYaxis to 10. Using the rotate tool, rotate your group however you want it to be when rotateYaxis is at 10. Press the "Key" button once again. Press "Close."

We're done. Now to use the slider, select rotateYaxis in the channel box. The words "rotateYaxis" should be highlited in black. Hold your mouse over your group in perspective view and middle-mouse drag to the right. Your group rotates according to the values you set for the set driven key.

Truthfully, sliders are not really neccesary in my opinion unless you're doing a lot of animating. Sometimes, it would just be easier to type in the value for rotateY rather than go through this process to create a new attribute and set up a set driven key. BUT, you wanted a slider for rotateY, so I gave you one. You can create a slider for each axis if you like.
__________________
www.Darkware3D.com
Darkware 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.