Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • Book Overview & Buying Practical Maya Programming with Python
  • Table Of Contents Toc
Practical Maya Programming with Python

Practical Maya Programming with Python

By : Galanakis
4 (12)
close
close
Practical Maya Programming with Python

Practical Maya Programming with Python

4 (12)
By: Galanakis

Overview of this book

Practical Maya Programming with Python is a practical tutorial packed with plenty of examples and sample projects which guides you through building reusable, independent modules and handling unexpected errors. If you are a developer looking to build a powerful system using Python and Maya's capabilities, then this book is for you. Practical Maya Programming with Python is perfect for intermediate users with basic experience in Python and Maya who want to better their knowledge and skills.
Table of Contents (12 chapters)
close
close
11
Index

Practical error handling in Maya


Most of these golden rules are true in Python in general, as well as most other programming languages with exceptions. However, using Python in Maya is a different environment. There are some additional tools and constraints available. In this section, we'll go through some of the unique problems we face in Maya, and what can be done to mitigate each problem.

Dealing with expensive and mutable state

The biggest problem with error handling in Maya is that its overall design significantly constrains the choices of any system built on top of it. Consider the following script that lowercases the fileTextureName (ftn) attribute of all the file nodes in the scene:

>>> for f in pmc.ls(type='file'):
...     f.ftn.set(f.ftn.get().lower())
Traceback (most recent call last):
RuntimeError: setAttr: The attribute 'file2.fileTextureName' is locked or connected and cannot be modified.
>>> [f.ftn.get() for f in pmc.ls(type='file')]
[u'ftn0', u'FTN1', u'FTN2...
CONTINUE READING
83
Tech Concepts
36
Programming languages
73
Tech Tools
Icon Unlimited access to the largest independent learning library in tech of over 8,000 expert-authored tech books and videos.
Icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Icon 50+ new titles added per month and exclusive early access to books as they are being written.
Practical Maya Programming with Python
notes
bookmark Notes and Bookmarks search Search in title playlist Add to playlist font-size Font size

Change the font size

margin-width Margin width

Change margin width

day-mode Day/Sepia/Night Modes

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Confirmation

Modal Close icon
claim successful

Buy this book with your credits?

Modal Close icon
Are you sure you want to buy this book with one of your credits?
Close
YES, BUY

Submit Your Feedback

Modal Close icon
Modal Close icon
Modal Close icon