MEL scripts


#241

hi guys…excuse me if this question ( or script ) as been answered before, but I got tired of reading some many posts…lol.

I’m looking for a script that would randomize translation, rotation and scale selected objects…with the ability to set given values…ex:: to make the object move between -1 , 1.5 or rotate in X, Y or Z or ( all axises ) or scale…I’m sure you guys know what I’m trying to say…can anyone direct me to where I can find such a script…thx!!


#242

Are you still looking for script :slight_smile:

http://puppettd.com/downloads/dgRandomiser.rar


#243

Here is FaoGen.Mel 1.0 ::Download::

It has all the settings that the stand alone FaoGen offers. To use it is simple:

[ol]
[li]Select the object.[/li][li]Type the name in the top box.[/li][li]Hit the export button.[/li][li]Make settings to your needs.[/li][li]Finally, hit the render button.[/li][/ol]The *.PNG file will spit out to your project directory (The name of the image is NameOfObjectInMaya.png). **You will need FaoGen (http://www.rusteddreams.net) to use this mel, and please install in the default directory, or the mel will not work.

Future updates will be to have multiple objects for rendering, the calculations for iterations and image importing.


#244

I updated the script to set up a batch if you want. So now you can calculate objects individually in succession.

You can export with multiple objects selected and they will calculate and spit out individual textures for them.
:::link:::


#245

I posted this in a separate thread but I figured I’d put it here as well…

Select either 1 or 2 edges on an edge loop/ring/border.
If you had 1 edge selected it will select the entire edge loop/ring/border
If you had 2 edges selected it will select the edge loop/ring/border between the two.


 global proc polySelectBetween(string $method)
 {
 	string $edges[] = `getEdges`;
 	int $size = `size $edges`;
 
 	if ($size == 1)
 	{
 		string $buffer[];
 
 		tokenize $edges[0] "[]" $buffer;
 		string $cmd = "polySelect -";
 		$cmd += $method;
 		$cmd += " ";
 		$cmd += $buffer[1];
 
 		eval($cmd);
 	}
 	else if ($size > 1)
 	{
 		string $buffer[];
 
 		$method = $method + "Path";
 
 		tokenize $edges[0] "[]" $buffer;
 		string $cmd = "polySelect -";
 		$cmd += $method;
 		$cmd += " ";
 		$cmd += $buffer[1];
 
 		tokenize $edges[1] "[]" $buffer;
 		$cmd += " ";
 		$cmd += $buffer[1];
 
 		eval($cmd);
 	}
 }
 

To call it, use the correct one of these depending on what kind of selection you want:


 polySelectBetween("edgeLoop");
 polySelectBetween("edgeRing");
 polySelectBetween("edgeBorder");
 

#246

thanks for this useful script:

just a question

polySelectBetween(“edgeBorder”); does not functioning.

the other works as a charm. but edgeborder I couldnt achive.

may you tell where I am wrong ?
thanks much


#247

Are the edges you have selected actually border edges?


#248

thanks for answer.I understood.and a screenshot I sent about how to.


#249

maybe will handy for some1
setAttr “FurFeedback.visibility” (!getAttr "FurFeedback.visibility");


#250

hotkeys to toggle the AE window and the AE docked tag.

bind this to ctrl+a to toggle the AE window:

if(`isAttributeEditorVisible`)
 {
 	setChannelBoxVisible(1);
 }else{
 	if (`window -ex AEWindow` && `window -q -vis AEWindow`==1)
 		window -e -vis 0 AEWindow;
 	else openAEWindow;
 }

and this to ctrl+shift+a to toggle the AE window docking (main window / separate window):

if (`optionVar -q aeInMainWindow` == 1)
 {
 	optionVar -iv aeInMainWindow 0;
 	print "AE: Separate Window";
 }
 else
 {
 	optionVar -iv aeInMainWindow 1;
 	print "AE: Main Maya Window";
 }
 

just in case someone finds these usefull :slight_smile:


#251

source removeWebButton.mel;//add this line to userSetup.mel


#252

updated
a weird refresh bug in XP fixed.

little code, but it clears one of your annoyance in maya Interface;

source toggleDblShelf.mel;//add mel in scripts path.add this line to userSetup.mel.run maya.


#253

this is a way for debugging to mel scripters//easy print variables without writing dirty //print blabla codes.
works in 8.5
not before


global proc ktPrintSelected()
{
global string $gCommandExecuterTabs;
string $array[] = `tabLayout -q -ca $gCommandExecuterTabs`;
int $selTabIdx = `tabLayout -q -selectTabIndex $gCommandExecuterTabs` - 1;
string $curFormLayout = $array[$selTabIdx];
string $tabChldrn[] = `formLayout -q -ca $curFormLayout`;
string $curExecuter = $tabChldrn[0];
string $ktPrintSel=`cmdScrollFieldExecuter -q -slt $curExecuter`;
eval ("print " + $ktPrintSel);
};


#254

if a few a description is a need:
useful if you assign a hotkey.or as a shelf button.

when you need to select similar objects as your current selected nodes.
(ie. select a subd in scene.this tinycode will select all subds in scene.)

http://www.ddmel.com/miscfiles/ktSelectSimilars.mel


#255

 
 
proc j3dExpandTopNodeAndFrameInHyperGraph(string $nodes[], string $hyperPanel)
{
	for ($node in $nodes ) {
		string $cur = `firstParentOf($node)`;
		string $next = $cur;
		while($cur != "") {
			if (j3dNodeHasConnection($cur, "hyperGraphLayout")) {
				$next = `firstParentOf($cur)`;
				if (`size($next)`) {
					if (j3dNodeHasConnection($next, "hyperGraphLayout")) {
						$cur = $next;
						continue;
					}
				}
				break;
			}
			else
			$cur = `firstParentOf($cur)`;
		}
		if ($cur != "") {
		 select $cur;
		 hyperGraph -e -ua $hyperPanel;
		}
	}
	select $nodes;
	hyperGraph -e -fr $hyperPanel;
}
global proc int j3dNodeHasConnection(string $node, string $connection)
{
	string $cons[] = `listConnections $node`;
	string $cat = `j3dConcatenateStringArray($cons)`;
	if ( size(`match $connection $cat`) )
	 return 1;
	else
	 return 0;
}
global proc string j3dConcatenateStringArray(string $arr[])
{
	string $ret;
	for ($entry in $arr) {
		$ret = $ret + $entry + " ";
	}
	return $ret;
}
global proc j3dFrameSelected()
{
	string $panel = `getPanel -underPointer`;
	if ( size(`match hyperGraphPanel $panel`) ) {
		$panel += "HyperGraphEd";
	 string $sel[] = `ls -sl`;
	 j3dExpandTopNodeAndFrameInHyperGraph($sel, $panel);
	}
	fitPanel -selected;
}
global proc j3dUtils()
{
	nameCommand -annotation "j3d Frame Selected" -command "j3dFrameSelected();" j3dFrameSelectedCommand;
	hotkey -k "f" -name "j3dFrameSelectedCommand";
} 
j3dUtils();
 
//----------------------------------------------------------------------
// proc cookie recipe
// this is a recipe for delicious chocolate chip cookies
//----------------------------------------------------------------------
//	Soft Chocolate Chip Cookies
//	Ingredients:
//	3/4 cup unsalted butter;
//	2/3 cup dark brown sugar;
//	2/3 cup granulated sugar;
//	2 tbsps light corn syrup;
//	1 tbsp cider vinegar or white vinegar;
//	2 large eggs;
//	1 tbsp vanilla;
//	1/2 tsp salt;
//	1/2 tsp baking powder;
//	1/4 tsp baking soda;
//	2-1/4 cup flour;
//	3 cups semisweet choc chips.
//	Preheat oven to 375
//	Grease baking sheets
//	Cream together butter, sugars, corn syrup & vinegar, and then beat in the eggs.
//	Beat in vanilla, salt, baking powder & baking soda.
//	Stir in flour & chocolate chips.
//	Drop dough by tablespoon-full on sheets.
//	Cook for 10 minutes, so centers look underdone.
//	Note: I usually make the cookies bigger.
//---------------------------------------------------------------------- 


#256


changes selected object’s materials sequentially
assign this code to a hotkey ( I use Ctrl + (+) )

source ktAssignNextShader;

http://www.ddmel.com/mels/ktAssignNextShade/ktAssignNextShade.rar


#257

ktUIDisplayLayer.mel

Description:Adds some extra useful buttons to Display Layer

update #1@25.03.2007~16:04pm (select layer by object button added)


#258

man … ktUIDispayLayer.mel is wonderfull …

***** :thumbsup:


#259

hi…I’m looking for a spinEdge script…not the spinQuad one where you have to select twoQuads…but the one where you only need to select the edge that’s shared by the twoQuads…anyHelp?

one that would spinAround faces that are “not” 4Sided would be nice too…does anyone know where I can find something like that?

I did a search for it already, but the links that suppose to lead to them all seem to be broken…

ltr-


#260

auto lookat selection .mimics as modo or zbrush style.

when you auto mode:
you will autofocus to selected stuff.it can be anything.
it will speed up usage of maya sometimes.

because you are free to press ’ f ’ button next to zoom scene.

usage:
toggle_ktCurViewLookAt for on / off auto look at selection mode.

toggle_ktCurViewLookAt