Ok I made it do the supports as well….
This is one of the sloppiest scripts I have ever written but I am in a hurry. The supports will always go to 0 in Y so that they are always on the ground despite what is happening with the track. I also changed the way that the sleepers are distributed. Instead of a count you say the spacing between them and it figures out the rest.
Good Luck!


Nebs Maya / .mel
I came up with a script that will auto-generate train tracks along a curve.
Just draw a curve in maya and type re_createMineTracks. It will auo loft the rails so make sure your loft settings are what you want beforehand. There are some easy tweakables such as sleeper count(the cross pieces) and rail width. Go nuts. I will release a newer version soon that will also generate a truss-system under the rails.


Nebs Game Developement, Maya / .mel
This script will record a curve and save it to the Shelf.
Its very useful to save out curve presets. I.E. you can create a library of curves and recall them later.
global proc re_getCurvePointInfo()
{
string $lssl[] = `ls -sl`;
int $degree = `getAttr ($lssl[0]+”.degree”)`;
select ($lssl[0]+”.cv[*]“);
string $allPoints[] = `filterExpand -ex true -sm 28`;
string $curveStart = (”curve -d “+$degree);
for ($i = 0; `size($allPoints)` > $i; ++$i)
{
float $loc[] = `xform -q -ws -t $allPoints[$i]`;
$curveStart += (” -p “+ $loc[0]+ ” “+ $loc[1]+ ” “+ $loc[2]);
}
textToShelf (”Curve”, $curveStart);
print $curveStart;
}
Nebs Game Developement, Maya / .mel
This script is used for creating small hairs.
You can control the hair length, direction and rotation. Just take a look at the variables in the script.
A couple of important notes. The model you are painting on must be frozen. Don’t ask me why but the script paint tool takes that into consideration. Also make sure your uv’s are in 0-1 space as well as not overlapping. This is important to get proper distribution.. Just type re_paintHairs to get started.

Nebs Art, Game Developement, Maya / .mel
If you need to know an objects name but you only have a component then try this…
string $parent[] = `listRelatives -p`;
$parent = `listRelatives -p $parent[0]`;
string $obj = $parent[0];
$obj will the the object that you need.
Nebs Game Developement, Maya / .mel
Ok this one is a good one… I wanted a way to turn a selection of edges into a curve… Little did I know it would be a huge nightmare. But i did get a script that works. Its not very well commented but download it and give it a try.

Type makeCurveFromEdges to run it.
Here is how you work it.
1. You have an object and you would like a curve that follows a line of edges.
2. Select the edges.
3. Run the script. And you get a wonderful curve that follows the line of edges you had selected.

Nebs Game Developement, Maya / .mel
polyInfo -ev;
Is the shittiest command ever. This is what it returns..
EDGE 35: 35 36 Hard
It actually returns that whole string as one array entry. You have to then tokenize the return by whitespace and extract the info you want. Its the most ridiculous thing ever. And in maya 8.5 its still there. WTF.
string $lssl[] = `ls -sl`;
string $edgeVerts[] = `polyInfo -ev $lssl[0]`;
string $buffer[];
$numTokens = `tokenize $edgeVerts[0] ” ” $buffer`;
string $verts[] = {$buffer[2],$buffer[3]};
So better yet just make a global proc that will do that stuff…
global proc int[] returnSharedVerts(string $edge)
{
int $out[];
string $edgeVerts[] = `polyInfo -ev $edge`;
string $buffer[];
$numTokens = `tokenize $edgeVerts[0] ” ” $buffer`;
$out[0] = $buffer[2];
$out[1] = $buffer[3];
return $out;
}
Nebs Game Developement, Maya / .mel
So in the course of making some icons for Poker Smash I came accross a need to make piles of stuff. I did not really wanna do it by hand so I wrote MEL script. It will take whatever object you select and make a pile of it. There are some settings inside the script so open it up and take a look around. You can change the radius, object count, height, and random rotation of the pile. Oh and make sure that your object is at the origin. I am too lazy right now to make it work off of any random point. 
Here is an example of what the script can do. Its not shown here but there is some random rotation that applies too.

Oh and yes the pieces do inter-penetrate. Again I am lazy.
Nebs Game Developement, Maya / .mel
I totally recomend that any Maya user puts their hotkeys & settings into a mel file. Maya has a wonderful way of screwing up your settings often. This way all you do when that happens is delete your saved prefs and run the mel script and you are back in action! An example for setting hotkey would look like this…
//// Toggle Backface Culling
$hotKey = `nameCommand
-annotation “Toggle Backface”
-command “ToggleBackfaceCulling”`;
hotkey -k “F4″ -name $hotKey;
Download My Settings…
This file is meant as an example. It calls some external files which are not included.
Nebs Game Developement, Maya / .mel