Maya

Quaternion Rotation Output from RBF Solvers
Feb 21, 2020 Maya Rigging Python C++ Maya API RBF Quaternions
In my previous post, I described how driving an RBF solver with quaternion values for rotational inputs is more reliable than driving with euler inputs. In this post, I will describe a method to output rotational values from an RBF solver. As described in my last post, euler rotations suffer from gimbal lock and multiple solutions to the same rotation. If we were to solve directly to these euler angles, we would see a lot of undesirable flipping depending on the sample inputs.

Quaternion Rotation Input to RBF Solvers
Feb 3, 2020 Maya Rigging Python C++ Maya API RBF Quaternions
In my previous post, I described how to create an RBF solver using regularized linear regression. While the solver works well for most independent input values, it does not work so well if we want to drive it with euler rotations. Euler rotations are susceptible to gimbal lock and can have multiple solutions for the same rotation. These two joints look like they have the same rotation. But looking at their animation curves tells a different story:

Regularized Linear Regression with Radial Basis Functions
Feb 2, 2020 Maya Rigging Python C++ Maya API RBF
RBF solvers are systems used to interpolate from values in one space to another set of values in another space. Basically a set driven key with arbitrary inputs and arbitrary outputs. This has many applications such as driving corrective shapes, retargeting meshes, or training systems in machine learning to predict values based on a set of known samples. There are several demo implementations and explanations of RBF solvers scattered around the internet:

Swing Twist Decomposition to Offset Parent Matrix
Jan 25, 2020 Maya Rigging Python C++ Maya API Maya
Decomposing a rotation into separate swing and twist components has many useful applications. Maya's pose interpolator toolset allows shapes to be driven with isolated twist and/or swing components of rotations. This allows a corrective shape in the pectorals driven by the raising of the arm to be independent from the twist motion of the arm. Also, the twist component can be used to drive twist joints more reliably than the euler twist axis by itself, as demonstrated in the video below.

Swing Twist Decomposition to Offset Parent Matrix
Jan 25, 2020 Maya Rigging Python C++ Maya API Maya
Decomposing a rotation into separate swing and twist components has many useful applications. Maya's pose interpolator toolset allows shapes to be driven with isolated twist and/or swing components of rotations. This allows a corrective shape in the pectorals driven by the raising of the arm to be independent from the twist motion of the arm. Also, the twist component can be used to drive twist joints more reliably than the euler twist axis by itself, as demonstrated in the video below.

Trig Functions in Maya without Third-Party Plug-ins
Jan 7, 2020 Maya Rigging Python
By default Maya does not ship with any nodes to calculate trig functions. If you want to use a plug-in, you can use the great plug-in Maya Math Nodes written by Serguei Kalentchouk. If you want or have to use default Maya, there is still hope. I recently added trig function support to dge, my library that converts string math equations to Maya node networks. Using math and trig knowledge, we can recreate these functions with the nodes that come with Maya.

Space Switch Using Offset Parent Matrix
Jan 1, 2020 Maya Rigging
Maya 2020 introduced the offsetParentMatrix attributes to transform nodes. This attribute allows transforms to be driven directly with a matrix and can cut down the number of nodes and connections in your set ups. In this post I'll show how to set up space switching using the offsetParentMatrix attribute instead of constraints and extra transform nodes. A parent-child relationship is a simple matrix multiplication and can be replicated with a multMatrix node:

Python Scripting for Maya Artists 2.0
Feb 28, 2016 Maya python
I've updated my semi-popular pages on Python Scripting for Maya Artists. The material was originally written in 2009 and the pdf has been downloaded over 18,000 time so it was all due for an update. Updates include: Various cleanup on examples and explanations. New material on string formatting. New material on directory traversal. New material on docstring formats. New section on code conventions and PEP8. New section on writing clean code.

