• Blog
  • Work
  • Resources
    • Rigs
  • Resume
  • Contact
I do technical things...

Getting COM (win32com) working in Maya 2012

02/29/2012

0 Comments

 
I'm starting to look into Communicating between applications from Maya. So If you’re looking to install the COM python module for Maya, here's how I got it working.

Get the appropriate installer here
    For Maya 2012 64 bit get the pywin32-217.win-amd64-py2.6.exe
    For Maya 2012 32 bit get the pywin32-217.win32-py2.6.exe
Run the downloaded executable, it should install to your C:\Python26\Lib\site-packages.
Copy the contents of that folder to your C:\Program Files\Autodesk\Maya2012\Python\lib\site-packages.

That should do it!

Of course be aware of what other packages you had installed previously in both site package folders, if you're concerned about overwriting something.
Add Comment
 

Sometimes I feel stupid.

02/21/2012

2 Comments

 
..Maybe because I am.
    ls -type "joint" "|*" ;
Sometimes we just need to get something working, and we write functions to get simple pieces of data or whatever. Well I was at my desk recently and the above piece of code just dawned on me. The amount of times I've written code to get all joints at the root of the scene, looping parent queries.... Sometimes I feel stupid.

2 Comments
 

Custom Maya halt window.

02/21/2012

0 Comments

 
If you want to display a custom ui and halt all other maya ui interaction whilst it's open, here’s a script.

This uses Maya’s new-ish layoutDialog ui element, and it basically lists things and returns the user's specification. Nothing special, but it is nice that it basically acts like a confirmDialog.. The code is a bit hacked together as I originally thought I could get a textScrollList, in python, to simply accept data with some *args or **kargs callback functions, but no joy there. So I had to wrap this up in a class and use some class attributes to store and access the needed data on events.

Anyway here's the script. This may not be the cleanest way to do this, but I had to get it working. Hope someone finds it useful.

selectitemdialogui.py
File Size: 3 kb
File Type: py
Download File

Add Comment
 

Pose space deformer - Vector Angle node, whatever it's called.

02/20/2012

0 Comments

 
I wrote another custom node, again beholden somewhat to this post, that basically calculates the angle between to vectors.

It takes in two world space matrices and compares specified axis (x,y or z) of the nodes. It returns a ranged, 0-1, value based on user set bounds (actually the node outputs a ranged angle, full angle and dot product). Its really pretty simple but should come in handy.

I have tried to make this setup before, using Maya utility nodes and some elbow grease, but It was always quite cumbersome and I was a bit off with the math, So I thought an api node would be a better bet. So I created a nice self contained node that does it all for you and gave the user a nice display.

Here it is in action. I piped the output into the scale of the cube for visual cue of the output. 
I think i can take this a bit further, I'm thinking of trying to make this calculate a u-v space bounds of a sphere, so i can cut a more complex piece of a sphere to calculate if the vector is inside. We'll see how far i get with that!
Add Comment
 

Draw on top Maya control node

02/20/2012

2 Comments

 
I wrote a custom locator node for use in my rigs a while back, thought I'd show it off.

As many other have, I'm sure, I read through this post and started playing about with the methods outlined.  It's a great tutorial for anyone looking to get into the python api, so check it out now! Yes, stop reading this and go there if you haven't already,

I took it a little further and wrote a node that could be used as an all purpose controller for rig setups. One of the main pluses of this node is that it can be set to 'draw on top', which is very nice for making aesthetically easy to understand rigs. Credit needs to go to Christopher Lewis also for help on the openGL depth methods for that.

I also wrote in the ability to change the draw shape, rescale the drawn shape, edit transparency and other settings.

I've been using it for a while now and its working great!

2 Comments
 

    Andy T.

    I do Tech things for Artist.

    Archives

    July 2014
    February 2014
    January 2014
    April 2013
    August 2012
    March 2012
    February 2012
    December 2011
    July 2010

    Categories

    All
    3ds Max C#
    3ds Max .net Api
    Animation
    Api
    Face Rig
    Maxscript
    Maya
    Mel
    Python
    Python Api
    Rigging
    Scripting
    Ui
    Work

    Links To Cool Folks

    Mic Marvin
    Alex Utting
    Rick Vicens
    Gary Talbot
    Richie Prado
    Felipe Nogueira

    RSS Feed