Category Archives: Animation

Maya – Use Type node to set the frame number to scene geometry

Maya – Use Type node to set the frame number to scene geometry

Sometimes it’s useful to have a geometry displaying a changing number.  As an example of how to do this, I’m showing how to set the frame number into some geometry using the Maya type node.  You can use a similar system to drive values from an anim curve into the type node, as well.  (Just adjust the python script to call getAttr on your curve instead of querying the current frame.)

The Maya ‘type’ node’s textInput field is a strange beast. To operate correctly, it needs its input to be each individual character encoded as its hex value, but all passed as a space-delimited string.  This script handles the necessary tap dance.

So in order for the Maya type node to write “testString”, a type node’s .textInput attribute needs to be set to the string: “74 65 73 74 53 74 72 69 6e 67” .

frameToType.py.zip

We use the python built-in codecs module to encode each character of our input string into the hexidecimal value that the type node wants as input.

codecs.encode(str(d), 'hex_codec')

We dump these value into an array, then join them to create the space-delimited string:

hexFrameString = " ".join(hexFrameCodes)

Then set that value into the attribute:

mc.setAttr(typeObj+".textInput",hexFrameString,type="string")

 

Archery Demonstrator

Archery Demonstrator

It’s closing on a year since I uploaded my last project.  This one is a rare project that combines all three of the themes of this site. Several of my projects have used Processing.  It’s a quick and fun way to prototype projects, and it can grow to be pretty powerful before needing to moveContinue ReadingContinue Reading

Rubik’s Cube Rig for Maya

Rubik’s Cube Rig for Maya

Here is my latest rig for animating a Rubik’s Cube in Maya.  I’ve mentioned it over here before.  This rig is a zip file of the three MEL scripts and the two example scene files.  Hopefully soon I can write up a good tutorial on using it. Cube Rig Pack v1.0Continue Reading

Coming Soon – Rubik’s Cube Rig for Maya

Coming Soon – Rubik’s Cube Rig for Maya

UPDATE: I posted the rig over here! One of the best animation rigs I have in my toolbox is a really good rig for animating the Rubik’s Cube.  For various math reasons, it’s a very tough object to animate. This rig is easy to animate with, thought, and has a rudimentary UI that makes usingContinue ReadingContinue Reading

Inversion Geometry – Sphere Particles

Inversion Geometry – Sphere Particles

I converted my Inversion Geometry Sphere scripts to use nParticles instead of polygon geometry. This saves a ton of memory usage, but the trade off is some trickiness with rendering.Continue Reading