GithubHelp home page GithubHelp logo

dgovil / pythonformayasamples Goto Github PK

View Code? Open in Web Editor NEW
256.0 41.0 73.0 84 KB

Code samples for people who take part in my Python for Maya course

License: GNU General Public License v3.0

Python 100.00%

pythonformayasamples's Introduction

Python For Maya: Artist Friendly Programming

Table of Contents

Course Outline

Code samples for people who take part in my Python for Maya course

The course is available here

Python For Maya: Artist Friendly Programming


This course will teach Python for Maya using an artist friendly approach, by breaking down concepts into small digestible pieces and giving projects with real world use.

About Me

You can also find more information about me on my website

http://www.dgovil.com

Projects We'll Be Completing

During the course, we'll create a few different projects to both showcase how Python is useful in a real world context,and to learn new concepts

  • Create and prop geometry with a simple rig (LINK)
  • Rename and organize a scene (LINK)
  • Automatically create Gears for modelling with a configurable amount of teeth (LINK)
  • An Animation Tweener with a simple UI (LINK)
  • A Library tool for Rigging Controls with a UI (LINK)
  • A Light Manager (LINK)
  • A command line file tool to manage image sequences (LINK)

Tools That Will Be Used

For the course we will use the following

  • Maya 2017

    This is currently the latest version of Maya and has some major changes that will be covered. Feel free to use an older version of Maya (as low as 2011), as I will cover the differences and give you the knowledge to adapt

    You can download an education version of Maya 2017 here: http://www.autodesk.com/education/free-software/maya You can download a Maya 2017 trial here: http://www.autodesk.com/products/maya/free-trial

  • Python 2.7

    Obviously, this course will use Python, but it is important to note we will be using Python 2.7 and not Python 3.x

    If you do not already have Python installed, I recommend downloading Anaconda instead. It is a packaged version of Python that comes with a lot of great libraries prebuilt for you, and is much easier to get started with than the official Python. Please remember to download the Python 2.7 version

    https://www.continuum.io/downloads

    Maya 2017 uses Python 2.7 and this is also the agreed upon standard by the VFX Reference Platform www.vfxplatform.com Maya 2014-2016 also use Python 2.7, whereas Maya 2011-2013 use Python 2.6.

    The latest version of Python is Python 3.5, however Python 3.x has introduced many breaking changes to Python. These changes are for the better but due to large investment into Python 2 code, Maya will continue to be on Python 2 for a while longer.

  • PyCharm

    PyCharm is a very well established IDE with a lot of useful features for a beginner to both learn with and grown into a full fledged developer. It is my editor of choice today.

    I would recommend downloading PyCharm Edu from here: https://www.jetbrains.com/pycharm-edu/

    PyCharm Edu is a version of PyCharm with a simplified interface (optional) and coursework that will help a user learn Python in their spare time.

  • Maya DevKit

    Unfortunately from Maya 2016 onwards, Autodesk stopped shipping the Maya developer kit with Maya. This isn't super necessary for our course, but it does provide some nice autocomplete features in our editors.

    If you're on Maya 2016 download the zip file from here: https://github.com/autodesk-adn/Maya-devkit

    If you're on Maya 2017 or higher download it from here: https://www.autodesk.com/developer-network/platform-technologies/maya

    Instructions on how to set up your directories for your specific OS are here: http://help.autodesk.com/view/MAYAUL/2017/ENU//?guid=__files_Setting_up_your_build_environment_htm

  • Qt.py

    For the Qt portion of our course, there are several Qt libraries we can use. If you're using Maya 2017 or above, you can use PySide2 or PyQt5. If you're using Maya 2016 or below, you can use PySide or PyQt4.

    Rather than having to develop for all these options, we can use a library that can make use of whichever one it finds. This library is called Qt.py and you can download it here: https://github.com/mottosso/Qt.py

  • Other Editors

    There are a lot of other editors, and I will personally not be using them for this course. However, if you have a preference for other editors, I will go over setting up some of the editors with Maya. The following editors will be covered

    • Sublime Text
    • Atom
    • Visual Studio Code
    • Eclipse
  • Operating System My preferred operating system is Windows and it will be what I will be using for the entire course. That said, I also use macOS and Linux and where anything should be treated differently, I will make mention of it.

Libraries That Will Be Covered

The course will cover the following libraries

  • maya.cmds
  • pymel
  • Qt
  • PySide / PySide2

Other Resources

Books

Just a note that these links are affiliate links that will go to your local Amazon storefront.

This is for MEL and C++ obviously, and quite an old book, but it's one that is still incredibly useful if you're interested in those languages, and one that many developers have learned from.

Websites and Blogs

Rigging Dojo is the online school for rigging and technical skills. They have a ton of great mentored courses on Python, C++, Rigging etc..

A quick introduction to using PyQt4 and PyQt5. If you're using PySide, just replace the library name. This is where I learned to use PyQt4 from when I was teaching myself Python, and it's the first place I point people to when they want to learn.

  • CodeHeadWords

    This is a blog run by John Hood who is a coworker of mine who's taught me a ton.

pythonformayasamples's People

Contributors

dgovil avatar ferbycremer avatar megaes avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pythonformayasamples's Issues

OpenMaya in Jupiter Notebook

In - Jupiter Notebook - I set the path to:
sys.path.append ("C:\Program Files\Autodesk\Maya2022\Python37\Lib\site-packages")

run this:
import maya.OpenMaya as om
worldOrigin = om.MVector(0,0,0)

but error came:

AttributeError: module 'maya.OpenMaya' has no attribute 'MVector'

What I am doing wrong?

lightingManager.py not loading .json correctly

Received the following error when loading the .json file in Maya2019 (Product version: 2019.0.0.F) from C:/Users/<user>/Documents/maya/lightManager\lightFile_0916.json

# Traceback (most recent call last):
#   File "C:/Users/oleu/Documents/maya/2019/scripts\lightingManager.py", line 178, in importLights
#     self.setButtonColor()
# AttributeError: 'NoneType' object has no attribute 'intensity'

.json extendson changed to .txt
lightFile_0916.txt

I coded along with the videos and had no errors up until video "69. Importing Our Lights".
Went back and checked my code against yours. Still didn't work. I loaded your example file and the same error was returned.
Not sure if its something that's changed in Maya 2019 or Python/ PyMel/ Qt/ etc. syntax, or if it's a system specific/ user error (probably the later).
Thanks!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.