Unit Testing in Maya (Part 2)
Feb 20, 2016 cmt Maya python unit testing
Edited: 6/18/2016: Updated RollbackImporter to support relative imports and “from package import module” syntax. In my last post, I went over writing scripts that can be used to write unit tests for Maya tools and then run those tests from the commandline outside of Maya. In this post, I'll go over running those tests interactively in Maya. Being able to run tests interactively in Maya will greatly speed up debug times when tracking down issues because you'll be able to see what is going on in your tests.

Unit Testing in Maya
Feb 15, 2016 cmt Maya python unit testing
Unit testing is a valuable tool that a lot of studios fail to implement. Unit testing can save a great amount of time and energy (and therefore money) by allowing developers, tool writers, and even content creators to catch broken deliverables before passing them downstream in the pipeline. The lack of unit testing with TD's is most likely due to one of the following: The person doesn't know what unit testing is.

Coming Soon: Creating a GPU-Driven Wrap Deformer in Maya 2016
Jun 23, 2015 API CGCircuit Maya
My next video series is in progress. You can check out the introduction video here and download the open source code on my GitHub.

Compiling Maya Plug-ins with CMake
Jan 19, 2015 CMake Maya Maya
New year, new site design! I've posted some free videos talking about how to compile Maya plug-ins on all platforms using CMake. Check them out here:

Compiling Maya Plug-ins with CMake
Jan 19, 2015 CMake Maya Maya
New year, new site design! I've posted some free videos talking about how to compile Maya plug-ins on all platforms using CMake. Check them out here:

Writing a Production-Ready Skin Exporter with the Python API
Sep 9, 2013 CGCircuit Maya
I released a new tutorial series over at CGCircuit called Writing a Production-Ready Skin Exporter with the Python API. In the videos I go over how to create a more robust skin weight exporter that also handles joint renaming. Head on over and check it out.

Creating a Custom Jiggle Deformer
Jul 15, 2012 API CG CGCircuit Maya
I have created another video series over at CGCircuit.com. This one is titled Creating a Custom Jiggle Deformer and goes over the creation of a custom jiggle deformer that you can use in your projects. Check it out here. And here is the intro video:

CGCircuit Open to the Public
May 27, 2012 API CGCircuit Maya
CGCircuit.com is now open to the public. My Maya API video series and Applied 3d Math series are now available for purchase without the need for an invitation. Check them out if you haven't already.

CGCircuit.com
May 5, 2012 CGCircuit Maya Personal
The site creators of CGCircuit.com are ready to let more people in and buy my videos! The videos are finally ready to be sold. However, you still need an invite to register on the site and buy the videos. I have a new set of invites to give away so use my contact form to send me your email if you want in and I'll send you an invite. The Maya API class is still discounted at $80 until a month after the full public release.

Maya API and Applied 3d Math Videos
Mar 6, 2012 CGCircuit Maya
My Maya API videos will soon be released. I've gotten word that they will be open to the public very shortly. The Maya API series is about 6 hours worth of video covering several topics from creating commands, contexts, locators, deformers, file translators, and dependency graph nodes to working with callbacks, multi-threading, attribute editor templates, and distributing your plug-ins. I've also created an Applied 3d Math video series. This series is a little over an hour and covers how to actually use 3d math with practical examples.

Reflection Locator
Sep 25, 2011 API CGCircuit Maya
Here is another sample from my upcoming Maya API video series. In the video I discuss custom locators and go through how to implement them. The video series should be available around January 2012.

Draw Curve Context
Sep 19, 2011 API CGCircuit Maya
This is a demo of a Maya context that I developed as part of my upcoming Maya API instructional video series. It draws curves from a mesh. It could be used to draw hair curves or something along those lines. The video series should be available around January 2012.

Maya Move Brush
Jun 14, 2011 API Maya Plug-ins
For some reason, the Maya artisan tool does not have a move brush so I wrote my own.

Free cvShapeInverter Tool
Mar 2, 2011 Maya Plug-ins
I put up a free shape inversion tool available here. cvShapeInverter is a script and deformer that can invert a shape through a deformation chain so the shape can be applied as a front of chain shape. This has the same functionality as Christian Breitling's correctiveShape plug-in. He stopped providing it after Maya 2008 so I'm providing a Python version that doesn't need to be compiled.

