Download presentation
Presentation is loading. Please wait.
1
3D Modelling & Animation
Picture... 3D Modelling & Animation Programming Maya Picture...
2
Agenda MEL Expressions and Scripting Referencing MEL Scripts
Python Scripting The Maya C++ API
3
MEL Expressions Expression Editor
Create MEL Expressions using the expression editor Windows - Animation Editors - Expression Editor Set animation times on objects transformations/ rotations/ scaling Expression Editor
4
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
5
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; };
6
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 */
7
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
8
Maya Embedded Language
output 2. Evaluate Expression (Press Enter on Numeric Keypad) 1. Define Expression
9
Access Script editor here or here
MEL output result here and here Enter MEL commands here
10
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
11
MEL Editor (Cutter) GUI
see
12
see
13
Accessing MEL Scripts Maya must access procedures via the usersetup.mel file found here: C:\Documents and Settings\username\My Documents\maya\8.5\scripts\userSetup.mel
14
procedures listed in userSetup.mel
15
Use MEL to Customize the Maya GUI and Create new Interface Components
16
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
17
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
18
Further Reading David Gould has written two books on MAYA programming
see Some excellent MEL tutorials and other resources at
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.