Introduction to Maya - Rendering in Arnold
This course will look at the fundamentals of rendering in Arnold. We'll go through the different light types available, cameras, shaders, Arnold's render settings and finally how to split an image into render passes (AOV's), before we then reassemble it i
# 1 08-06-2003 , 09:32 PM
Alan's Avatar
Moderator
Join Date: Oct 2002
Location: London, UK
Posts: 2,800

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!! user added image 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
# 2 08-06-2003 , 10:07 PM
Darkware's Avatar
Subscriber
Join Date: Oct 2002
Location: USA
Posts: 1,172
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?

# 3 08-06-2003 , 10:09 PM
Alan's Avatar
Moderator
Join Date: Oct 2002
Location: London, UK
Posts: 2,800
could you explain roughly how to do that?


Technical Director - Framestore

Currently working on: Your Highness

IMDB
# 4 08-06-2003 , 11:05 PM
Darkware's Avatar
Subscriber
Join Date: Oct 2002
Location: USA
Posts: 1,172
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.

Posting Rules Forum Rules
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

Similar Threads