PDA

View Full Version : two REALLY annoying problems with my script


ScottyDoesntKnow
05-06-2006, 07:04 PM
Ok my first problem is that I have a window with a textscrollList in it. The textScrollList holds all the objects in the scene. However, the script will only append the shape nodes of the objects and not the transform. I tried to use the pickWalk command to grab the transform node but It wont let me for some odd reason.

textScrollList -e -ra objectTSL;
string $geometry[] = `ls -geometry`;
string $selectObject;

for($everyObject in $geometry)
{
select $everyObject;
$selectObject = `pickWalk -d up`;

textScrollList -e -append $selectObject objectTSL;
popupMenu -p objectTSL objectPop;
menuItem -l "Open AEWindow" -c openAEObject;
menuItem -l "Rename Object" -c renameObject;

}

There is two tsl's in my script. One to hold all the lights and the other to hold all the objects. For my second tsl ,that holds lights, whenever the user selects a light in the TSL ,via the selectCommand flag, below it will be some of the attributes of that light. The problem is when I select the first light then select another light the attributeGrp Controls stay connected to the old light.

So my question is how do I delete the controls at the beginning of the procedure so I can reattach them at the end? Basically it like refreshing a tsl. You remove all items and then use a loop to add them all in again. I just dont know how to delete the controls.

string $light[] = `listHistory`;
string $lightSelected[] = `textScrollList -q -si lightTSL`;
int $spotLightTrue = 0;
for($eachLight in $lightSelected)
{
window -e LE_Window;

// attrColorSliderGrp -at ($eachLight +".color") lightColorGrp;
attrFieldSliderGrp -min -100 -max 100 -attribute ($eachLight + ".intensity") "intensitySlider";

if($eachLight == "spotLightShape1")
{
attrFieldSliderGrp -min -100 -max 100 -attribute ($eachLight + ".coneAngle") coneAngleSlider;
attrFieldSliderGrp -min -100 -max 100 -attribute ($eachLight + ".penumbraAngle") penumbraAngleSlider;
attrFieldSliderGrp -min -100 -max 100 -attribute ($eachLight + ".dropoff") dropOffSlider;
print "debug Area 1 Complete";
$spotLightTrue = 1;
}
print "Debug Area 2 Complete";
formLayout -e
/*
-af lightColorGrp "right" 0
-af lightColorGrp "left" 0
-ac lightColorGrp "top" 0 mySep
*/

-af intensitySlider "left" 0
-ac intensitySlider "top" 0 mySep
-af intensitySlider "right" 0

myForm;

if($spotLightTrue)
{
formLayout -e

-af coneAngleSlider "left" 0
-af coneAngleSlider "right" 0
-ac coneAngleSlider "top" 0 intensitySlider

-af penumbraAngleSlider "left" 0
-af penumbraAngleSlider "right" 0
-ac penumbraAngleSlider "top" 0 coneAngleSlider

-af dropOffSlider "right" 0
-af dropOffSlider "left" 0
-ac dropOffSlider "top" 0 penumbraAngleSlider

myForm;
}

}

neonoodle
05-06-2006, 09:41 PM
the first problem with the pickWalk, I believe is because pickWalk returns a string array, and you have it going into a regular string. I don't know if you were able to get that to run at all, but it gave me an error, and when I converted the variable to an array, it worked.

the second question, the command to delete a control is:
deleteUI -control $controlName

ScottyDoesntKnow
05-07-2006, 07:56 PM
Oh I see. Thanks neonoodle for the information.

CGTalk Moderation
05-07-2006, 07:56 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.