logo资料库

Maya Programming with Python Cookbook.pdf

第1页 / 共443页
第2页 / 共443页
第3页 / 共443页
第4页 / 共443页
第5页 / 共443页
第6页 / 共443页
第7页 / 共443页
第8页 / 共443页
资料共443页,剩余部分请下载后查看
Maya Programming with Python Cookbook
Credits
About the Author
About the Reviewer
www.PacktPub.com
eBooks, discount offers, and more
Why subscribe?
Preface
What this book covers
What you need for this book
Who this book is for
Sections
Getting ready
How to do it…
How it works…
There's more…
See also
Conventions
Reader feedback
Customer support
Downloading the example code
Downloading the color images of this book
Errata
Piracy
Questions
1. Getting Started with Maya
Introduction
Using the script editor to investigate functionality
How to do it...
How it works...
There's more...
See also
Running code from the script editor
Getting ready
How to do it...
How it works...
There's more...
Importing Maya's built-in Python functionality
How to do it...
How it works...
There's more...
Accessing documentation for a specific command
How to do it...
How it works...
There's more...
Understanding Create, Query, and Edit flags
Getting ready
How to do it...
How it works...
There's more...
See also
Adding custom folders to your script path
How to do it...
How it works...
There's more...
Writing and running an external script
Getting ready
How to do it...
How it works...
There's more...
Calling a MEL script with Python
Getting ready
How to do it...
How it works...
2. Creating User Interfaces
Introduction
Making a basic window
How to do it...
How it works...
There's more...
Simple controls – making a button
How to do it...
How it works...
There's more...
Retrieving input from controls
How to do it...
How it works...
Using classes to organize UI logic
How to do it...
How it works...
There's more...
Using nested layouts
How to do it...
How it works...
There's more...
Using tabs and scrolling
How to do it...
How it works...
There's more...
Adding menus to your UIs
How to do it...
How it works...
There's more...
3. Working with Geometry
Introduction
Working with selected objects and checking node type
How to do it...
How it works...
There's more...
Accessing geometric data in polygonal models
Getting ready
How to do it...
How it works...
There's more...
Accessing geometric data in NURBS objects
Getting ready
How to do it...
How it works...
There's more...
Creating curves
How to do it...
How it works...
There's more...
See also
Creating new polygonal faces
How to do it...
How it works...
There's more...
Creating new modifiers (noise)
How to do it...
How it works...
There's more...
Creating novel primitives (tetrahedron)
Getting ready
How to do it...
How it works...
There's more...
4. Giving Things a Coat of Paint – UVs and Materials
Introduction
Querying UV data
Getting ready
How to do it...
How it works...
Laying out UVs with Python
Getting ready
How to do it...
How it works...
There's more...
See also
Creating shading networks with code
How to do it...
How it works...
There's more...
See also
Applying shaders to objects
Getting ready
How to do it...
How it works...
There's more...
Using shading nodes for non-shading tasks
Getting ready
How to do it...
How it works...
There's more...
5. Adding Controls – Scripting for Rigging
Introduction
Creating skeletons with script
How to do it...
How it works...
There's more...
Setting up set-driven key relationships with script
Getting ready
How to do it...
How it works...
There's more...
Adding custom attributes and locking and hiding attributes
Getting ready
How to do it...
How it works...
There's more...
Setting up inverse kinematics (IK) with script
Getting ready
How to do it...
How it works...
There's more...
6. Making Things Move – Scripting for Animation
Introduction
Querying animation data
Getting ready
How to do it...
How it works...
There's more...
Working with animation layers
How to do it...
How it works...
There's more...
Copying animation from one object to another
Getting ready
How to do it...
How it works...
There's more...
Setting keyframes
Getting ready
How to do it...
How it works...
There's more...
Creating expressions via script
Getting ready
How to do it...
How it works...
There's more...
7. Scripting for Rendering
Introduction
Creating and editing lights
Getting ready
How to do it...
How it works...
There's more...
Creating GUI to control all lights
Getting ready
How to do it...
How it works...
There's more...
Creating cameras from code
Getting ready
How to do it...
How it works...
There's more...
Rendering a sprite sheet
Getting ready
How to do it...
How it works...
There's more...
See also
8. Working with File Input/Output
Introduction
Using the fileDialog2 command to navigate the file system
How to do it...
How it works...
There's more...
Reading text files
Getting ready
How to do it...
How it works...
There's more...
Writing text files
Getting ready
How to do it...
How it works...
There's more...
See also
Writing binary data
Getting ready
How to do it...
How it works...
There's more...
Reading binary data
Getting ready
How to do it...
How it works...
There's more...
Reading multiple types of files
Getting ready
How to do it...
How it works...
There's more...
9. Communicating with the Web
Introduction
Opening a web page from script
How to do it...
How it works...
There's more...
Grabbing data from a server
Getting ready
How to do it...
How it works...
There's more...
Working with XML data
Getting ready
How to do it...
How it works...
Working with JSON data
Getting ready
How to do it...
How it works...
There's more...
See also
Sending POST data to a web server from Maya
Getting ready
How to do it...
How it works...
There's more...
10. Advanced Topics
Introduction
Wrapping Python functionality in MEL
Getting ready
How to do it...
How it works...
There's more...
Creating custom tools using contexts
Getting ready
How to do it...
How it works...
There's more...
Using script jobs to trigger custom functionality
Getting ready
How to do it...
How it works...
There's more...
Using script nodes to embed code in scenes
Getting ready
How to do it...
How it works...
There's more...
Combining script jobs and script nodes
Getting ready
How to do it...
How it works...
There's more...
Index
Maya Programming with Python Cookbook
Table of Contents Maya Programming with Python Cookbook Credits About the Author About the Reviewer www.PacktPub.com eBooks, discount offers, and more Why subscribe? Preface What this book covers What you need for this book Who this book is for Sections Getting ready How to do it… How it works… There's more… See also Conventions Reader feedback Customer support Downloading the example code Downloading the color images of this book Errata Piracy Questions 1. Getting Started with Maya Introduction Using the script editor to investigate functionality Running code from the script editor How to do it... How it works... There's more... See also Getting ready How to do it... How it works... There's more... How to do it... Importing Maya's built-in Python functionality
Accessing documentation for a specific command Understanding Create, Query, and Edit flags Adding custom folders to your script path Writing and running an external script How it works... There's more... How to do it... How it works... There's more... Getting ready How to do it... How it works... There's more... See also How to do it... How it works... There's more... Getting ready How to do it... How it works... There's more... Getting ready How to do it... How it works... How to do it... How it works... There's more... How to do it... How it works... There's more... How to do it... How it works... Calling a MEL script with Python 2. Creating User Interfaces Introduction Making a basic window Simple controls – making a button Retrieving input from controls Using classes to organize UI logic How to do it... How it works... There's more... Using nested layouts
Using tabs and scrolling How to do it... How it works... There's more... How to do it... How it works... There's more... How to do it... How it works... There's more... Adding menus to your UIs 3. Working with Geometry Introduction Working with selected objects and checking node type Accessing geometric data in polygonal models Accessing geometric data in NURBS objects How to do it... How it works... There's more... Getting ready How to do it... How it works... There's more... Getting ready How to do it... How it works... There's more... Creating curves How to do it... How it works... There's more... See also How to do it... How it works... There's more... How to do it... How it works... There's more... Getting ready How to do it... Creating new polygonal faces Creating new modifiers (noise) Creating novel primitives (tetrahedron)
4. Giving Things a Coat of Paint – UVs and Materials How it works... There's more... Introduction Querying UV data Getting ready How to do it... How it works... Laying out UVs with Python Creating shading networks with code Applying shaders to objects Using shading nodes for non-shading tasks 5. Adding Controls – Scripting for Rigging Introduction Creating skeletons with script Getting ready How to do it... How it works... There's more... See also How to do it... How it works... There's more... See also Getting ready How to do it... How it works... There's more... Getting ready How to do it... How it works... There's more... How to do it... How it works... There's more... Getting ready How to do it... How it works... There's more... Getting ready How to do it... Setting up set-driven key relationships with script Adding custom attributes and locking and hiding attributes
Setting up inverse kinematics (IK) with script 6. Making Things Move – Scripting for Animation Introduction Querying animation data Working with animation layers Copying animation from one object to another How it works... There's more... Getting ready How to do it... How it works... There's more... Getting ready How to do it... How it works... There's more... How to do it... How it works... There's more... Getting ready How to do it... How it works... There's more... Setting keyframes Getting ready How to do it... How it works... There's more... Getting ready How to do it... How it works... There's more... Creating expressions via script 7. Scripting for Rendering Introduction Creating and editing lights Getting ready How to do it... How it works... There's more... Getting ready How to do it... Creating GUI to control all lights
Creating cameras from code How it works... There's more... Getting ready How to do it... How it works... There's more... Getting ready How to do it... How it works... There's more... See also Rendering a sprite sheet 8. Working with File Input/Output Introduction Using the fileDialog2 command to navigate the file system How to do it... How it works... There's more... Reading text files Getting ready How to do it... How it works... There's more... Writing text files Getting ready How to do it... How it works... There's more... See also Writing binary data Getting ready How to do it... How it works... There's more... Reading binary data Getting ready How to do it... How it works... There's more... Getting ready How to do it... Reading multiple types of files
分享到:
收藏