Community
Maya Programming
Welcome to Autodesk’s Maya Forums. Share your knowledge, ask questions, and explore popular Maya SDK topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Window compress #MEL?

7 REPLIES 7
SOLVED
Reply
Message 1 of 8
jayantbhatt07
1353 Views, 7 Replies

Window compress #MEL?

Hi guys as you can see in the screen shot when I closed the options and constraint and other options too  in the script (flowLayout menu ) is not compressing  my main window. Its like window is stuck anybody know how can I fix it?

 

 

Hi I added add script please tell me where is the problem?

 

 

 

  12.PNG

 

45.PNG

7 REPLIES 7
Message 2 of 8

//AUTHOR : Jayant bhatt.

//don't modify , don't distribute.

//works with maya 2017 and 2018

//special thanks to autosk and polycount forum

//for materials thanks to Bodizz

//PP

 

 

if ( `window -exists "nameWindow"` ) {

deleteUI "nameWindow";

}

 

// create a window with a menu bar

window -title "3DGhost" -menuBar true -w 220 -h 200 "nameWindow";

 

 

// two frame layouts will be laid out in a columna

columnLayout;

 

 

 

{

if ( `window -exists CgGhost` ) {

deleteUI CgGhost;

 

}

 

 

 

// create a tearOff menu

menu -label "File" -tearOff true;

// add the menu items

menuItem -label "New" -command "NewScene";

menuItem -label "Open" -command "OpenScene";

menuItem -label "Save" -command "SaveScene";

menuItem -divider true ;

menuItem -label "Quit" -command "quit";

 

 

 

// add a help menu

menu -label "Credit" -helpMenu true;

menuItem -label "Jayant bhatt";

menuItem -label "Virbhadra Gupta";

 

 

// add a help menu

menu -label "Windows" -helpMenu true;

 

menuItem -label "Outliner" -command "OutlinerWindow";

menuItem -label "Preferences" -command "PreferencesWindow";

menuItem -label "Hotkey Editr " -command "HotkeyPreferencesWindow";

menuItem -label "PluginManagr" -command "PluginManager;";

 

 

// add a help menu

menu -label "Display" -helpMenu true;

menuItem -label "HideSelected" -command "HideSelectedObjects";

menuItem -label "ShowAll" -command "ShowAll";

menuItem -label "Polycount" -command "TogglePolyCount";

menuItem -divider true -dividerLabel "Rigging";

menuItem -label "Joint Size" -command "jdsWin";

menuItem -label "Ik/Fk Js" -command "ikfkjdsWin";

menuItem -label "Ik Handle Size" -command "ikHdsWin";

 

 

// create a collapsible frame layout

frameLayout -collapsable true -label "Shapes";

 

// add the other controls

flowLayout -columnSpacing 1 -w 220 -h 30;

 

// create six symbol buttons with related mel command

 

symbolButton -image "cube.xpm" -command "polyCube";

symbolButton -image "sphere.xpm" -command "CreatePolygonSphere";

symbolButton -image "plane.xpm" -command "CreatePolygonPlane";

symbolButton -image "cylinder.xpm" -command "CreatePolygonCylinder";

symbolButton -image "circle.xpm" -command "CreateNURBSCircle";

symbolButton -image "text.xpm" -command "CreatePolygonType";

 

 

setParent ..;

 

 

columnLayout;

// create some text

text -label " cube sphre Plne Cylndr Circle Text ";

 

setParent ..;

setParent ..;

 

// create a collapsible frame layout

frameLayout -collapsable true -label "Lights";

 

// add the other controls

 

flowLayout -columnSpacing 7 -w 20 -h 25;

 

// create six symbol buttons with related mel command

 

symbolButton -w 30 -h 30 -image "ambientlight.png" -command "CreateAmbientLight";

symbolButton -w 30 -h 30 -image "directionallight.png" -command "CreateDirectionalLight";

symbolButton -w 30 -h 30 -image "pointlight.png" -command "CreatePointLight";

symbolButton -w 30 -h 30 -image "spotlight.png" -command "CreateSpotLight";

symbolButton -w 30 -h 30 -image "arealight.png" -command "CreateAreaLight";

symbolButton -w 30 -h 30 -image "volumelight.png" -command "CreateVolumeLight";

 

setParent ..;

 

 

columnLayout;

// create some text

text -label " Amb Dir Point spot Area Vol ";

 

setParent ..;

setParent ..;

 

// three frame layouts will be laid out in a column

columnLayout;

// create a collapsible frame layout

frameLayout -collapsable true -label "Options";

 

// define the layout of controls added

// to the window.

columnLayout;

 

 

 

// add the other controls

flowLayout -columnSpacing 1 -w 220 -h 33;

 

 

 

// create a couple of buttons

symbolButton -w 35 -h 35 -image "buttonManip.svg" -command "CenterPivot";

symbolButton -image "multiCut_NEX32.png" -command "dR_multiCutTool";

symbolButton -image "detach.png" -command "DetachComponent";

symbolButton -w 35 -h 35 -image "GateMask.png" -command "PolyCircularize";

symbolButton -w 35 -h 35 -image "addCreateGeneric_100.png" -command "CombinePolygons";

symbolButton -w 35 -h 35 -image "mergeConnections.png" -command "SeparatePolygon";

 

setParent ..;

columnLayout;

// create some text

text -label " CPvt MCtol Dattch Circ Comb Sept ";

 

setParent ..;

setParent ..;

 

flowLayout -columnSpacing 1 -w 220 -h 30;

// create a couple of buttons

symbolButton -w 35 -h 35 -image "bridge_NEX32.png" -command "performBridgeOrFill";

symbolButton -w 35 -h 35 -image "bevel.png" -command "BevelPolygon";

symbolButton -w 35 -h 35 -image "bezCorner.png" -command "SoftPolyEdgeElements 0";

symbolButton -w 35 -h 35 -image "bezNormalSelect.png" -command "SoftPolyEdgeElements 1";

symbolButton -w 35 -h 35 -image "reverseSurface.png" -command "ReversePolygonNormals";

symbolButton -w 35 -h 35 -image "UV.png" -command "TextureViewWindow";

 

 

 

setParent ..;

 

columnLayout;

// create some text

text -label " Brdge Bvl HEd SEd Nrevse UV ";

 

setParent ..;

setParent ..;

setParent ..;

 

 

// create a collapsible frame layout

frameLayout -collapsable true -label "Constraint";

// add the other controls

flowLayout -columnSpacing 10 -w 224 -h 32;

 

 

symbolButton -w 30 -h 30 -image "edges_NEX.png" -command "toolPropertyWindow";

 

symbolButton -w 30 -h 30 -image "hyper_s_ON.png" -command "manipMoveSetXformConstraint edge";

 

symbolButton -w 30 -h 30 -image "hyper_s_OFF.png" -command "manipMoveSetXformConstraint none";

 

 

setParent ..;

setParent ..;

 

 

 

// create a collapsible frame layout

frameLayout -collapsable true -label "Materials";

// add the other controls

flowLayout -columnSpacing 4 -w 224 -h 53;

 

 

columnLayout;

// create some text

text -label " Blinn Lmbrt Phong HypShd MatA ";

 

 

//create a blinn material

 

 

 

proc createBlinn(){

string $sel[] = `ls -sl`;

string $myBlinn = `shadingNode -asShader blinn`;

select -r $sel;

hyperShade -assign $myBlinn;

}

 

flowLayout -columnSpacing 4 -w 220 -h 40;

symbolButton -w 40 -h 40 -image "blinn.svg" -c "createBlinn()" ;

 

 

//create a Lambert material

 

 

proc createLambert(){

string $sel[] = `ls -sl`;

string $lambert = `shadingNode -asShader lambert`;

select -r $sel;

hyperShade -assign $lambert;

}

 

flowLayout -columnSpacing 4 -w 220 -h 40;

 

symbolButton -w 40 -h 40 -image "lambert.svg" -c "createLambert()" ;

 

 

 

//create a Phong material

 

proc createPhong(){

string $sel[] = `ls -sl`;

string $phong = `shadingNode -asShader phong`;

select -r $sel;

hyperShade -assign $phong;

}

 

flowLayout -columnSpacing 4 -w 220 -h 40;

 

symbolButton -w 40 -h 40 -image "phong.svg" -c "createPhong()" ;

 

//Material attribute

 

 

 

flowLayout -columnSpacing 3 -w 220 -h 40;

symbolButton -w 38 -h 38 -image "Hypershade.png" -command "HypershadeWindow";

 

 

 

//take you to the material attribut

 

 

symbolButton -w 40 -h 40 -image "samplerInfo.svg" -c "showShadingGroupAttrEditor" ;

 

 

 

 

 

setParent ..;

columnLayout;

 

 

setParent ..;

setParent ..;

 

 

 

showWindow;

}

Message 3 of 8
mspeer
in reply to: jayantbhatt07

Hi!

This is the normal behavior.

Message 4 of 8
jayantbhatt07
in reply to: mspeer

Hi what do you mean by normal behaviour can we fix it, I have seen other artist scripts also where in the update they fixed this thing. Any Idea?

Message 5 of 8
mspeer
in reply to: jayantbhatt07

Hi!

If you want to change the size of the window after clicking on a certain frameLayout you need to add a MEL script to this frameLayout that does this by using -cc.

 

For example:

frameLayout -collapsable true -label "Shapes" -cc "window -e -height 100 nameWindow";
Message 6 of 8
jayantbhatt07
in reply to: mspeer

Thank you so much 🙂

Message 7 of 8
jayantbhatt07
in reply to: mspeer
Message 8 of 8
The-Digital-Shaman
in reply to: mspeer

Many thanks for the -cc flag!

 

Is there a flag with inverse functionality?

 

When one launches a window with already collapsed tabs, the window would automatically expand when manually expanding tabs.

 

Cheers,

DS

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report