3d modelling & animation
DESCRIPTION
Picture. 3D Modelling & Animation. Programming Maya. Picture. Agenda. MEL Expressions and Scripting Referencing MEL Scripts Python Scripting The Maya C++ API. MEL Expressions. Create MEL Expressions using the expression editor Windows - Animation Editors - Expression Editor - PowerPoint PPT PresentationTRANSCRIPT
UFCEKT-20-33D Modelling and Animation
3D Modelling & Animation
Picture...
Programming Maya Picture...
UFCEKT-20-33D Modelling and Animation
Agenda
MEL Expressions and Scripting Referencing MEL Scripts Python Scripting The Maya C++ API
UFCEKT-20-33D Modelling and Animation
MEL Expressions
Create MEL Expressions using the expression editor Windows - Animation Editors - Expression Editor
Set animation times on objects transformations/ rotations/ scaling
Expression Editor
UFCEKT-20-33D Modelling and Animation
Maya Embedded Language
Syntax very similar to the C language syntax Supports usual types, conditional statements and control structures Variables declared before use prefixed with the $ symbol
string $message = “Hello World”; print ($message + “ from Maya”)
Supports arrays string $names[] // an array of names
Does not support structured types or arrays of arrays (tables)
string $name[]
string $meshPosition[]
$meshPostion[2] = $name not supported
UFCEKT-20-33D Modelling and Animation
Maya Embedded Language
Has many functions to manipulate strings which can overcome limitations having no support for structured types or tables - see Maya MEL API from Help
Suppotrs procedures to encapsulate functionality for resuse
global proc makeSphere()
{
sphere;
move 0 0 1;
};
UFCEKT-20-33D Modelling and Animation
Maya Embedded Language
Procedures can take arguments and return values
global proc string[] generatePopulation(int $popSize, int $length){
/*
generates and returns an initial population of binary string values
of length $length and population size $popSize */
UFCEKT-20-33D Modelling and Animation
Maya Embedded Language
Maya has a script editor for entering MEL statements Very basic scripting support - Maya 8.5 introduced script line numbering! No syntax highlighting or auto indent etc.
MEL Script Editor
UFCEKT-20-33D Modelling and Animation
Maya Embedded Language
1. Define Expression 2. Evaluate Expression
(Press Enter on Numeric Keypad)
output
UFCEKT-20-33D Modelling and Animation
MEL output result here and here
Access Script editor here or here
Enter MEL commands here
UFCEKT-20-33D Modelling and Animation
Cutter - MEL (Java) Based Editor
Java based editor called Cutter Provides enhanced editing environment syntax highlighting indent etc. Easier access to MEL command reference from Maya Also support for Renderman (Pixar) see www.fundza.com
UFCEKT-20-33D Modelling and Animation
MEL Editor (Cutter) GUI
see www.fundza.com
UFCEKT-20-33D Modelling and Animationsee www.fundza.com
UFCEKT-20-33D Modelling and Animation
Accessing MEL Scripts
Maya must access procedures via the usersetup.mel filefound here:
C:\Documents and Settings\username\My Documents\maya\8.5\scripts\userSetup.mel
UFCEKT-20-33D Modelling and Animationprocedures listed in userSetup.mel
UFCEKT-20-33D Modelling and Animation
Use MEL to Customize the Maya GUIand Create new Interface Components
UFCEKT-20-33D Modelling and Animation
Python Scripting
Python open-source
object oriented language
Interfaces with development
frameworks such as .NET
Enter Python expressions
using the text interface
choose the Python tab
UFCEKT-20-33D Modelling and Animation
Maya C++ API
Maya supports the development of plug-ins written in C++ Creates dynamic link libraries for extending Maya via additional plug-ins
for various utilities and tools May also has a MIDI API Versions of Maya come with a Visual Studio Project Wizard that can be
installed in Visual Studio to facilitate the creation of Maya dynamic link library plug-ins (.mll) e.g the 3D Studio mesh import plug-in is 3ds.mll (Maya Link Library) (see the readme in the zip file)
Maya 8.5 has a project wizard for Visual Studio 8 (Visual Studio 2005) Reminder:These products are free to CEMS students via the Microsoft
Software Alliance
UFCEKT-20-33D Modelling and Animation
Further Reading
David Gould has written two books onMAYA programming
see www.davidgould.com
Some excellent MEL tutorials and other resources at www.robthebloke.org