MEL scripts

Become a member of the CGSociety

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

REPLY TO THREAD
 
Thread Tools Search this Thread Display Modes
Old 12 December 2002   #61
Smile nControlMaker

Hi all,

here is my small Script for creating different nurbs control objects.




//-------------------------------------------------------------------------------------------------------------------------------------//
//-------------------------------------------------------------------------------------------------------------------------------------//
// SCRIPT: nControlMaker.mel
// AUTHOR: Paul Dreisen
// pauldryzen@web.de
// DATE: December 28, 2002
//
// DESCRIPTION: This script can be used to create controlobjects, which are build out of nurbscurves.
//------------------------------------------------------------------------------------------------------------------------------------//
//-------------------------------------------------------------------------------------------------------------------------------------//


// start of script

global proc nControlMaker ()
{
// delete existing window

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

// create window and layout

window -title "nCtrl" -w 154 -sizeable 0 nCtrl;
columnLayout;

// create buttons

button -l "Box" -c nBox -w 145;
button -l "Box2" -c nBox2 -w 145;
button -l "Locator" -c nLoc -w 145 ;
button -l "Sphere" -c nSphere -w 145 ;
button -l "CLOSE" -c "deleteUI nCtrl" -w 145;

showWindow nCtrl;
}

//-------------------------------------------------------------------------------------------------------------------------------------//
//-------------------------------------------------------------------------------------------------------------------------------------//


// creation process for the nurbsLocator

global proc nLoc()

{
createNode nurbsCurve;
setAttr -k off ".v";
setAttr ".cc" -type "nurbsCurve"
1 9 0 no 3
10 0 1 2 3 4 5 6 7 8 9
10
0 1 0
0 0 0
-1 0 0
0 0 0
0 0 -1
0 0 1
0 0 0
1 0 0
0 0 0
0 -1 0
;
pickWalk -d up;
}
//-------------------------------------------------------------------------------------------------------------------------------------//
//-------------------------------------------------------------------------------------------------------------------------------------//


// creation process for the nurbsBox2

global proc nBox2()
{
createNode nurbsCurve;
setAttr -k off ".v";
setAttr ".cc" -type "nurbsCurve"
1 13 0 no 3
14 0 1 2 3 4 5 6 7 8 9 10 11 12 13
14
0 1.0504534244537354 0
-0.5 0 0.5
0 -1.0504534244537354 0
-0.5 0 -0.5
0 1.0504534244537354 0
0.5 0 -0.5
0 -1.0504534244537354 0
0.5 0 0.5
0 1.0504534244537354 0
0.5 0 -0.5
0.5 0 0.5
-0.5 0 0.5
-0.5 0 -0.5
0.5 0 -0.5
;
pickWalk -d up;
}

//-------------------------------------------------------------------------------------------------------------------------------------//
//-------------------------------------------------------------------------------------------------------------------------------------//


// creation process for the nurbsBox

global proc nBox()

{
createNode nurbsCurve;
setAttr -k off ".v";
setAttr ".cc" -type "nurbsCurve"
1 15 0 no 3
16 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
16
-0.5 0.5 -0.5
0.5 0.5 -0.5
0.5 0.5 0.5
-0.5 0.5 0.5
-0.5 0.5 -0.5
-0.5 -0.5 -0.5
-0.5 -0.5 0.5
-0.5 0.5 0.5
-0.5 -0.5 0.5
0.5 -0.5 0.5
0.5 0.5 0.5
0.5 -0.5 0.5
0.5 -0.5 -0.5
0.5 0.5 -0.5
0.5 -0.5 -0.5
-0.5 -0.5 -0.5
;
pickWalk -d up;
}

//-------------------------------------------------------------------------------------------------------------------------------------//
//-------------------------------------------------------------------------------------------------------------------------------------//


// creation process for the nurbsSphere

global proc nSphere()

