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 07 July 2002   #31
didn't test it yet, but that sounds great bigfatMELon
__________________
Cheers,
Thomas
 
Old 07 July 2002   #32
Re: cool mel commands that no one knows

Originally posted by alexx
...
filterExpand (expand selections like .cv[1:12][2:13] to single occurances)
...


You mean... with filterExpand, I can convert the line .cv[1:12] to .cv[1,2,3,4,5,6,7,8,9,10,11,12]? (Ok can't remember how it was in MEL exactly, but you get the point)


Holy *beep* alexx! You're my hero now!
 
Old 07 July 2002   #33
Since this is the mel thread, here's a little window I map to a hotkey that will bring up a text field to let you search for mel commands. I get tired of slumming through the online reference. Works on w2k, havn't tested it on other platforms... could get hairy the way it sources the paths...

/////////////////////////
//
// UI_melCmdFinder.mel
// Author: Warpcat
// Description
// A little window that opens the help documentation.
//
///////////////////////////

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 helpField;
button -l "Mel Command Reference Library" -c EP_showMelLibrary;
button -l "Node and Attribute Refernce Library" -c EP_showNodeLibrary;
showWindow;
}

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

global proc EP_showMelLibrary()
{
showHelp -docs "Commands\\Index\\index.html";
}

global proc EP_showNodeLibrary()
{
showHelp -docs "Nodes\\Index\\indexAlpha.html";
}

///////////////////////////
__________________
- Warpcat
 
Old 07 July 2002   #34
that's a really helpfull script warpcat. thank you, it speeds up the process

__________________
heimwerker never die
 
Old 07 July 2002   #35
soloRender

Hey folks,
Here's a script I wrote yesterday before work. It's based on a lighting TD tool they used to use (may still) at ILM called "solo render". This is for those scenes where you have a ton of lights but just want to see the effect of one or two of them on the scene without having to hide lights or create a bunch of weird layers.
With this, you just click any lights you want to use in the render (though the outliner, viewport, or whatever way you want) and then run soloRender. I have it bound to ALT-r so it's super fast.

I have a few things I'd like to add to it, but here it is. It seems to work well:


// soloRender()
// by Alec Fredericks

global proc soloRender()
	{
	string $arrayLights[];
	string $itemLight;

	int $arrayStart = 0;

	string $arrayLightVis[];
	string $arrayLightVisVal[];
	int $visState;

	string $pickedLights[] = `ls -sl`;
	$arrayLights = `ls -lights`;
	for ($itemLight in $arrayLights)
	{
		$visState = eval("getAttr " + $itemLight + ".visibility");
		$arrayLightVis[$arrayStart] = $itemLight;
		$arrayLightVisVal[$arrayStart] = $visState;
		if (stringArrayCount($itemLight,`listRelatives -s $pickedLights`) > 0)
			eval("setAttr " + $itemLight + ".visibility 1");
			else
				eval("setAttr " + $itemLight + ".visibility 0");
		$arrayStart = $arrayStart + 1;
	}

	renderIntoNewWindow render;

	int $sizeArray = size($arrayLightVis);
	int $x;
	for ($x=0;$x<$sizeArray;$x++)
		{
		if ($arrayLightVisVal[$x] == 1)
			eval("setAttr " + $arrayLightVis[$x] + ".visibility " + $arrayLightVisVal[$x]);
		}


	clear($arrayLightVis);
	clear($arrayLightVisVal);
	clear($arrayLights);

	} // end proc


Let me know if any of you use this and have problems with it.
I'll probably rewrite this using a matrix instead of two arrays and the coding is a bit sloppy, but...oh, well.
Alec
__________________
http://www.community3d.com/
 
Old 07 July 2002   #36
Re: Re: cool mel commands that no one knows

Originally posted by -wT-


