Adding "textFieldButtonGrp" to "formLayout"

Become a member of the CGSociety

Connect, Share, and Learn with our Large Growing CG Art Community. It's Free!

THREAD CLOSED
 
Thread Tools Search this Thread Display Modes
Old 06 June 2007   #1
Adding "textFieldButtonGrp" to "formLayout"

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.

Quote: 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;

}
__________________
I dream in wireframes....
 
Old 06 June 2007   #2
Need help with first post or this post.....:(

I tried to do a work around the formLayout and tried doing a frameLayout with the textFieldButtonGrp. I get the window all working and it all looks like the way it should, but I hit a problem. The problem is:
Quote: // Error: //
This what the script editor is giving me. Nothing informing me the problem of the script. So, here is my script:
Quote: // Creates Render Layers
frameLayout -label "Render Layers" -borderStyle "etchedIn" -font "boldLabelFont" -collapsable 0;
rowLayout;
string $myTextFieldButtonGrp;
string $myButtonCommand = "createRenderLayer -name (`textFieldButtonGrp "+" -q -text $myTextFieldButtonGrp`)";

$myTextFieldButtonGrp = `textFieldButtonGrp
-label "Name"
-text ""
-buttonLabel "Create"
-buttonCommand $myButtonCommand`;
The script is pretty much identical to an example in "Mel Scripting for Animators" page 254.
__________________
I dream in wireframes....
 
Old 06 June 2007   #3
In answer to your first post, it's probably because you're editing your formlayout before you've created the new textFieldButtonGrp. Simply move it above the formlayout -edit, and it should work.
 
Old 06 June 2007   #4
thanks, _stev_. That got it working in the formLayout the way I was intending too, but now it is doing my second question. I'm thinking it has something to do the with the `createRenderLayer` command and how I layed the string out. So, here is the code with the adjustments. Now just need to figure out why the button isn't working.

Quote: window -title ("aasLightBox - v1.1");
string $rLayerName;
string $rLayerCmd = "createRenderLayer -n (`textFieldButtonGrp "+" -q -text $rLayerName`) -number 1";
string $form = `formLayout -numberOfDivisions 100`;
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"`;
$rLayerName = `textFieldButtonGrp -label "Name" -text "" -buttonLabel "Create" -buttonCommand $rLayerCmd`;
formLayout -edit
// Creates Render Layers
-attachForm $rLayerName "top" 0
-attachForm $rLayerName "left"0
__________________
I dream in wireframes....
 
Old 06 June 2007   #5
This is kind of a guess, since I don't have maya here, but I think it is because you are using the variable for your textFieldButtonGrp in the command for itself.

Make the textFieldButtonGrp as you have, but don't assign the button command (leave out the -buttonCommand flag).

Then, after you've made all your UI elements, edit the textFieldButtonGrp, and assign the command, like:

textFieldButtonGrp -e -bc $rLayerCmd $rLayerName;


Again, I'm kindof guessing since I can't test any of this, but give it a try.

Later,
Stev

Last edited by _stev_ : 06 June 2007 at 09:17 PM.
 
Old 06 June 2007   #6
_stev_, I tried what you suggested and it didn't work. I was able to get it to work when I gave that command its own window, but overall that isn't what I want. It would just give the people I'm writing this for more windows on their desktop cluttering their work area. I've tried the paneLayout command but that didn't work. All it did was pop up the first window in the command but totally ignoring the 2nd part.

Quote: // Second UI
global proc renderStats()
{
window -title "Render Stats";
gridLayout -numberOfRowsColumns 1 8 -cellWidthHeight 35 35;
symbolButton -image "S:/Morgue/melScripts/icons/cShadows.bmp" -command "castsShadows";
symbolButton -image "S:/Morgue/melScripts/icons/rShadows.bmp" -command "receiveShadows";
symbolButton -image "S:/Morgue/melScripts/icons/mBlur.bmp" -command "mBlur";
symbolButton -image "S:/Morgue/melScripts/icons/vIReflections.bmp" -command "visibleInReflections";
symbolButton -image "S:/Morgue/melScripts/icons/vIRefractions.bmp" -command "visibleInRefractions";
symbolButton -image "S:/Morgue/melScripts/icons/pVisibility.bmp" -command "primaryVisibility";
symbolButton -image "S:/Morgue/melScripts/icons/allOff.bmp" -command "allOff";
symbolButton -image "S:/Morgue/melScripts/icons/allOn.bmp" -command "allOn";
showWindow;
}

// Third UI
global proc renderLayers()
{
window -title "Render Layers";
frameLayout -label "Render Layers" -borderStyle "etchedIn" -font "boldLabelFont" -collapsable 0;
rowLayout;
string $rLayerName;
string $rLayerCmd = "createRenderLayer -n (`textFieldButtonGrp "+" -q -text $rLayerName`) -number 1";
$rLayerName = `textFieldButtonGrp -label "Name" -text "" -buttonLabel "Create" -buttonCommand $rLayerCmd`;
showWindow;
}


// Main UI
global proc aasLightBox()
{

window -title ("aasLightBox - v1.1");


paneLayout -configuration "horizontal2";
columnLayout;
// Below is the render layers window
renderLayers;
setParent ..;
columnLayout;
// Below is the render stats window
renderStats;

showWindow;

}
__________________
I dream in wireframes....
 
Old 06 June 2007   #7
Thread automatically closed

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.
__________________
CGTalk Policy/Legalities
Note that as CGTalk Members, you agree to the terms and conditions of using this website.
 
Thread Closed share thread



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
CGSociety
Society of Digital Artists
www.cgsociety.org

Powered by vBulletin
Copyright 2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump
Miscellaneous

All times are GMT. The time now is 06:39 PM.


Powered by vBulletin
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.