{
createNode nurbsCurve;
setAttr -k off ".v";
setAttr ".cc" -type "nurbsCurve"
1 48 0 no 3
49 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48
49
0 1 0
2.8102721927325547e-008 0.92387950420379639 -0.3826833963394165
5.1927056432532481e-008 0.70710676908493042 -0.70710670948028564
6.7845967066659796e-008 0.38268342614173889 -0.92387938499450684
7.3435948877431656e-008 0 -0.99999988079071045
6.7845967066659796e-008 -0.38268342614173889 -0.92387938499450684
5.1927056432532481e-008 -0.70710676908493042 -0.70710670948028564
2.8102721927325547e-008 -0.92387950420379639 -0.3826833963394165
0 -1 0
-9.8768948575411741e-009 -0.92387950420379639 0.38268342614173889
-1.8250119637741591e-008 -0.70710676908493042 0.70710670948028564
-2.384493136275978e-008 -0.38268342614173889 0.92387944459915161
-2.5809567816281742e-008 0 0.99999994039535522
-2.384493136275978e-008 0.38268342614173889 0.92387944459915161
-1.8250119637741591e-008 0.70710676908493042 0.70710670948028564
-9.8768948575411741e-009 0.92387950420379639 0.38268342614173889
0 1 0
0.38268345594406128 0.92387950420379639 0
0.70710676908493042 0.70710676908493042 0
0.92387950420379639 0.38268342614173889 0
1 0 0
0.92387950420379639 -0.38268342614173889 0
0.70710676908493042 -0.70710676908493042 0
0.38268345594406128 -0.92387950420379639 0
0 -1 0
-0.3826833963394165 -0.92387950420379639 -1.8225827957962792e-008
-0.70710670948028564 -0.70710676908493042 -3.367693679479089e-008
-0.92387938499450684 -0.38268342614173889 -4.4001033927543176e-008
-0.99999988079071045 0 -4.7626379284793074e-008
-0.92387938499450684 0.38268342614173889 -4.4001033927543176e-008
-0.70710670948028564 0.70710676908493042 -3.367693679479089e-008
-0.3826833963394165 0.92387950420379639 -1.8225827957962792e-008
0 1 0
2.8102721927325547e-008 0.92387950420379639 -0.3826833963394165
5.1927056432532481e-008 0.70710676908493042 -0.70710670948028564
6.7845967066659796e-008 0.38268342614173889 -0.92387938499450684
7.3435948877431656e-008 0 -0.99999988079071045
0.5 0 -0.86602526903152466
0.86602532863616943 0 -0.49999988079071045
1 0 0
0.86602538824081421 0 0.5
0.49999997019767761 0 0.86602538824081421
-2.5809567816281742e-008 0 0.99999994039535522
-0.5 0 0.86602532863616943
-0.86602532863616943 0 0.49999991059303284
-0.99999988079071045 0 -4.7626379284793074e-008
-0.86602526903152466 0 -0.49999997019767761
-0.49999988079071045 0 -0.86602532863616943
7.3435948877431656e-008 0 -0.99999988079071045
;
pickWalk -d up;

}


// end of script

//-------------------------------------------------------------------------------------------------------------------------------------//
//-------------------------------------------------------------------------------------------------------------------------------------//
// Copyright Paul Dreisen 2002
//-------------------------------------------------------------------------------------------------------------------------------------//
//-------------------------------------------------------------------------------------------------------------------------------------//
 
Old 12 December 2002   #62
here is an update for UI_melCmdFinder.mel by Warpcat

paste the code in the Script Editor input field, select it and MMB-drag to shelf and you are ready to search



