Selected Tag: maya

6 posts

Complex space switching Tutorial

Ever came across the situation of needing a space to work one way and in the next moment exactly the opposite way? Was your conclusion a 2nd control to avoid cycles in Maya? (Scroll to short answer) Long answer Imagine the situation of having a weapon in the rig for instance – some animators might just want the hands to follow the rifle, makes sense, right? But some animations using the same rig are made for a pistol instead – it’s understandable that your animators might want to animate the right arm instead of the weapon control. You come up with a smart way of making the left hand having a right hand space and a world space to accommodate for this. Then out of nowhere the direction says that you’ll need to support a left handed weapon animation. It gets more and more complicated and it can be very […]

Best way of avoiding cycles in space switching

Hi guys, In a few days I am going to post my way of doing space switching perfectly avoiding cycles. I will show how to create spaces where you can for instance have the left hand follow the right hand and the other way around – in one rig and with logic node networks only. Check back this week for an in depth tutorial how to do that. You’ll love it and it’s not even difficult. Please follow and like:

OpenMaya Callbacks instead of Maya ScriptJobs

Whenever you want something to happen when your selection in Maya changes, the first thing that comes into your mind might be Maya ScriptJobs. However I find them very slow and not reliable, especially since they are wrapped in mel. Better use a callback from OpenMaya’s messaging system. This is how you do it: You will have to create a function that is called every time the selection changes. Make it run fast and with lots of error checking to avoid making your tool too slow. In your function, get the selection and evaluate what you want to do with it. The function could look something like this:

Don’t worry, you don’t have to use maya API but you can use pymel or even maya.cmds instead. In my example I just print the names of the selected nodes however I would avoid any prints as they are slowing down […]

Convert left handed to right handed coordinates

When working with different 3D applications you might have to convert between left handed and right handed coordinate system from time to time. The math behind this is quite simple. You have to create an inversion matrix that indicates which axis is inverted in one of the apps. In the following example we convert coordinates between Maya in Y-UP and Unity in Y-Up. Looking at the coordinate system in maya and unity you will realise that X-axis is inverted.. In Maya the x axis points in the opposite direction as in unity. This means, when the x translation is positive in Maya, it will be negative in Unity. For translations this is really simple, you can just invert thethe maya translate X channelbox value to get the correct coordinates for Unity. But as soon as rotations are in play as well it is not that simple anymore. Here is how […]

Modify File References before they are loaded

When working on multiple projects you might want to use assets from other projects. Very often a file referencing pipeline makes this difficult though as Maya stores file references with absolute paths when you are not using Maya projects. To avoid this you can hijack the Referencing procedure with a callback.

The callback triggers any function you define. In the function you have access to the file path of the reference to do some checks and you can cancel the loading of the reference or manipulate the path to your liking. Create a function somewhere in your pipeline. Your function needs 3 parameters: parameter 1 is the return code (a boolean to approve or cancel the reference load operation) parameter 2 is the file object which holds the path and file information parameter 3 is client data which you can pass in to your function from the callback

[…]