How can I query the active 'character'?
It's easy enough to just query that part of the UI:string $char = `textField -q -text characterField`;
View ArticleHow can I draw a simple message to the screen? headsUpMessage
You can use the headsUpMessage command to do this. It will disappear on the next screen refresh (by default). It has arguments to have it display for a fixed amount of time, or be centered on a...
View ArticleHow can I directly constrain a point on a NURBS curve?
pointCurveConstraintThis command will constraint a point on a curve to something else. It does not constrain things to a curve.It implements this via a leastSquaresModifier node.
View ArticleWhat node can return a curve's length?
curveInfo# Python code import maya.cmds as mc lenCalc = mc.createNode("curveInfo") mc.connectAttr("myCurveShape.worldSpace[0]", lenCalc+".inputCurve") You can then query, or connect to the curveInfo...
View ArticleWhy does my motionPath have a different length than reported by my curve?
A motionPath node can report a different length than other curve querying nodes like nearestPointOnCurve and curveInfo: They will return it's parameter length in cm, while the motionPath reports the...
View ArticleRigging Demos
I run across cool rigging demos from time to time, figured I should start saving some links to them:Jeremy Ernst -- Gears of War 3 Rigging Reel - videoFast and Efficient Facial Rigging(in Gears of War...
View ArticleQt versions & downloads
Starting in 2011, Maya's entire ui back-end was converted to Qt. You still use the same Maya commands to author UI's, but behind the scenes Qt is appearing on your screen. This is not to be confused...
View ArticleHow can I check if an objects attributes are connected?
connectionInfo only requires a single object.attr. listConnections also works, but this is a bit more simple:// Is the object.attr a source of a connection? connectoinInfo -isSource object.tx; // Is...
View ArticleHow can I disconnect an attribute?
disconnectAttrSome examples:mel:// Disconnect only keyable attrs. string $obj = "null1"; string $keyable[] = `listAttr -k $obj`; for($i=0;$i<size($keyable);$i++) { string $incoming[] =...
View ArticleWhy does my joint chain change shape when IK is applied?
I've seen if there is a 'preferred angle' set on an intermediate joint, that when an IK handle is created on the chain the chain can change shape. Zero out the preferred angle, rebuild.
View ArticleRotate joint chain to touch a ground plane
I wanted to create an angled suspension system. Imagine a right-triangle in the shape of an L, with a cross member connecting the top to bottom corner ('H' in the below diagram): The top of the...
View ArticleHow can I make a window dockable?
Starting with the introduction of Qt in Maya 2012, you can make your own custom windows dockable in the Maya UI.The below examples will take a window (who's name is defined by the myAwesomeWindow...
View ArticleHow can I execute code when a window is deleted?
Often times I want to call a function when I close/delete a window. Unfortunately there is no 'delete detection' for this via the window command and no way via the window command to assign callbacks....
View ArticleHow can I add a 'folder bookmark' in the fileDialog2 window?
Maya 2011(?) introduced the fileDialog2 command that supplants the fileBrowserDialog. It has a option on the left for 'folder bookmarks', and for the longest time I couldn't figure out how to update...
View ArticleWhat causes the Attribute Editor to refresh when something is selected?
There is a scriptJob (in my case, it's scriptJob 1) that executes this code:scriptJob -protected -parent AEmenuBarLayout -event SelectionChanged autoUpdateAttrEd; autoUpdateAttrEd is a global proc...
View ArticleAPI: How can I author callbacks for Maya events?
The most common way to do this is via mel scriptJobs. But via the OpenMaya API, you can access many 'Message' classes that provide a lot more functionality to areas that scriptJob's don't provide.It...
View ArticleAPI: MObject and MDagPath
If you're doing any work via the API, you need to know about these two objects. This is my own personal description:MObject is a Lego-brick. MDagPath tells you about where that brick lives in the model...
View ArticleHow can I query if an attribute exists?
You can actually use the objExists command, like:int $txAttrExists= `objExists persp.tx`; // Result: 1 // Which is easier than the syntax for attributeQuery, and I'm told that it actually evaluates...
View ArticleWhy are various Smooth Skin tools broken in 2012?
Update: This appears to be local to my machine. While I've not modified any of Maya's default scripts in this area, other people are not reporting the problem. I guess I'm just... lucky........
View ArticleWhy does Maya freeze when a file open dialog appears?
In Maya 2012, I've seen an instance that when you do File->Open, File->Import etc (or a custom use-created dialog), Maya will lock up\freeze.As it turns out, the file dialog is appearing behind...
View Article