Chepri
11-18-2011, 02:02 PM
Hi guys,
I’m trying to make a scene with imbedded shelves so that I can give my scene to anyone and they’ll be able to use my tools that I incorporated onto a custom shelf.
if (`shelfLayout -exists "Project_Avatar_Tool"`)
{
print "You already have this shelf!";
}
else
{
addNewShelfTab "Project_Avatar_Tool";
global proc shelf_Project_Avatar_Tool ()
{
global string $gBuffStr;
global string $gBuffStr0;
global string $gBuffStr1;
shelfButton
-enableCommandRepeat 1
-enable 1
-width 34
-height 34
-manage 1
-visible 1
-preventOverride 0
-annotation "Sticky_Shelves_Test"
-enableBackground 0
-align "center"
-label "Test For Sticky Shelves"
-labelOffset 0
-font "plainLabelFont"
-imageOverlayLabel "TEST"
-overlayLabelColor 0.8 0.8 0.8
-overlayLabelBackColor 0 0 0 0.2
-image "commandButton.png"
-image1 "commandButton.png"
-style "iconOnly"
-marginWidth 1
-marginHeight 1
-command "polySphere -ch on -o on -r 93.777389 ;"
-sourceType "mel"
-commandRepeatable 1 ;
}
}
So this script Works, perfectly.
(For the people who want to use it: you have to use the expression editor to make it stick to the scene)
However I don’t need a sphere but a pop up menu like this:
{
window;
columnLayout;
button -label "button1";
button -label "button2";
showWindow;;
} I get a syntax error with whatever I try. It’s probably really simple but I just continue to but heads with it. If someone can help me, that would be great! T.T
I’m trying to make a scene with imbedded shelves so that I can give my scene to anyone and they’ll be able to use my tools that I incorporated onto a custom shelf.
if (`shelfLayout -exists "Project_Avatar_Tool"`)
{
print "You already have this shelf!";
}
else
{
addNewShelfTab "Project_Avatar_Tool";
global proc shelf_Project_Avatar_Tool ()
{
global string $gBuffStr;
global string $gBuffStr0;
global string $gBuffStr1;
shelfButton
-enableCommandRepeat 1
-enable 1
-width 34
-height 34
-manage 1
-visible 1
-preventOverride 0
-annotation "Sticky_Shelves_Test"
-enableBackground 0
-align "center"
-label "Test For Sticky Shelves"
-labelOffset 0
-font "plainLabelFont"
-imageOverlayLabel "TEST"
-overlayLabelColor 0.8 0.8 0.8
-overlayLabelBackColor 0 0 0 0.2
-image "commandButton.png"
-image1 "commandButton.png"
-style "iconOnly"
-marginWidth 1
-marginHeight 1
-command "polySphere -ch on -o on -r 93.777389 ;"
-sourceType "mel"
-commandRepeatable 1 ;
}
}
So this script Works, perfectly.
(For the people who want to use it: you have to use the expression editor to make it stick to the scene)
However I don’t need a sphere but a pop up menu like this:
{
window;
columnLayout;
button -label "button1";
button -label "button2";
showWindow;;
} I get a syntax error with whatever I try. It’s probably really simple but I just continue to but heads with it. If someone can help me, that would be great! T.T
