maya for research

this page grew out of an out-of-date "learn to use maya" page written for dgp lab members. it's purpose is to point researchers to useful resources for learning maya as a graphics research environment (and to consolidate all the questions i get asked into one place so i have more free time :-) ). if you want to learn how to light a scene, write a shader, or rig a character, you're in the wrong place. consult your local art school.

anyway, i don't endeavor to teach you a whole lot, just give you an idea of what's there so you can go learn it on your own (or decide not to).

why?

what does it do?

scripts

plugins

where do i start?

tutorials

books

websites

faq

how do i...

dgp specific

why?

maybe you want some animation data to throw at your new algorithm. maybe you just want to prototype a graphics idea. maybe you want to take existing research results and make them look cool for a paper submission, but you don't want to write code to do it all.

or maybe you want to see what artists have to go through to get something done. or maybe you're taking karan's animation course and want to build your project in maya. or maybe you are sick of looking for a bug in your code and are browsing web-pages of other people in the lab to see what they do.

what does it do?

maya does lots of things, probably a lot more than you'll ever want to know about. put simply, it lets you build 3d stuff, animate 3d stuff, simulate 3d stuff, and render 3d stuff.

more importantly, it has an open architecture that lets you build computational units and interface them with those in maya to avoid having to write the complex systems most graphics research is based on. write your part, and use what's already there as you can.

scripts

mel is the maya scripting language. actually, everything that you can do in maya is represented as some series of MEL commands. as a result, scripts will let you automate any number of complex tasks (even if you're a masochist artist who wants to learn to program). it's good for one time operations and putting "things" together. it also lets you build whatever ui you want rather painlessly. some people try more complex things with it, with varied results.

plugins

sometime back, karan gave a tutorial at dgp that included a quick presentation of the maya architecture. basically, it's broken down into a lot nodes and commands. you can write plugins that define new MEL commands. of course, you can do this in mel too, but mel can be slow for complex stuff. nodes are the internal computational elements inside of maya. they have a number of attributes, which are carried along through a network to feed other nodes. most plugins i've seen for research define new nodes and process their inputs to produce outputs. other plugins include callbacks, tools (more for production work), shapes, and shaders. plugins are written in c or c++ using the maya api. existing code can be adapted to process maya data inside one of these nodes. check the api section of the online documentation for a lot of reading.

where do i start?

introduce yourself to what maya does. look at the "essentials" section of the "instant maya" book. try some of the tutorials in it to see what's there. don't try to remember everything...unless you have a lot of free time.

alias distributes a free version of maya. it doesn't have plugin functionality, but it's good for learning the basics of the software. check http://www.alias.com

take a look in the devkit directory under the maya installation. look at some simple example plugins to see how things are put together.

tutorials

instant maya: "tutorials" section in the online help. also printed as "instant maya"

alias community (with tutorials): http://www.alias.com/eng/community/index.html

using maya: "browse subjects" in the online help. in depth discussion of everything. also printed as "using maya"

take a look in the devkit directory under the maya installation. look at some simple example plugins to see how things are put together.

books

instant maya: see note above, also a book

using maya: see note above, also a lot of books

learning maya: foundation: artist-geared tutorial

character rigging and animation: see how it's done in practice

david gould wrote a maya programming (mel and api) book. ok for entry-level concepts and as a tutorial.

websites

alias support: http://www.alias.com/eng/support/maya/index.jhtml

a question/answer page: http://www.ewertb.com/maya/api/index.html

how do i...

how do i write to an out array attribute?

MArrayDataHandle arrayHandle = data.outputValue(attributeObject);
MArrayDataBuilder builder = arrayHandle.builder();
if (desiredSize > builder.elementCount())
    builder.growArray(desiredSize - elementCount());
for(int i = 0; i < desiredSize; i++) {
    MDataHandle handle = builder.addElement(i);
    handle.set(stuff);
}
arrayHandle.set(builder);

how do i create a typed out attribute?

MObject outObject = data.outputValue(attributeObject).asSomething();
if(outObject.isNull()) {
    MFnSomethingData dataFn;
    outObject = dataFn.create();
}
//manipulate outObject and set

why doesn't the batch renderer load my plugin? why do things render differently with a batch render?

make sure it's in a directory listed in you MAYA_PLUG_IN_PATH environment variable.

i wrote this simulation. it runs fine. it renders fine, until i render the whole thing offline. then it never updates.

maya's batch renderer does not actually play the scene as it renders. there's a couple ways to fix this. one is to modify your simulator to maintain a data cache on disk that it can optionally read from (like the dynamics, fluid, and cloth simulators). another is to bake all the transforms using the bakeResults mel command . note that this approach only works if your simulation only drives keyable attributes, as opposed to shape descriptions.

dgp specific

in dgp we have maya 5.0 on most machines. if it's not on the machine you use, or if it isn't configured correctly (i.e. help server won't start or license is missing), kindly ask a sysadmin to look into it.

we have many copies of the instant maya book around. check the media suite. there's a copy a the "learning maya: foundation book" somewhere, and a copy of the "character rigging and animation" book.

faq

can i get maya on my laptop or desktop at home?

probably not. talk to your supervisor if it's a real issue. you can install it on your laptop and configure it to use a floating license, but it will run only when on the dgp network.

who can i bug for help?

karan knows the most. other good people to bug include nigel, paul, and joe. although it seems you'll most likely get referred to me. then i'll most likely refer you back here unless it's a technical question, so make it good:-)

what about the code i write? can i use it in the future when i may not have access to maya?

depends. how well do you design code? if it's a large system you're putting together, you should be able to design it such that it isn't maya dependent. or you can spend a lot of $$...



(c) 2002-2003 patrick coleman