Need Slider for script

Hi all,

This is too advanced for my MEL knowledge.
But I am trying to make a "slider" attribute in the
channel box or a separate window for the following
command.
________________________
performPolyAverageVertex 0;
________________________
Reason why is because I am trying to
do an interactive ability to tighten my
verticies. I wanted the scale to go from
1-10 with 10 being the maximum pull.

Would this take a long time to do?
Is it possible?

Thanks in advance,

Phil

I don't think this is at all possible to do with that command. Another method to try would be to turn on History and run that command once. Now it will show up in your history and if you click on it, I think you can change the values and see the result. (don't know for sure, I havent tried it). I wish Maya offored more interactivity too.

Morris Olmsted
3D Designer @ Idol Minds LLC
molmsted@idolminds.com

Thanks for the reply. Guess I'll just
have to use Mirai for the meantime.
This tool would be the coolest thing
since sliced bread if it were embedded
as a Maya tool.

In that vein does Maya have anything similar to lightwave's bandsaw? (Plane Belt Selection/Devision)

Don't know, I've never used Lightwave. But there is a drawSplit tool for Maya.

Morris Olmsted
3D Designer @ Idol Minds LLC
molmsted@idolminds.com

here is what you want:

//**********************************************
string $pa_result[] = polyAverageVertex -i 0;

window averageVtxWindow;
string $form01 = formLayout;
string $button01 = button -l "update";
string $slider01 = intSlider -min 0 -max 10;
setParent ..;

formLayout -e
-af $button01 "top" 0
-af $button01 "left" 0

-af $slider01 "top" 0
-ac $slider01 "left" 0 $button01
-af $slider01 "right" 0
$form01;
window -e -h 48 -w 220 averageVtxWindow;
eval ("button -e -c ("updateVtxSlider " + $slider01 + "") " + $button01);
eval ("intSlider -e -s 1 -dc ("averageVtxSliderCommand " + $pa_result[0] + " " + $slider01 + "") " + $slider01);

showWindow averageVtxWindow;

global proc averageVtxSliderCommand(string $attrName, string $sliderName)
{
int $value = intSlider -q -v $sliderName;
setAttr ($attrName + ".iterations") $value;
}

global proc updateVtxSlider(string $sliderName)
{
string $pa_result[] = polyAverageVertex -i 0;
intSlider -e -v 0 $sliderName;
eval ("intSlider -e -s 1 -dc ("averageVtxSliderCommand " + $pa_result[0] + " " + $sliderName + "") " + $sliderName);
}
//**********************************************

this slider goes from 0 to 10. The update button resets the slider and uses the current selection for a new polyAverageVertex-command

enjoy

Holy $#!T.... all I can do for now is say "Thank you".

Stefan, you friggin Rock.
You don't know how many people I know
who can use this script. I'll be sure to let
them know who made it. =)

Hello Phil,

polyAverageVertex already has an interactive slider? As does most Maya attributes if you create them with history.

under polyAverageVertex highlight "Iterations" and MMB drag in a view panel to interactively change the value.

mmb attribute interactivity is uber-powerful without a lot of gui clutter

If you need more sensitivity to the slider, hold down the control key while mmb dragging

Thanks for the tip Clay. Everytime I do a modeling function now, I am going into the channel box and MMB+drag everything to see what and what isnt interactive lol!