stupidvampire
10-05-2008, 07:05 PM
Ok first off. I'm a scripting n00b. I'm trying to create a script that will allow me to take an object, create multiple instances depending on the number of uv's the user has input, and then attach those instances to another object at the uv location. This is what I have so far:
//Procedures//
global proc XYZ_moveOnObject()
{
//generate U and V values based on Float sliders
float $U = `floatSliderGrp -q -value countObjectsU`;
float $V = `floatSliderGrp -q -value countObjectsV`;
//use pointOnSurface command to retrieve XYZ Worldspace coordinates
float $coordsXYZ[] = `pointOnSurface -u $U -v $V -position`;
move -ws $coordsXYZ[0] $coordsXYZ[1] $coordsXYZ[2];
}
global proc setTxFld()
{
string $myTextField = "textFieldName";
string $sel[] = `ls -sl`;
textFieldButtonGrp -e -tx $sel[0] $myTextField;
}
global proc setTxFld2()
{
string $myTextField2 = "textFieldName2";
string $sel[] = `ls -sl`;
textFieldButtonGrp -e -tx $sel[0] $myTextField2;
}
//Interface//
string $window = `window -title "JJFeatherSystem" -widthHeight 500 200 -s 0 -rtf 1`;
if (`window -exists $window`)
{ deleteUI -window $window; }
string $window = `window -title "JJFeatherSystem" -widthHeight 500 200 -s 0 -rtf 1`;
columnLayout -columnAttach "both" 10 -cw 500;
$TextFieldInst = `textFieldButtonGrp
-label "Instance :"
-text "Default"
-buttonLabel "set"
-bc setTxFld textFieldName`;
$TextFieldObj = `textFieldButtonGrp
-label "Object :"
-text "Default"
-buttonLabel "set"
-bc setTxFld2 textFieldName2`;
floatSliderGrp -label "U" -field true
-minValue -0 -maxValue 100.0
-fieldMinValue 2.0 -fieldMaxValue 100.0
-value 10 countObjectsU;
floatSliderGrp -label "V" -field true
-minValue -0 -maxValue 100.0
-fieldMinValue 2.0 -fieldMaxValue 100.0
-value 10 countObjectsV;
button -label "Instance and Orient" -c XYZ_moveOnObject;
showWindow $window;
////////////////////////
Any suggestions would be greatly appriciated, cause I'm stumped as to where to go from here. Thank you!
//Procedures//
global proc XYZ_moveOnObject()
{
//generate U and V values based on Float sliders
float $U = `floatSliderGrp -q -value countObjectsU`;
float $V = `floatSliderGrp -q -value countObjectsV`;
//use pointOnSurface command to retrieve XYZ Worldspace coordinates
float $coordsXYZ[] = `pointOnSurface -u $U -v $V -position`;
move -ws $coordsXYZ[0] $coordsXYZ[1] $coordsXYZ[2];
}
global proc setTxFld()
{
string $myTextField = "textFieldName";
string $sel[] = `ls -sl`;
textFieldButtonGrp -e -tx $sel[0] $myTextField;
}
global proc setTxFld2()
{
string $myTextField2 = "textFieldName2";
string $sel[] = `ls -sl`;
textFieldButtonGrp -e -tx $sel[0] $myTextField2;
}
//Interface//
string $window = `window -title "JJFeatherSystem" -widthHeight 500 200 -s 0 -rtf 1`;
if (`window -exists $window`)
{ deleteUI -window $window; }
string $window = `window -title "JJFeatherSystem" -widthHeight 500 200 -s 0 -rtf 1`;
columnLayout -columnAttach "both" 10 -cw 500;
$TextFieldInst = `textFieldButtonGrp
-label "Instance :"
-text "Default"
-buttonLabel "set"
-bc setTxFld textFieldName`;
$TextFieldObj = `textFieldButtonGrp
-label "Object :"
-text "Default"
-buttonLabel "set"
-bc setTxFld2 textFieldName2`;
floatSliderGrp -label "U" -field true
-minValue -0 -maxValue 100.0
-fieldMinValue 2.0 -fieldMaxValue 100.0
-value 10 countObjectsU;
floatSliderGrp -label "V" -field true
-minValue -0 -maxValue 100.0
-fieldMinValue 2.0 -fieldMaxValue 100.0
-value 10 countObjectsV;
button -label "Instance and Orient" -c XYZ_moveOnObject;
showWindow $window;
////////////////////////
Any suggestions would be greatly appriciated, cause I'm stumped as to where to go from here. Thank you!