Updated Sticky Lips Deformer
Sep 13, 2010 Maya Plug-ins
This is an update of my sticky lips deformer. In an attempt to make the deformer more automated, I've implemented a mode where the vertices stick on contact and then fade off with time. The original mode is based solely on distance and so would stick together even if the mouth was on its way to being closed. The frame stuttering is from the Camtasia settings. The deformer runs in real-time.

UV Blendshape Deformer
Aug 11, 2010 Maya Plug-ins
A deformer that blends one mesh to another based off of UVs. Mesh topology can differ and you can optionally maintain the initial offset between the two meshes. Uses include transferring existing work onto another mesh. The demo shows transferring shape work from one face to another. The faces have different vertex counts and topologies but share the same UV layout.

Vertex Snap Deformer
Aug 10, 2010 Maya Plug-ins
A deformer that can drive subsets of a mesh with other meshes. Uses include driving a body with a blendshaped head or driving larger meshes with a heavily rigged subset of the mesh. This can increase performance as the heavy rigging isn't affecting the larger mesh.

Motion Blur Deformer
Aug 10, 2010 Maya Plug-ins
A deformer that simulates motion blur geometrically. The amount and falloff of the “blur” can be adjusted with keyable attributes.

Sticky Lips Deformer
Aug 9, 2010 Maya Plug-ins
This shows a deformer that attracts vertices to a nurbs curve using a distance-based falloff. It can be used to create sticking effects like sticky lips. Various attributes can be adjusted and animated such as falloff, distance threshold, magnitude, etc.

Spherical Radial Basis Function Driven Corrective Shapes
Jul 6, 2010 Maya Plug-ins
This shows an implementation of a Spherical Radial Basis Function node. SRBF is commonly used in lighting calculations like this http://www.cse.cuhk.edu.hk/~ttwong/papers/srbf/srbf.html. I am using SRBF here to track joint position and orientation. This gives me a weight value per target that I can then use to drive corrective shapes. Each target point has its own falloff and twist attributes to adjust the triggering sensitivity. The rig is my free quadruped rig, Nico, which you can download here:https://www.

Maya Technology Demos
Jul 2, 2010 deformer dynamic jiggle Maya Maya API Plug-ins plug-ins wrap
More technology demos! First is a dynamic transform node. The node is applied to various joints and IK handles. The node can also drive arbitrary attributes so they behave dynamically as well. Next is a custom jiggle deformer. The reasons why I created my own jiggle deformer as opposed to using Maya's jiggle deformer is because of speed and ease of use. Mine runs a lot faster and is easier to use.

GPU Blendshape Performance Comparison
May 15, 2010 Maya Plug-ins
This is a performance comparison between Maya's blendshape deformer and my GPU-based blendshape deformer with 1000 targets on a 30,000 vertex mesh. The test is using an Nvidia Geforce 230M video card.

Skin Sliding Deformer
May 14, 2010 Maya Plug-ins
This video shows a skin sliding deformer I wrote for Maya. It's paintable, multi-threaded, and fast!

Maya API Notes
Apr 25, 2010 API Maya
I started putting up pages about the Maya API with C++ and Python. I'll be adding to it more in the future. Check it out here.

GPU Blend Shapes
Apr 1, 2010 Maya Plug-ins
I wrote this last week. It's a Maya blend shape deformer that runs on the GPU. The sample shown is a 30,000 vertex mesh with 1000 targets. It runs 32x faster than Maya's blendShape node on a Geforce 230M notebook GPU. A 40,000 vertex mesh with 1500 targets ran 40x faster.

Python Workshop Notes
Jun 21, 2009 Maya
A few months ago, I taught a Python scripting workshop at my old school, Expression College, aimed at introducing students to the Python scripting language and using it in Maya. It was a one day workshop so everything was condensed and to the point. There's no history of Python section or best practices section. The goal of the workshop was to get students familiar with Python so they could learn how to read and write basic scripts and also how to further their studies.