Embed
Email

Maya

Document Sample

Shared by: ajizai
Categories
Tags
Stats
views:
4
posted:
12/19/2011
language:
pages:
10
MEL



Scripting Overview









CIS682

MEL commands

• Maya help -> MEL command reference



• MEL command line



• Script editor

– Icon

– Window->General Editors->Script editor

CIS682

Script editor

• Type in commands



• Shelf button: highlight, cmd-click, drag



• Script file: File->source script







CIS682

Attributes



sphere;

listAttr nurbsSphere1;

getAttr nurbsSphere1.tx;

setAttr nurbsSphere1.translateY 10;

aliasAttr up nurbsSphere1.ty

setAttr nurbsSphere1.up









CIS682

Simple Example

For ($j=0; $j>;

print( $vert[0] + " " + $vert[1] + " " + $vert[2] + "\n" );

};







CIS682

Animation expressions

expression -s "nurbsSphere1.tx = sin(time)";



Manipulate time slider (or ‘hit play’) to move object





Window->Animation Editors->Expression Editor



Maya->Help

Search on ‘MEL’

Differences between expression and MEL syntax

CIS682

Animation expressions

// http://www.fundza.com/melquickref2/#expression1

// NOTE: `spherè returns 2 strings. that’s why $obj is an array

// and why $obj[0] is used in the expression

string $exp = "";

string $obj[];

int $i;

for ($i=0;$i<3;$i++) {

$obj = `sphere`;

move (rand(-3,3)) (rand(-3,3)) (rand(-3,3));

$exp += "select -r " + $obj[0] + ";\n" + "move -moveY (rand(0,2));\n";

}

$exp += "select -clear;\n";

expression -s $exp -ae 1;

playbackOptions -min 1 -max 30;

play;





CIS682



Related docs
Other docs by ajizai
NH_Members
Views: 0  |  Downloads: 0
06 Mr. Wu Jun 16012009
Views: 0  |  Downloads: 0
9i CITY OF RAPID CITY
Views: 0  |  Downloads: 0
K Readiness Doc. July 2010
Views: 0  |  Downloads: 0
LookMaNoHands
Views: 0  |  Downloads: 0
97605964
Views: 0  |  Downloads: 0
NBA 2006-07 data
Views: 0  |  Downloads: 0
By registering with docstoc.com you agree to our
privacy policy

You are almost ready to download!

You are almost ready to download!