Practical Maya Programming with Python

By Robert Galanakis

Unleash the ability of Python in Maya and liberate your creativity

About This Book

  • Create and customise UIs utilizing normal instruments and libraries
  • Understand how Maya can leverage complicated Python features
  • Make your instruments, and Maya itself, absolutely automatable

Who This publication Is For

If you're a developer seeking to construct a strong method utilizing Python and Maya's features, then this ebook is for you. useful Maya Programming with Python is ideal for intermediate clients with uncomplicated event in Python and Maya who are looking to greater their wisdom and skills.

What you'll Learn

  • Understand the structure of Python gadgets, Maya nodes, and PyMEL
  • Write composable code that's modular and re-usable
  • Make Maya "Pythonic" by utilizing decorators and context managers
  • Learn approximately varied Maya UI innovations and libraries
  • Use PySide and PyQt to construct Maya person interfaces
  • Turn Maya right into a server that may be managed remotely
  • Understand the right way to use Python with Maya's API
  • Conquer customized nodes utilizing Python's dynamic kind creation

In Detail

Autodesk Maya is a 3D special effects software program. It deals an enormous and versatile set of beneficial properties using Python. it isn't tough to start utilizing Python in Autodesk Maya, however it should be tough to move from writing procedural, MEL-inspired instruments to development the strong but easy structures that Python promises.

Practical Maya Programming with Python can help you grasp either Python and Maya. With thorough motives, illustrative examples, and whole pattern initiatives, you'll the best way to use Python to appeal Maya into obeying your each command. useful Maya Programming with Python will train you ways PyMEL works in addition to the way to take care of blunders and write composable code in Python.

Show description

Quick preview of Practical Maya Programming with Python PDF

Similar Computer Science books

Web Services, Service-Oriented Architectures, and Cloud Computing, Second Edition: The Savvy Manager's Guide (The Savvy Manager's Guides)

Net providers, Service-Oriented Architectures, and Cloud Computing is a jargon-free, hugely illustrated clarification of ways to leverage the swiftly multiplying providers to be had on the net. the way forward for enterprise depends upon software program brokers, cellular units, private and non-private clouds, vast info, and different hugely attached expertise.

Software Engineering: Architecture-driven Software Development

Software program Engineering: Architecture-driven software program improvement is the 1st entire consultant to the underlying abilities embodied within the IEEE's software program Engineering physique of information (SWEBOK) usual. criteria specialist Richard Schmidt explains the conventional software program engineering practices well-known for constructing tasks for presidency or company platforms.

Platform Ecosystems: Aligning Architecture, Governance, and Strategy

Platform Ecosystems is a hands-on consultant that gives an entire roadmap for designing and orchestrating brilliant software program platform ecosystems. not like software program items which are controlled, the evolution of ecosystems and their myriad individuals has to be orchestrated via a considerate alignment of structure and governance.

Additional resources for Practical Maya Programming with Python

Show sample text content

We will be able to upload help for non-PyMEL gadgets via returning None if our argument doesn't have a module below the pymel namespace. The money could be a straight forward functionality utilizing a number of of the issues we have discovered in regards to the designated attributes of items. upload the subsequent functionality someplace in minspect. py: def ispymel(obj): attempt: # (1) module = obj. __module__ # (2) other than AttributeError: # (3) try out: module = obj. __name__ # (4) other than AttributeError: go back None # (5) go back module. startswith('pymel') # (6) This good judgment relies on what we already learn about Python gadgets. All user-defined forms and circumstances have a __module__ characteristic, and all modules have a __name__ characteristic. Let's stroll throughout the previous code. 1. We use try/except during this functionality, instead of checking if attributes exist. this can be mentioned within the following part, Designing with EAFP as opposed to LBYL. while you are now not acquainted with Python's blunders dealing with mechanisms together with try/except, we talk about it extra in bankruptcy four, Leveraging Context Managers and interior decorators in Maya. 2. If obj has a __module__ characteristic (for instance, whether it is a kind or function), we'll use that because the namespace. three. If it doesn't, an AttributeError should be raised, which we seize. four. attempt to get the __name__ characteristic, assuming obj is a module. there is a danger obj has a __name__ and no __module__ yet isn't really a module. we'll forget about this danger (see the part Code is rarely entire later during this chapter). five. If obj doesn't have a __name__, surrender, and go back None. 6. If we do locate what we predict is a module identify, go back precise if it starts with the string "pymel" and fake if not. we do not have to attempt this functionality at once. we will be able to simply upload one other try to our latest attempt functionality. the hot checks are in highlighted within the following code. def testpyto_helpstr(): def dotest(obj, ideal): end result = pyto_helpstr(obj) assert consequence == perfect, '%s ! = %s' % (result, excellent) dotest('maya rocks', 'search. html? q=maya+rocks') dotest(pmc. nodetypes, 'generated/pymel. middle. nodetypes. html' '#module-pymel. middle. nodetypes') dotest(pmc. nodetypes. Joint, 'generated/classes/pymel. center. nodetypes/' 'pymel. middle. nodetypes. Joint. html' '#pymel. center. nodetypes. Joint') dotest(pmc. nodetypes. Joint(), 'generated/classes/pymel. middle. nodetypes/' 'pymel. middle. nodetypes. Joint. html' '#pymel. middle. nodetypes. Joint') dotest(pmc. nodetypes. Joint(). getTranslation, 'generated/classes/pymel. middle. nodetypes/' 'pymel. middle. nodetypes. Joint. html' '#pymel. middle. nodetypes. Joint. getTranslation') dotest(pmc. joint, 'generated/functions/pymel. center. animation/' 'pymel. middle. animation. joint. html' '#pymel. middle. animation. joint') dotest(object(), None) dotest(10, None) dotest([], None) dotest(sys, None) Reload minspect and run the attempt functionality. the 1st new try may still fail. Let's pass in and edit our code in minspect. py so as to add help for non-PyMEL gadgets. The alterations are highlighted. def pyto_helpstr(obj): if isinstance(obj, basestring): go back 'search. html? q=%s' % (obj. replace(' ', '+')) if now not ispymel(obj): go back None if isinstance(obj, forms.

Download PDF sample

Rated 4.71 of 5 – based on 13 votes