You mean... with filterExpand, I can convert the line .cv[1:12] to .cv[1,2,3,4,5,6,7,8,9,10,11,12]? (Ok can't remember how it was in MEL exactly, but you get the point)


Holy *beep* alexx! You're my hero now!


yep

a selection like: .cv[1:3]
gets converted and returned to:
.cv[1] .cv[2] .cv[3]

as i said.. i wrote my own script to do that for all occasions before i found the mel command myself..
bit myself in the *beep*

btw.. if there is any need for it i can post a newer version of my "fakeDepth" script that includes particles now as well (since 4.0 does not render particles with z-channel in sw render anymore.. hell knows why)

cheers

alexx
 
Old 08 August 2002   #37
Re: Re: Re: cool mel commands that no one knows

Originally posted by alexx


yep

a selection like: .cv[1:3]
gets converted and returned to:
.cv[1] .cv[2] .cv[3]

as i said.. i wrote my own script to do that for all occasions before i found the mel command myself..
bit myself in the *beep*

btw.. if there is any need for it i can post a newer version of my "fakeDepth" script that includes particles now as well (since 4.0 does not render particles with z-channel in sw render anymore.. hell knows why)

cheers

alexx


Yeah, tried it as soon as you posted that, and it worked
And yes, I was doing just the same thing, converting them myself with two to three lines of extra code everytime, I think the speed of the script increased around 300%
Thanks again
 
Old 08 August 2002   #38
Hey, -wT- and alexx, don't forget the 'flatten' (or -fl) flag, it works like filterExpand but can be used as part of the list command, so the line:

string $templist[] = `ls -fl -sl`;

will put each selected item into its own array entry. Just like filterExpand but even less typing

This is a little script I wrote for working with blendshapes, it will transfer the current component selection from one target to another (as long as the topology is the same). It's just two or three loops and a bit of string manipulation, but it's been incredibly useful for the way I work.

(BTW rename to transferSelection.mel to use it).

Wabo.
Attached Files
File Type: txt transferselection.txt (1.6 KB, 102 views)
 
Old 08 August 2002   #39
Originally posted by Waboflex
Hey, -wT- and alexx, don't forget the 'flatten' (or -fl) flag, it works like filterExpand but can be used as part of the list command, so the line:

string $templist[] = `ls -fl -sl`;

will put each selected item into its own array entry. Just like filterExpand but even less typing

This is a little script I wrote for working with blendshapes, it will transfer the current component selection from one target to another (as long as the topology is the same). It's just two or three loops and a bit of string manipulation, but it's been incredibly useful for the way I work.

(BTW rename to transferSelection.mel to use it).

Wabo.


Yup, that works, and I use the -fl flag all the time, but it's not available when converting from selection to another (Which is crucial in my script), and then you have two choices, either convert the selection from i.e. face to verticles, select all the verts and use the "ls -sl -fl" (Like I did, but is horribly slow), or the much faster way, convert the selection from i.e. face to verticles and the filterExpand the list.
Clever
 
Old 08 August 2002   #40
Cool

I dunno if this one has been posted yet but i use it all the time with paint effects.

This darkens the stroke you have selected, hit it a couple times and if its still not dark enough hit it again.

scaleBrushBrightness 0.95 0 ;

turns the brightness down 5 percent everytime, but you can go ahead and change the number to whatever you like. Did i need to tell you pro's that, lol probaly not.

yup this one is alot simpler than everyone elses i read up here. But hey its the only one i know right now.
later guys
Rudity
__________________
I wish my lawn was emo so it would cut itself.
 
Old 08 August 2002   #41
then i wanna weight a character and i use the paint weights tool it's difficult to select a joint and rotate him a bit to get another position and look how the skin mooves. i have to leave the paint tool select the joint and rotate it. (i know that there is a way with attrCollection, but attrCollection you first have to set all up)
This is from svenip


As a side note (not MEL related) the animation while painting weights. Do something for yourself that is alot more simple.
When painting, animate the joint you are working on first. Just back and forth bending or twisting animation, about 10 to 20 frames. Then you never have to unselect the (paint weights) tool, you only have to move the animaition slider back and forth a little bit and the paint, move the slider, and paint, move the slider, and paint, its much faster try it. You dont have to setup up much animation for this at all. When you finish with the selected joint, dont forget to delete the 2 keyframes and then move to another joint. I think you'll find this much faster...


-dan
__________________
"Don't worry about the world coming to an end today.
It's already tomorrow in Australia."
---- Charles Schultz


Low - Poly Batman in Maya

Tiamat - The World Dragon (Maquette)


Online Tutorial: Character Rigging for Maya


 
Old 08 August 2002   #42
if you check higher in the thread you ll see l already said that check the thread before to put a post
 
Old 08 August 2002   #43
RELAX HADES

I didnt mean to steal your thunder man, I missed your post, thats all ...
__________________
"Don't worry about the world coming to an end today.
It's already tomorrow in Australia."
---- Charles Schultz


Low - Poly Batman in Maya

Tiamat - The World Dragon (Maquette)


Online Tutorial: Character Rigging for Maya


 
Old 08 August 2002   #44
you better not my thunder can hurt a lot hahaha..............
 
Old 09 September 2002   #45
first post and contribution to thread

Hey all! This is my first post to these forums. Been a lurker for a while, and finally got the courage to contribute.

Here is a script (dannyHelper) that I wrote to help with my character rigs. It simulates John Burnett's NullHelper, a 3ds max plugin that I used to use a lot. Basically, it creates a bunch of NURBS shapes that can be used as non-rendering animation controls. Since they're just NURBS curves, they can be easily edited to suit your needs.

I've also included a script that adds a submenu to the Create menu in case you don't want to use shelf items.

It's nothing fancy, but I just felt like sharing this. Please let me know if anyone finds it useful.
Attached Files
File Type: zip dannyhelper.zip (11.1 KB, 146 views)
 
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 07:21 PM.


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