///////////////////////////////////////////////////////////////////////////////// 
// UI_melCmdFinder.mel 
// Author: Warpcat 
//
// update by Alin Sfetcu (Sanctuary) on 28-dec-2002
//   	snct@mymail.ro
//	http://www.sanctuary.ro (temp closed)
//
// Description 
// ----------------------
// A little window that opens/search the help documentation. 
//
// Usage:
// ----------------------
// Type the mel command you want to find in the text box and use the Enter key. 
//
// Know BUGS:
// ----------------------
// - to do a second search of the same keyword in the same session you must
// refresh then textbox content. I`ve try to fix this using mel without success,
// seems that the "boolean change state" of the text box is changed only on user
// input, not script input.
//
// solution 1 - add an space and delete it
// solution 2 - close the script and open it again
//
// Updates:
// ----------------------
// - fixed the two buttons commands;
// - added a feedback field;
//			(user get a visual notification when keyword is not found);
///////////////////////////////////////////////////////////////////////////////// 

global proc UI_melCmdFinder() 
{ 
	if ( `window -exists UI_melCmdFinder` ) { deleteUI UI_melCmdFinder; 	}

	window -t "MEL Command Finder Window" -rtf 1 UI_melCmdFinder; 

	columnLayout -adj 1; 
		textFieldGrp 
                            -l "Mel Command Search:" 
                            -cc EP_showMelHelp
                            -ann "Type the MEL command press the Enter key." 
                                   helpField; 
		separator -h 10;
		text -l "" feedback;
		separator -h 10;
		button -l "Open Mel Command Reference Library" -c EP_showMelLibrary; 
		button -l "Open Node and Attribute Refernce Library" -c EP_showNodeLibrary; 
	showWindow; 
} 

global proc EP_showMelHelp() 
{ 
	string $helpCommand = `textFieldGrp -q -tx helpField`; 

	if ( !(catch (`help -doc $helpCommand`)) ) {
		text -edit -label "" feedback;
	} else {
    		text -edit -label ( "\"" + $helpCommand + "\" - command not found in Help files !") feedback;
	}
} 

global proc EP_showMelLibrary() 
{ 
	showHelp -docs "Commands/index_letters.html"; 
} 

global proc EP_showNodeLibrary() 
{ 
	showHelp -docs "Nodes/index_letters.html"; 
}

UI_melCmdFinder;




hope you enjoy it, and tkx Warpcat for the ideea, hope you will not be offended by this update
__________________
Alin Sfetcu / Sanctuary

stuff @ : highend3D | vimeo | portfolios.ro

fight me !
 
Old 12 December 2002   #63
camSwitcher v4.6 new release

nice script pauldryzen


