View Full Version : Custom joint size slider
07-09-2005, 04:29 AM
I'm trying to duplicate the joint size slider (that can be found under Display -> Joint Size -> Custom...) for a set of rigging tools I'm putting together. The code I came up with seems to be correct as far as syntax goes, but the slider won't change the joint size. Here is the code I have:
$size = `floatSliderGrp -q -v floatSliderGrp1`;
jointDisplayScale -ikfk $size;
So the value of the slider should be going into $size, and then that value will be applied to the jointDisplayScale command. The slider works just fine, but it wont change the joint size. I figure that there should be a way to do this, since Maya already has such a slider. Any help would be appreciated. Thanks,
07-09-2005, 08:47 AM
What you need is jdsWin.mel:
global proc jdsReset()
floatSliderGrp -e -v 1.0 jdswidget;
global proc jdsWin()
$jdsVal1 = `jointDisplayScale -q`;
if ( `window -ex jdsWnd` )
// -wh 242 100
// -w 242
-t "Joint Display Scale"
-cw 1 60
-cw 2 300
-dc "jointDisplayScale #1"
-cc "jointDisplayScale #1"
-af jdscol top 3
-af jdscol left 3
-af jdscol right 3
-af jdscol bottom 3
07-09-2005, 02:43 PM
Thank you. After looking at that code, I see that my code was basically backwards. I fixed it, and it now works fine. I appreciate the help.
07-09-2005, 02:49 PM
Actually, there is one more thing that didn't make sense to me. In the part of the code where it is setting the paramteres for the slider, where it has the "-dc "and "-cc", I know that it is setting the command for the slider to execute when it moves. But it says "jointDisplayScale #1", and I dont understand what the #1 is for and what it does. Obviously it wont work without it, but what does the # and 1 refer to?
07-11-2005, 03:50 AM
But it says "jointDisplayScale #1", and I dont understand what the #1 is for and what it does.
Good question. Because I have no idea ;-)
I'll try to find out.
07-11-2005, 12:29 PM
"#1" refers to the current value of the floatSliderGrp. it's kind of like
"this.value1". this syntax is mentioned somewhere deep within the maya
mel help docs. if a ui element has multiple
fields/checkboxes/radiobuttons/etc, you can use the values of each by
referring to #1, #2, #3 and so on.
(From Chad at Luna pictures)
07-11-2005, 12:29 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.