PDA

View Full Version : `modelPanel` view in custom UI question


sturmkim
11-01-2006, 04:40 PM
Hi all.
here is my mel for blendshape control custom UI.
Question is how can my modelPanel view start with smooth shading all and texture?

i try add DisplayShadedAndTextured;
//i hit 6 and copy from script editor.// on my mel, it only change main maya window..


// THIS IS THE FACIAL PANEL
modelPanel -cam "faceCam" -menuBarVisible 0 -l facialfacePanel;

setParent..;

i want above modelPanel is started with "smooth shade all and texture view(6 mode)
in the beginning. now start with wireframe view...

thanks in advance!


//edit form cgtoolkit's "Zuckafa Facial UI"
// orignal author is
// Zuckafa Facial UI
//
// Copyright 2004 CGTOOLKIT. All rights reserved
// www.cgtoolkit.com (http://www.cgtoolkit.com)
//
// Description:
// -This script will create a user interface for the
// animator to use with a creature.
// -It can be easily adapted to fit your own creatures.
// -Check the video tutorials on how to use.
//modified for educational purpose and personal demoreel.
//
/* UI for facial expression*/
//Will set a key on the mouth controllers only
proc keyMouth()
{
setKeyframe -breakdown 0 -hierarchy none -controlPoints 0 -shape 0 {"expressionBS.AAA","expressionBS.EEE","expressionBS.UUU","expressionBS.OOO","expressionBS.FFF","expressionBS.bigAAA",
"expressionBS.ul_Ldown","expressionBS.ul_MidDown","expressionBS.ul_Rdown",
"expressionBS.Ll_Lup","expressionBS.Ll_Midup","expressionBS.Ll_Rup",
"expressionBS.closeMouth"};
}
/////////////////////////////////////////////////////////////////////////////////////
//Will reset all the facial controllers to zero
proc resetMouth()
{
setAttr expressionBS.AAA 0 ;
setAttr expressionBS.EEE 0 ;
setAttr expressionBS.UUU 0 ;
setAttr expressionBS.OOO 0 ;
setAttr expressionBS.FFF 0 ;
setAttr expressionBS.bigAAA 0 ;
setAttr expressionBS.ul_Ldown 0 ;
setAttr expressionBS.ul_MidDown 0 ;
setAttr expressionBS.ul_Rdown 0 ;
setAttr expressionBS.Ll_Lup 0 ;
setAttr expressionBS.Ll_Midup 0 ;
setAttr expressionBS.Ll_Rup 0 ;
setAttr expressionBS.closeMouth 0 ;
}
/////////////////////////
global proc dongliFacialUI ()
{
if (`window -q -ex dFaceUI`) deleteUI dFaceUI; //checking existing window

window -w 650 -h 600 -title "Facial GUI _by burona kim" dFaceUI; // create window for dFaceUI
paneLayout -paneSize 3 100 50 -configuration "top3" "facialPaneLayout"; // panel layout
// THIS IS THE FACIAL PANEL
modelPanel -cam "faceCam" -menuBarVisible 0 -l facialfacePanel;

setParent..;
// THIS IS THE FACIAL INTERFACE CAMERA PANEL.
modelPanel -cam "UICam" -menuBarVisible 0 -l facialCamPanel;


setParent..;
/////////////////////////////////////////////////////////////////////////////////////
// Blendshap slider layout
columnLayout ;
rowColumnLayout -nc 6 -cal "center";
button -bgc .1 .8 .1 -label "Key Mouth"
-c "keyMouth;";
button -bgc .1 .8 .1 -c "keyFace;" -label "Key Face";
button -bgc .94 .035 .164 -c "resetMouth;"-label "Reset Mouth";
button -bgc .94 .035 .164 -c "resetFace;"-label "Reset Face";
//button -label "Load Pose File..." -c ("loadPoseLibrary");
//button -label "Save Pose to File..." -c ("addPoseToLibrary");
setParent..;

columnLayout -columnAlign "left" -adj on ;
rowColumnLayout -nc 2
-columnWidth 1 400
-h 100
-columnWidth 2 450;
attrFieldSliderGrp
-label "AAA"
-min 0 -max 1 -at "expressionBS.AAA";
attrFieldSliderGrp
-label "EEE"
-min 0 -max 1 -at "expressionBS.EEE";
attrFieldSliderGrp
-label "UUU"
-min 0 -max 1 -at "expressionBS.UUU";
attrFieldSliderGrp
-label "OOO"
-min 0 -max 1 -at "expressionBS.OOO";
attrFieldSliderGrp
-label "FFF"
-min 0 -max 1 -at "expressionBS.FFF";
attrFieldSliderGrp
-label "bigAAA"
-min 0 -max 1 -at "expressionBS.bigAAA";
attrFieldSliderGrp
-label "UpperLip_Leftdown"
-min 0 -max 1 -at "expressionBS.ul_Ldown";
attrFieldSliderGrp
-label "UpperLip_Middown"
-min 0 -max 1 -at "expressionBS.ul_MidDown";
attrFieldSliderGrp
-label "UpperLip_Rightdown"
-min 0 -max 1 -at "expressionBS.ul_Rdown";
attrFieldSliderGrp
-label "lowerLip_LeftUp"
-min 0 -max 1 -at "expressionBS.Ll_Lup";
attrFieldSliderGrp
-label "lowerLip_MidtUp"
-min 0 -max 1 -at "expressionBS.Ll_Midup";
attrFieldSliderGrp
-label "lowerLip_RightUp"
-min 0 -max 1 -at "expressionBS.Ll_Rup";

attrFieldSliderGrp
-label "CloseMouth"
-min 0 -max 1 -at "expressionBS.closeMouth";
setParent..;
setParent..;
setParent..;
setParent..;
showWindow dFaceUI;
}

Visual_E
11-01-2006, 05:43 PM
you have to return panel names into variables so you can use them

string $facePanelName = `modelPanel -cam "faceCam" -menuBarVisible 0 -l facialfacePanel`;
string $UIPanelName = `modelPanel -cam "UICam" -menuBarVisible 0 -l facialCamPanel`;

then execute modelEditor command on those panes

modelEditor -edit -displayAppearance smoothShaded -activeOnly false -displayTextures true $facePanelName;
modelEditor -edit -displayAppearance smoothShaded -activeOnly false -displayTextures true $UIPanelName;


you should check the modelEditor command in help files, and use the example of creating the camera object before executing modelPanel or modelEditor commands.

sturmkim
11-01-2006, 10:05 PM
Thanks Visual_E

i'll try your suggestion later today.

thanks again :)

CGTalk Moderation
11-01-2006, 10:05 PM
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.