|
thx!
I assume tho that I can’t have this run on startUp? I’ve tried putting it in the sourced init file for my script, but so far it’s just doing nothing :/
My source file looks like this:
global proc aw_init() {
source "aw_createShelf.mel";
source "aw_ctrlWin.mel";
source "aw_valWinA.mel";
source "aw_valWinB.mel";
source "aw_writeCtrls.mel";
source "aw_writeValA.mel";
source "aw_writeValB.mel";
source "aw_setLowCtrls.mel";
source "aw_setSpecAttr.mel";
source "aw_setSpine.mel";
source "aw_setArms.mel";
aw_createShelf; }
aw_init;
and the script for the shelf looks like urs, pretty much:
global proc aw_createShelf() {
//State gVars used;
global string $gShelfTopLevel;
//declare lVars necessary;
string $lVar_shelves[] = `tabLayout -q -childArray $gShelfTopLevel`;
string $lVar_shelfName = "AutoWalk" ;
int $lVar_shelfExists = false ;
//------
for($i in $lVar_shelves) {
if($i == $lVar_shelfName)
{
$result = true ;
}
}
//Check if the shelf already exists; if so, check if the button already exists. If both are true, do nothing.
//If the shelf is non-existant, add it, and the button. If only the button is missing, add only that.
if ($lVar_shelfExists = false)
{
addNewShelfTab "AutoWalk";
shelfButton -rpt true -i1 "commandButton.png" -l "Start" -ann "Initiates the ctrl & value dialogue" -c aw_ctrlWin -p "AutoWalk" ;
shelfButton -rpt true -i1 "commandButton.png" -l "doHip&Feet" -ann "Keys hip & feet ctrls" -c aw_setLowCtrls -p "AutoWalk" ;
shelfButton -rpt true -i1 "commandButton.png" -l "doSpec" -ann "Keys special Attributes for the foot ctrls" -c aw_setSpecAttr -p "AutoWalk" ;
shelfButton -rpt true -i1 "commandButton.png" -l "doSpine" -ann "Keys the spine ctrls" -c aw_setSpine -p "AutoWalk" ;
shelfButton -rpt true -i1 "commandButton.png" -l "doArms" -ann "Keys the arm ctrls" -c aw_Arms -p "AutoWalk" ;
}
}
It sources the scripts, and the global variables before that just fine, but on startup it just wont create the shelf (I dont have a shelf with that name either :P )
what am I missing?
Author: J.D.
|