Friday
Nov112011

What is a Technical Artist?

There are so many descriptions as to what a technical artist is or might be, that it is often difficult to understand, in general, what the title translates to practically and professionally. Some may describe the position as a character rigger, lighting TD, or art tools developer.

Click to read more ...

Wednesday
Aug242011

Google Python Class

If you're new to Python or just want to get your feet wet. I just stumbled on a great resource...http://goo.gl/XdSsW

Wednesday
Jun292011

PyMEL - Get the Transform of a MeshFace Fast!

Assuming you have a single mesh face component select...

import pymel.core as pm face = pm.ls(sl = True, fl =True)[0] faceTransform = face._node.root() print faceTransform
Tuesday
Mar012011

Building Blocks - Buttons that do things

It's not that long ago that I wished I could have found a few simple examples of how to write the most basic of scripts/functions that could actually do something for me in Maya. So here it is! The button()

import pymel.core as pm

def createSphere():

mySphere = pm.sphere()

return mySphere

pm.button(label = 'NewSphere', command = createSphere)

Take notice the parentheses are not included in the command parameter of the button call. The label parameter simply is the label displayed on the face of the button.

...And there you have it. A button.

Monday
Feb282011

Thoughts on Modular Rigging and Animation Tools

Earlier I demonstrated the fundamental idea of using 'modular' objects in Maya, by creating a 'ball' using an instance of a sphere, created using PyMEL in seperate class. This example was about as simple as it gets. Next, I would like to discuss the development of a modular rigging and animation tool that uses this fundamental idea to achieve some pretty amazing things.

I've been developing a modular rigging and animation tool, based on the system developed in Mastering Maya: Developing Modular Rigging Systems with Python. This training provided me with the concepts and implemetation processes, that helped me to understand how to make all of my tools 'talk' to each other, and write a code-base that is organized, well documented, and most importantly reusable and scalable.

Snapshot of prototype UI and a Single Joint Segment

Imagine being able to capture every repetitive, linear, and sometimes brain-numbing step while you rig an arm, spine, or FK/IK switch. Next, imagine using a fairly simple interface to install any rigging system on an object in a completely animation friendly and non-destructive manner.

Imagine that...

It's going to be the standard in the coming years. Systems like this have been around for some years now, but with the integration of Python, and it's high-level syntax, it has never been easier to develop tools for artists...be that animator, modeller, or technical artist.

Over the next few months, I'll share some of my experiences with you here. Please feel free to post your ideas and comments.

Friday
Jan282011

What Does Modular Mean Anyway?!


"...typically defined as a continuum describing the degree to which a system’s components may be separated and recombined." http://bit.ly/gZMWnB

Well that's nice, but how can we use it in Maya? Here's a simple example. The geometry class imports the pymel core library and defines a method that creates a sphere.

 

geometry.py

import pymel.core as pm

class geometry:

  def __init__(self):

  """ This is the constructor. """

  def createSphere(self):

  pm.sphere()

 

After creating this simple geometry class, I can now 'extend' it's methods to other derived classes as many times as I'd like. This is an extremely simple example, but still shows the value of reuse and efficiency. The pymel core library does not need to be imported into the derived because it is already available to the inherited geometry base class.

 

ball.py

import geometry as geo

class ball(geo.geometry):

""" This class extends the geometry class """

def __init__(self):

""" This is the constructor ""

def createBall(self):

self.createSphere()  #this method was made available by extending the geometry class when I create the ball class

The idea of modular classes, as they pertain to Maya, is pretty much that simple. When you start defining rigging and animation processes, combined with dynamic UI elements and external engine data, things get really interesting.

 

Monday
Nov292010

polyBlindData - What is it and why would I use it?

I had the 'opportunity' to extract multiple polyBlindData attributes and values from scene files that are bordering a decade old, with little to no documentation. Below is a quick explanation of blind data and how it used. I've also included a short clip of the code I used to retrieve the data.

 

You can use blind data to store custom data values directly to individual polygon components, or to any DAG object.

This has the advantage of allowing your geometry to carry your custom data with it when imported or referenced, without interfering with, nor overwriting, any custom data you may have already applied in your working scene.

Using blind data carries more of a burden, however. The commands to apply blind data are more complex than for simple attributes, and you'll need a custom UI for your artists to manage the application of blind data. Also, in contrast to attributes, blind data is applied partly via construction history, which means its use will potentially impact the complexity of the dependency graph for your scene. Finally, blind data queries can be painfully slow (particularly the selection and false colouring mechanism).

Warning! A unfortunate limitation of blind data arises from the fact that it is stored as attributes - either on the geometry itself, or on polyBlindData nodes connected to the object. One of Maya's scene optimizations is to not store attributes whose current value is equal to its default value. Thus, if you apply blind data using its default value, Maya will not save this data. Always define your blind data using default values that are not intended to be applied to your scene.

Quote from Bryan Ewert over at http://xyz2.net/mel/mel.100.htm

 

I used PyMEL in this example. Check out the page header to find out where you can get it.

 

 

 

def GetPolyBlindDataAttributes(self, obj = None, attr = None):

    #Set data dictionaries

    blindData = {}

    #Iterate the connection types for polyBlindData nodes

    for connection in pm.listConnections(obj):

        if connection.type() == 'polyBlindData':

            connection_attrs =  pm.listAttr(connection)

            #Iterate polyBlindData node attributes

            for attribute in connection_attrs[len(connection_attrs) - 1:]:

                #Get the typeId for each attribute

                id = connection.getAttr('typeId')

                #Get face blind data

                faces = str(obj.faces)

                #Set full attribute name

                attributeName = obj + '.' + attribute

                #Query the compound polyBlindData attributes for child attributes

                polyBlindQuery = pm.polyQueryBlindData(faces, typeId = id)

                #Iterate the attributes for integer values of 1 and return the length

                for i in polyBlindQuery:

                    #Set value of the attribute

                    if i == 1:

                        value = len(polyBlindQuery)

                    else:

                        value = pm.polyQueryBlindData(faces, typeId = id)

                #Add the attribute and value to the blindData dictionary

                blindData[attributeName] = value

    return blindData