PDA

View Full Version : quick question layer set-up


thehive
03-07-2009, 04:10 PM
i have this global proc and im tryin to it in the the $SpecButtonCMD section an i cant seem to find a good way to add it in there so when you run the button from the textFieldButtonGrp.









if (`window -exists LayerCake`)
deleteUI -window LayerCake;

if (`windowPref -exists LayerCake`)
windowPref -remove LayerCake;

window -t "LayerCake" -w 562 -h 350 LayerCake;

rowLayout;



global proc specular ()
{
setAttr "Specular.specular" 1;
setAttr "Specular.beauty" 0;
setAttr "Specular.color" 0;
setAttr "Specular.shadow" 0;
setAttr "Specular.diffuse" 0;
}

string $SpecTxtfieldGrp;
string $SPECproc = "specular";



//////////////////////////////

string $SpecButtonCMD =

"createRenderLayer -name (`textFieldButtonGrp " +
"-q -text $SpecTxtfieldGrp`);



/////////////////////////////////////////////////


$SpecTxtfieldGrp = `textFieldButtonGrp
-label "layer name"
-text "layer"
-buttonLabel "Make"
-buttonCommand $SpecButtonCMD`;


showWindow;

mlefevre
03-08-2009, 11:43 AM
Hey,

global proc LayerCakeGUI(){

if (`window -exists LayerCake`)
deleteUI -window LayerCake;

if (`windowPref -exists LayerCake`)
windowPref -remove LayerCake;

window -t "LayerCake" -w 562 -h 350 LayerCake;

rowLayout;

textFieldButtonGrp
-label "layer name"
-text "layer"
-buttonLabel "Make"
-buttonCommand "makeLayer()"
TFBGControl;

showWindow LayerCake;
};

//====================================

proc makeLayer(){
string $layerName = `textFieldButtonGrp -q -text TFBGControl`;
createRenderLayer -name $layerName;
};

Hope that helps in some way!

-matt

thehive
03-08-2009, 03:56 PM
oh so put all the commands in to a proc for the button helps a ton thanks

thehive
03-08-2009, 05:16 PM
i see what you did but my main concern was get the button to set the render pass on the layer which is this part but im gettin a syntax error i know its something dumb im not seeing how to attach the "setAttr" part.

or do i need to define a string for the settAttr part ie like or i could be way off lol many thanks for the help

string $layerAttr =`setAttr + "$layerName "`;





proc makeLayer(){
string $layerName = `textFieldButtonGrp -q -text TFBGControl`;
createRenderLayer -name $layerName;
/////
//setlayer render settings to specuar
setAttr ($layerName) + .beauty 0;
setAttr ($layerName) + .specular 1;
setAttr ($layerName) + .color 0;
setAttr ($layerName) + .shadow 0;
setAttr ($layerName) + .diffuse 0;
};

mlefevre
03-08-2009, 11:26 PM
You were close enough - but you need to enclose the object and its attribute in ( ) and enclose the attribute itself in " ".

proc makeLayer(){
string $layerName = `textFieldButtonGrp -q -text TFBGControl`;
createRenderLayer -name $layerName;

//setlayer render settings to specular

setAttr ($layerName + ".specular") 1;
};

Hope that helps some

-matt

thehive
03-09-2009, 02:05 AM
sweetness ill take it i knew what had to happen jus not sure of the syntax thank man really appreciate it

CGTalk Moderation
03-09-2009, 02:05 AM
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.