RavenEye
06-07-2007, 03:27 PM
Ok this morning my code was all working without a textFieldButtonGrp but I'm expanding my script to include a textFieldButtonGrp and now I get // Error: Object is not a child: //. Since the only new part of my code was the textFieldButtonGrp, so I'm wondering can you put a textFieldButtonGrp in a form layout or do I have the placement wrong of the textFieldButtonGrp.
global proc aasLightBox()
{
window -title ("aasLightBox - v1.1");
string $form = `formLayout -numberOfDivisions 100`;
string $rLayerName;
string $rLayerCmd = "createRenderLayer -n (`textFieldButtonGrp "+" -q -text $rLayerName`) -number 1 -noRecurse `ls -sl`";
string $butCShadows = `symbolButton -image "S:/Morgue/melScripts/icons/cShadows.bmp" -command "castsShadows"`;
string $butRShadows =`symbolButton -image "S:/Morgue/melScripts/icons/rShadows.bmp" -command "receiveShadows"`;
string $butMBlur = `symbolButton -image "S:/Morgue/melScripts/icons/mBlur.bmp" -command "mBlur"`;
string $butVIReflections = `symbolButton -image "S:/Morgue/melScripts/icons/vIReflections.bmp" -command "visibleInReflections"`;
string $butVIRefractions = `symbolButton -image "S:/Morgue/melScripts/icons/vIRefractions.bmp" -command "visibleInRefractions"`;
string $butPVisibility = `symbolButton -image "S:/Morgue/melScripts/icons/pVisibility.bmp" -command "primaryVisibility"`;
string $butAllOff = `symbolButton -image "S:/Morgue/melScripts/icons/allOff.bmp" -command "allOff"`;
string $butAllOn = `symbolButton -image "S:/Morgue/melScripts/icons/allOn.bmp" -command "allOn"`;
formLayout -edit
// Creates Render Layers
-attachForm $rLayerName "top" 0
-attachForm $rLayerName "left"0
// Cast Shadows Off Button
-attachForm $butCShadows "left" 0
-attachForm $butCShadows "bottom" 0
// Recieve Shadows Off Button
-attachForm $butRShadows "bottom" 0
-attachControl $butRShadows "left" 1 $butCShadows
// Motion Blur Off Button
-attachForm $butMBlur "bottom" 0
-attachControl $butMBlur "left" 1 $butRShadows
// Visible in Reflections Off Button
-attachForm $butVIReflections "bottom" 0
-attachControl $butVIReflections "left" 1 $butMBlur
// Visible in Refractions Off Button
-attachForm $butVIRefractions "bottom" 0
-attachControl $butVIRefractions "left" 1 $butVIReflections
// Primary Visibility Off Button
-attachForm $butPVisibility "bottom" 0
-attachControl $butPVisibility "left" 1 $butVIRefractions
// Turns off all Render Stats Button
-attachForm $butAllOff "bottom" 0
-attachControl $butAllOff "left" 1 $butPVisibility
// Turns on all Render Stats Button
-attachForm $butAllOn "bottom" 0
-attachControl $butAllOn "left" 1 $butAllOff
$form;
$rLayerName = `textFieldButtonGrp -label "Render Layer:" -text "" -buttonLabel "Create" -buttonCommand $rLayerCmd`;
showWindow;
}
global proc aasLightBox()
{
window -title ("aasLightBox - v1.1");
string $form = `formLayout -numberOfDivisions 100`;
string $rLayerName;
string $rLayerCmd = "createRenderLayer -n (`textFieldButtonGrp "+" -q -text $rLayerName`) -number 1 -noRecurse `ls -sl`";
string $butCShadows = `symbolButton -image "S:/Morgue/melScripts/icons/cShadows.bmp" -command "castsShadows"`;
string $butRShadows =`symbolButton -image "S:/Morgue/melScripts/icons/rShadows.bmp" -command "receiveShadows"`;
string $butMBlur = `symbolButton -image "S:/Morgue/melScripts/icons/mBlur.bmp" -command "mBlur"`;
string $butVIReflections = `symbolButton -image "S:/Morgue/melScripts/icons/vIReflections.bmp" -command "visibleInReflections"`;
string $butVIRefractions = `symbolButton -image "S:/Morgue/melScripts/icons/vIRefractions.bmp" -command "visibleInRefractions"`;
string $butPVisibility = `symbolButton -image "S:/Morgue/melScripts/icons/pVisibility.bmp" -command "primaryVisibility"`;
string $butAllOff = `symbolButton -image "S:/Morgue/melScripts/icons/allOff.bmp" -command "allOff"`;
string $butAllOn = `symbolButton -image "S:/Morgue/melScripts/icons/allOn.bmp" -command "allOn"`;
formLayout -edit
// Creates Render Layers
-attachForm $rLayerName "top" 0
-attachForm $rLayerName "left"0
// Cast Shadows Off Button
-attachForm $butCShadows "left" 0
-attachForm $butCShadows "bottom" 0
// Recieve Shadows Off Button
-attachForm $butRShadows "bottom" 0
-attachControl $butRShadows "left" 1 $butCShadows
// Motion Blur Off Button
-attachForm $butMBlur "bottom" 0
-attachControl $butMBlur "left" 1 $butRShadows
// Visible in Reflections Off Button
-attachForm $butVIReflections "bottom" 0
-attachControl $butVIReflections "left" 1 $butMBlur
// Visible in Refractions Off Button
-attachForm $butVIRefractions "bottom" 0
-attachControl $butVIRefractions "left" 1 $butVIReflections
// Primary Visibility Off Button
-attachForm $butPVisibility "bottom" 0
-attachControl $butPVisibility "left" 1 $butVIRefractions
// Turns off all Render Stats Button
-attachForm $butAllOff "bottom" 0
-attachControl $butAllOff "left" 1 $butPVisibility
// Turns on all Render Stats Button
-attachForm $butAllOn "bottom" 0
-attachControl $butAllOn "left" 1 $butAllOff
$form;
$rLayerName = `textFieldButtonGrp -label "Render Layer:" -text "" -buttonLabel "Create" -buttonCommand $rLayerCmd`;
showWindow;
}
