2009

Table Of Contents
Executing the procedure
The makeRoll procedure requires arguments to execute. To link it to the
window, you must get the values for the arguments from the controls in the
user interface, and execute the makeRoll procedure with these arguments.
To get the values of the controls, you must use the query flag. The query flag
allows commands to return values of attributes in the scene.
To query a value in the user interface
1 Change the value of the diameter slider to 10.01 by dragging the slider
to the right, or by typing a value in the diameter sliders text field.
2 Print the value of the diameter slider by typing the following in the
tempMEL tab:
print ("The diameter is: " + `floatSliderGrp -query -value
$diameter_float`);
The following is output to the Script Editor
The diameter is: 10.01
The query flag allows you to output a value to the Script Editor.
Change the command flag of the button so that it calls makeRoll command
with arguments values that are the same as the specified values in the user
interface.
To link the button to the makeRoll procedure
1 Replace the command flag of the execution button block in the MEL2
tab (approximately line 57) with the following:
-command "makeRoll \ `textField -query -text $obj_name_text` \
`intSliderGrp -query -value $ground_int` \ `checkBox -query -
value $box_sim_checkbox` \ `floatSliderGrp -query -value $diamet
er_float`;"`;
640 | Chapter 13 Scripting in Maya