• Dmitry Shklyar interviews Weta Digital's David Gould.
    About David Gould

    David Gould is currently a Technical Director at Weta Digital in New Zealand working on The Lord of the Rings. With over a decade of experience in the computer graphics industry, David Gould has pursued the dual paths of programmer and artist. He is the author of the book "Complete Maya Programming" and is also the developer behind the Illustrate! cel-shader plugin for 3ds max, which has been used in numerous productions including Ghost in the Shell: Stand Alone Complex.

    Dmitry Shklyar: First of all, I would like to thank you for generously providing your insights to the CG community.
    Could you please start off by introducing yourself and giving us a little background information pertaining to how you got to where you are today?

    David Gould:
    I've been working in the CG industry for over a decade now. I'm one of those strange people that delve into both the artistic and technical sides of the work. While most people have a strong preference for one "side" or the other I really enjoy working in both. In fact I try to spend an equal amount of time using the tools as an artist and developing them as a programmer. Having experience as an artist is incredibly important for my programming work. Too often a programmer doesn't really know how an artist works and this is reflected by the disparity between the tool and its usefulness to the artist. What seems logical to the programmer is often illogical to the artist and vice versa. I've seen software that is very clean and elegant from a purely programming point of view but is almost unusable since it doesn't cater to the artists needs.

    When developing Maya scripts and plugins it is particularly important to understand the Maya workflow. A Maya user can be sure that the standard tools work in a consistent way. Often when a programmer who has no Maya experience writes plugins, they design it based on what approach they feel is best. The end user will be working along steadily then when they use this new plugin they often have to mentally change gears to use it. It slows everyone up and makes things unnecessarily complicated. For this reason it is important for programmers to learn how to use Maya. They should work on a shot and see how things are done. Only then will they understand where their new technology will best benefit the artist.

    Dmitry Shklyar: You have recently released the much anticipated book "Complete Maya Programming:
    An Extensive Guide to MEL and the C++ API". Can you please elaborate about what went into this invaluable reference's inception?

    David Gould:
    A lot of late nights and weekends. I was working full-time for Exluna at the time so I was limited in the amount of time I could devote to writing. Since this was my first book I picked the brains of friends and colleagues who'd already written books. Many had horror stories about the whole writing and production process. As such I prepared myself mentally for a long, hard struggle. I was pleasantly surprised to find how smoothly the writing and final production went. Having written the first hundred pages the publisher had it reviewed by some well known industry experts. Their feedback was very positive. Since there was no major critical problem I simply continued writing as before. I wasn't obliged to change my style or rework my approach so the whole writing process was very natural. The final production process (proofreading, copy-editing, etc) also went very smoothly. Morgan-Kaufmann is a very experienced publisher of technical books so the entire process from the initial outline to the final printing went just fine.

    I guess they were surprised to hear that I wanted to design the cover. They don't have many programming authors that actually want to do sketching and drawing.

     12345>>
  • Dmitry Shklyar: Did you start writing this book before or after beginning work for Weta Digital? If it is the latter,
    were there any valuable lessons learnt at Weta that made their way into this tome?

    David Gould:
    The book was already finished when I joined Weta Digital. In hindsight I was very pleased to have finished the book since the production was already in serious crunch mode when I started. I had little time for anything else let alone writing.

    Dmitry Shklyar: What level of user is this book intended for?

    David Gould:
    I really worked hard to ensure that the book is accessible to Maya users of all levels. I didn't make any prior assumptions about the reader's knowledge of Maya programming so I started at the very basics. I was very careful to ensure that the reader understood how Maya works internally. Understanding this is the key to using and programming Maya as such I made this material accessible to both artists and programmers alike. Anyone who is using Maya should read that section of the book.

    The coverage of MEL assumes you have no prior programming experience and slowly introduces you by beginning with basic examples. It steadily builds on the basic ideas to finally present real-world examples that you can use in your daily work. I was careful not to turn the book into a purely reference manual since the online Maya documentation already covers that material in great detail. I wanted to instill in the reader a general understanding of what you could do with MEL and how to best use it. Knowing what is possible is half the battle. The other half is making it a reality. By learning the basics of MEL any user can then use any of the MEL commands in new and interesting ways.

    The C++ API section assumes you have some basic C++ programming experience. There are so many good books that teach C++ that I felt my book didn't need to replicate that information.

    Instead I have included a complete list of good introductory programming books in the appendix. With just some basic C++ experience the reader can then delve into the C++ API chapters. They start with very basic examples and then extend those examples into a complete plugin. The later chapters cover some of the different types of nodes (deformers, locators, etc) you can develop.

    I consider the book more as a guide rather than a reference, though it also serves that purpose. I keep a copy on my desk and often use it to look up the name and syntax of a function. The subject index was meticulously written to make finding particular commands and topics as easy as possible.

    Dmitry Shklyar: Can an artist with no programming experience expect to feel comfortable with MEL after reading your book?

    David Gould:
    Many artists would love to gain more control over Maya. They know exactly what they want but don't have the skills to develop the necessary tools. This can be extremely frustrating. The only alternative is to learn a complex programming language. By writing this book I wanted to empower the artist. I wanted to show that they could write simple MEL scripts that would save them a lot of time and effort. Things that they would do manually before could be greatly automated and simplified. There are features in Maya that they maybe didn't know existed. I wanted to dispel many of the myths about programming by teaching MEL in such a way that even the beginner can understand. It is a quite simple language and since it's interactive the reader can learn so much faster. They can experiment more without being caught up in the gory details of pointers, memory allocation, compiling, makefiles, etc.

    I've received a lot of encouraging feedback from non-programmers who have really enjoyed the book. I've also had great feedback from experienced programmers who have also found the book really helpful. I designed the book to cover topics of interest to Maya users of all experience levels.

     
  • Dmitry Shklyar: Are you planning a supplement/sequel to your book which will offer readers advanced lessons pertaining to scripting and characters?

    David Gould:
    When I put together my original outline for the book there were literally hundreds of topics I wanted to cover. The book would have been 1,000's of pages long and weighed a ton. The sheer amount of work would have also meant that it still wouldn't be finished. I then decided to focus on the most important foundation work. I wanted to create a foundation of knowledge that later books could build on. This is why this book covers the fundamentals of Maya programming both for MEL and the C++ API. I have more than enough material to write another book. If I were to write another book it would build on the material in the current book and cover more advanced Maya programming topics. In particular it would cover games and visual effects programming in greater detail.

    Dmitry Shklyar: Are there any pitfalls one should look out for when beginning with MEL and the Maya C++ API?

    David Gould:
    Start with an open mind. The first pitfall is thinking that it is too difficult or complex. Learning MEL can be quite easy, you've just got to start. This is why the introductory chapters were written to slowly guide you through using MEL.

    As for technical pitfalls, it is important to remember that although MEL resembles the C language it is different enough to cause some confusion. It is for this reason that I wrote an appendix explaining the differences between the two languages. This will save a lot of headaches when MEL doesn't quite work as you may have expected. MEL scripts are, for the most part, operating system independent. This means that your script should run without problem on all the Maya supported operating systems, currently Irix, Linux, Windows, and Mac OS X. It is important however to understand that there are sometimes subtle differences. The Linux version of Maya doesn't support all the image formats that the Windows version does. The format of directory paths are often different between operating systems. If you are having problems running your scripts on different operating systems be sure to look at the command reference documents in detail.

    Having said all this, the development of MEL scripts and C++ plugins follows the standard scripting and programming steps that you find with any language. As each topic is covered I've been careful to note any unexpected behaviour or issues that may arise. I wanted the book to reflect the "reality" of Maya programming rather than the theoretical. It is clear that Maya has some quirks and where possible I explain them in detail.

     
  • Dmitry Shklyar: It is my understanding that you have done extensive work with 3dsMax. Is there a reason you chose to focus on writing a book about Maya instead of Max?

    David Gould:
    I started developing plugins for 3D Studio 3.0 back in 1992 when it still ran on MS-DOS. I've continued developing plugins for 3dsmax through all its versions. While its internal architecture was very revolutionary when it was first introduced I feel that it is beginning to show its age. Admittedly Maya isn't that young but its overall architecture is more consistent and flexible. This means that it is far more extensible than 3dsmax's architecture. The way the Maya dependency graph is designed you could use Maya to do just about any data processing task, even those tasks that don't involve 3D. 3dsmax tends to be more compartmentalized in that it makes clear distinctions about what a plugin can and can't access. It requires that you write a renderer plugin to do rendering and a modeling plugin to do modeling and never can you mix the two. Maya's more open approach means it is more accessible and extensible. Don't get me wrong, Maya has its fair share of issues and problems. Who knows, one day I may also write a 3dsmax programming book.

    Dmitry Shklyar: Where do you see Maya's internal scripting language, MEL, going in the next few years? Where do you see scripting capabilities of other packages going?

    David Gould:
    Admittedly MEL has its shortcomings. Though very much like C in syntax it doesn't handle all the basic 3D datas as consistently and transparently as it should. Vectors and matrices aren't really first class citizens. You can't easily access vector components or transform them with matrices. There isn't a clear means of getting attribute values into these types. There are some subtle inconsistencies when using MEL in an expression as opposed to a script.

    This can catch you out if you aren't aware of this. MEL also lacks a lot of the more advanced string processing and file management features. Unfortunately Alias | Wavefront haven't addressed a lot of these issues. It would seem that Alias | Wavefront aren't considering extending and improving the language beyond its current form.

    If I were to design a 3D package from scratch today I would develop the underlying architecture as a series of C++ libraries. I would then use a package like SWIG ( www.swig.org ) to create bindings to other scripting languages like Python and Perl. These modern scripting languages are constantly being developed and improved. For this reason alone it is far better to make use of the existing scripting languages rather than invent your own. You also give the end user the possibility to script in whatever language they prefer rather than forcing them to use a 3D package specific one. Often the custom scripting languages like Maxscript and MEL are based on a common language like C but they diverge in sometimes inconsistent ways. The syntax can sometimes become unnecessarily convoluted. This can later cause subtle problems as things don't work in quite the way you are expecting. This means the end user must do mental gymnastics each time they use a custom scripting language. It is far better to let the user pick a scripting language they prefer and use in all their 3D packages. Being able to write your own libraries and extend the language with modules that bind to these libraries is also very important for larger studios. Companies like Discreet and Alias | Wavefront should devote their efforts on creating better 3D tools rather than the design and implementation of custom scripting languages.

     
  • Dmitry Shklyar: How has your work at Weta affected your development as a programmer and digital artist?

    David Gould:
    In this industry the learning process never ends. It has definitely been interesting to learn and compare Weta Digital's approach and methodologies to those of other companies. I've been fortunate at Weta Digital to not really be pigeonholed into a particular department. I work on research and development projects as well as completing actual shots. In fact, everyone at Weta Digital is given the opportunity to develop their own ideas and approaches and then present them. If the idea stands on its own merits it will often be accepted, then integrated into the production pipeline. There are no political issues of crossing departmental boundaries. This company culture allows me to participate in the development of tools and technology for many different departments.

    Dmitry Shklyar: How has your stay at Exluna influenced your development? Any plans for future books pertaining
    to the Renderman Spec and/or renderer design?

    David Gould:
    Rendering has been, and still is, a real passion of mine. I've been fortunate enough to work on rendering software that cover the two extremes; Illustrate! and its focus on non-photorealistic rendering, and Entropy a devoutly photorealistic renderer. There is a lot of material that I'd love to write about both these types of renderers. Concretely, I still think that a good introductory book on writing Renderman shaders is still missing. There is a new book called "Essential Renderman: fast" that covers some of this material, however I still feel that it makes too many assumptions about the user's existing programming and mathematics experience. I'd love to write a book that made no such assumptions. In fact I think writing Renderman shaders would, in itself, be a great way of learning the basic concepts of computer graphics since the end result is a visual image. It is so much easier for people to relate to an image than a series of Greek symbols. The direct link between the shader and final image would allow people to visually grasp many complex mathematical and programming topics.

    Dmitry Shklyar: Do you have any suggestions for aspiring programmers/TD's?

    David Gould:
    Don't become discouraged by the seemingly overwhelming amount of material that you need to learn. Just take it one step at a time and assimilate the material patiently. Becoming a good programmer/TD takes time. Learn as much as you can about mathematics since it is the foundation on which all computer graphics is based. Learn about good programming practices and approaches. Formal programming training such as an undergraduate degree will hold you in good stead throughout your career.

    Always be prepared to learn new ways and approaches. It is discouraging to see experienced programmers/TDs who get stuck in their ways. There are always different ways of a tackling a problem and while you may think you have the best solution chances are you don't. The more diverse your knowledge the better equipped you'll be to tackle the problems as they arise. If there is any guarantee in production it is that you will always be faced with problems and situations you've never dealt with before. Having a good foundation in mathematics and programming will get you most of the way. Did I mention you'll also need a lot of elbow grease and stubborn persistence?

    Dmitry Shklyar: Do you have any plans for additional publications in the foreseeable future? Any other projects you want us to know about?

    David Gould:
    I have tons and tons of ideas on new software and books that could be written. The problem is finding the time to do it all. I currently don't have any fixed plans after "The Return of the King", but there are plenty of people and companies who want me to work with them. There are still so many artistic and technical challenges still remaining. Admittedly the CG industry is maturing but there is still so much left to do. It is encouraging to know that people who learn Maya programming will definitely have plenty of work in the future.

    Purchase the book online:

    Discuss this article on CG Talk - Digital Effects Professionals >>

    Back to 3D Festival

    Links
    David Gould website

    Interview byt: Dmitry Shklyar
    Final edit: Tito A. Belgrave

     

blog comments powered by Disqus