zachgrachan
04-11-2003, 06:00 PM
Hey all,
I am trying to write what seemed like it would be a simple script, but I am completely stuck. It's telling me that the object: " " can't be found....
Anybody got any ideas? thanks in advance.
/*
proc to do it lots of times
passed: string $a
this is the text from the textField, name of
the target
performs: performOrientConstraint
orient constrains multiple objects to one
target
returns: none
*/
global proc zgOrientMany (string $target)
{
string $sel [] = `ls -sl`;
string $current;
for ($current in $sel)
{
select -r $current;
select -tgl $target;
performOrientConstraint 0;
orientConstraint -w 1;
}
}
/*
A GUI to make life easier
passed: none
performs: GUI window to run zgOrientMany
returns: none
*/
global proc zgGUI ()
{
string $textfield = "objects";
global string $target = " ";
window -t "Some scripts";
columnLayout;
text -l " Orient mulitle objects to a single target ";
text -l " 1. First select all the objects to constrain: ";
text -l " 2. Then type in the name of the target: ";
textField -w 300 $textfield;
textField -q -tx $target;
button -w 300 -l " 3. Then Click this button."
-c "zgOrientMany $target";
setParent..;
showWindow;
}
//written by zach grachan
//email: webmaster@zgrachan.com
I am trying to write what seemed like it would be a simple script, but I am completely stuck. It's telling me that the object: " " can't be found....
Anybody got any ideas? thanks in advance.
/*
proc to do it lots of times
passed: string $a
this is the text from the textField, name of
the target
performs: performOrientConstraint
orient constrains multiple objects to one
target
returns: none
*/
global proc zgOrientMany (string $target)
{
string $sel [] = `ls -sl`;
string $current;
for ($current in $sel)
{
select -r $current;
select -tgl $target;
performOrientConstraint 0;
orientConstraint -w 1;
}
}
/*
A GUI to make life easier
passed: none
performs: GUI window to run zgOrientMany
returns: none
*/
global proc zgGUI ()
{
string $textfield = "objects";
global string $target = " ";
window -t "Some scripts";
columnLayout;
text -l " Orient mulitle objects to a single target ";
text -l " 1. First select all the objects to constrain: ";
text -l " 2. Then type in the name of the target: ";
textField -w 300 $textfield;
textField -q -tx $target;
button -w 300 -l " 3. Then Click this button."
-c "zgOrientMany $target";
setParent..;
showWindow;
}
//written by zach grachan
//email: webmaster@zgrachan.com