btw i`ve release a new update for camSwitcher v4.6 (hosted on highend3d), the script is way to big to put it in here, give it a try

tkx
__________________
Alin Sfetcu / Sanctuary

stuff @ : highend3D | vimeo | portfolios.ro

fight me !
 
Old 12 December 2002   #64
attrMaker

Here is another script I made.

Have fun :-)

//-------------------------------------------------------------------------------------------------------------------------------------//
//-------------------------------------------------------------------------------------------------------------------------------------//
// SCRIPT: attrMaker
// AUTHOR: Paul Dreisen
// pauldryzen@web.de
// DATE: December 29, 2002
//
// DESCRIPTION: This script can be used to add extra attributes to all selected objects.
// Just put the whole Script into the shelf
//------------------------------------------------------------------------------------------------------------------------------------//
//-------------------------------------------------------------------------------------------------------------------------------------//

// start of script

window -title "attribute Maker" -wh 320 104 -sizeable 0 attrMaker;$form = `formLayout -nd 100`;

$col = `columnLayout -adj true`;
textFieldGrp -label "Enter attribute name here" -cw 2 160 attrName; floatFieldGrp -nf 2 -label "Enter Min/Max here" -v1 -5 -v2 10 attrMinMax;
setParent $form;
$b1 = `button -label "Go" -command "addAttrCallback"`;
$b2 = `button -label "Close" -command "deleteUI attrMaker"`;

formLayout -edit
-attachForm $col "top" 5
-attachForm $col "left" 5
-attachForm $col "right" 5
-attachNone $col "bottom"

-attachNone $b1 "top"
-attachForm $b1 "left" 5
-attachPosition $b1 "right" 2 50
-attachForm $b1 "bottom" 5

-attachNone $b2 "top"
-attachPosition $b2 "left" 2 50
-attachForm $b2 "right" 5
-attachForm $b2 "bottom" 5
$form;

showWindow attrMaker;

global proc addAttrCallback() { string $attr = `textFieldGrp -q -text attrName`; float $min = `floatFieldGrp -q -v1 attrMinMax`; float $max = `floatFieldGrp -q -v2 attrMinMax`;

if (size(`ls -sl`))
{ string $sel[] = `ls -sl`;
for ($obj in $sel)
{ addAttr -ln $attr -at double -dv 0 -min $min -max $max -keyable true $obj;
}
}
else
{
warning "no object selected, please select one";
} }

// end of script

//-------------------------------------------------------------------------------------------------------------------------------------//
//-------------------------------------------------------------------------------------------------------------------------------------//
// Copyright Paul Dreisen 2002
//-------------------------------------------------------------------------------------------------------------------------------------//
//-------------------------------------------------------------------------------------------------------------------------------------//
 
Old 01 January 2003   #65
Automatic Unwrap Script

Byron's Automatic Unwrap Tools

I made a script that allows to automatically unwrap a polygonal object.

You define the cuts, and/or create special Zones to control the Flow of the UVMesh und click a Button ... et voilą .

You can download it here because its to big to post it:

http://www.highend3d.com/maya/mel/?section=polygon#2075

Bests
Sebastian
 
Old 01 January 2003   #66
my pointconstraint. let the object stays where it was. just select all targets, shift select the object, run the script.

dwPointConst
__________________
heimwerker never die
 
Old 01 January 2003   #67
SmoothUV v.0.9b

Hi,
This script will allow you to generate, from your base mesh, a "smoothed" object with "smoothed out" uvs.
It's a beta version because there are limitations. please refer to the readme.txt

French web page:

http://perso.wanadoo.fr/coyhot/Code_SmoothUV.htm

Direct download links ( readme.txt in english )

SmoothUV v.0.9b for Maya 4.0


SmoothUV v.0.9b for Maya 4.5
 
Old 01 January 2003   #68
a couple of useful tools for doing belnd shapes for character animation:

http://www.cgtalk.com/showthread.php?s=&threadid=37993
__________________

You can have your characters photoreal, fast or cheap. Pick two.
 
Old 01 January 2003   #69
Angry help !!!! cant find this any where

hey guys
just wondering if anybody can help me out with this i am looking for a script called --jsOrientJointUI.mel-- i cant find it anywhere
the script helps in aligning the joint orientation during character setup
thanks in advance
code_z3@yahoo.com
 
Old 01 January 2003   #70
Talking da link me 4gets

for any body interested in facial animation

http://www.supersnail.com/port/faces/2index.html
 
Old 01 January 2003   #71
You can get the script here:

www-viz.tamu.edu/students/gavin/617/jointPage4.htm

although, the site seems down at the moment. Good article too...

Jay
 
Old 01 January 2003   #72
thankx jay
but dude that site has been down for ages
does any body know any more sites whr i can get this script from




Disce quasi semper victurus; vive quasi cras moriturus"
[Learn as if you were going to live forever; live as if you were going to die tomorrow.]
 
Old 01 January 2003   #73
nope, not ages, and matter of fact, it seems to be back up now. give it another try...

Jay
 
Old 01 January 2003   #74
Hey,

I just have a question concerning MEL.

I would like to make a mel script that executes when I select an object. So basically when I select a locator, it executes a script. How would I go about doing this? Is it possible?

Please help!! Thanks.

loked
 
Old 01 January 2003   #75
Smile ScriptJobs will do it

There is an MEL-Command which creates a "scriptJob". Everytime a certain event occours, your script will be executed.

I think, the "selection changed" event will be fine for you.

Please refer to the manual for further information .

Bests
Byron
 
reply 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 12:40 AM.


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