cMusclePaint.mel modification

david | animation,dj mod,mel script | Saturday, February 23rd, 2008

Anyone who has tried the new maya muscle system would have to agree that the Paint Muscle Weights tool is a big improvement on the old Paint Skin Weights tool. The colored weight display now makes a lot more sense. I think we owe Michael Comet a big thank-you.

After playing with the Paint Muscle Weights tool, I noticed that I was stumbling each time I locked or unlocked weights. My modified version of cMusclePaint.mel addresses two issues.

1. The right-mouse-button menu for weight locking is too wordy and bordering on ambiguity. Here is a snapshot.

cMusclePaintBefore.jpg

I'm sure I could learn to live with it, but there is too much unneccessary text here.

2. My preferred weight painting workflow involves locking all joints except two. I smooth between those two joints and then move on down the chain to the next two. This would involve at least two goes with that rmb-menu to lock a joint and unlock another.

So I changed a few lines in cMusclePaint.mel and now the interface looks like this.

cMusclePaintAfter.jpg

In my opinion the menu is easier to read at a glance. The new "Unlock Selected...Lock the rest" function saves me a few mouse clicks. And the new "Unlock All" function does so while retaining the joint selection in the list.

Download here.

djZooSpaceSwitchingKeys.mel

david | animation,dj mod,mel script | Wednesday, December 12th, 2007

This post will only be of interest to anybody using the zoo space switching system which is integrated into Hamish McKenzie's zooCST and packaged with the zooToolbox. I recently added a zoo space switching walkthrough to the list of articles I have been writing about the zooToolbox, so I thought I would also add a post here about an extra feature I added to zoo space switching to make animating it easier.

If you are interested, click here.... (more...)

Use Pivot As Local Space

david | animation,mel script,tutorials | Friday, September 28th, 2007

Maya 2008 introduces some new camera attributes. Here is a snapshot of the "Movement Options" in the  camera attribute editor.

cameraMovementAttributes

What this means is that if you select "Use Pivot As Local Space" then the camera will pivot around the "Tumble Pivot" instead of the "Center Of Interest" when you are tumbling around in the viewport. The default "Tumble Pivot" of 0,0,0 means you are just rotating around the camera's own local pivot, and there will be no translation of the camera.

I think this is a very useful option for positioning cameras, but I dont like the idea of having to dig down into the attribute editor everytime I want to use it, so I wrote some mel script to make it easy to toggle the option on and off. Actually I wrote two scripts; one to be used as a marking menu toggle, the other to be integrated with Hamish McKenzies zooCam.mel script.

djToggleUsePivotAsLocalSpace.mel is for use in a marking menu. Just add the command "djToggleUsePivotAsLocalSpace" and give it a name like "ToggleUsePivotAsLocalSpace". You should get something that looks like this (the rest of you menu will be up to you of course).

toggleUsePivotAsLocalSpaceMenu

When you invoke this menu in a camera viewport the script will work out which camera it is and toggle the state of the "Use Pivot As Local Space" attribute.

Download here.

djToggleUsePivotAsLocalSpaceMenu.mel is an alternative script that was written to be integrated into the zooCam menu (which works in conjunction with the zooShots camera switching system - see http://www.macaronikazoo.com/ for more info). The integrated menu looks like this.

switchToCenterOfInterest

switchToLocal

If you want to use this style of menu you need to add a call to djToggleUsePivotAsLocalSpaceMenu and provide the camera name, which is very simple in zooCam.mel. If you download my script you also get a copy of zooCam.mel which I modified, but you will need to get the rest of the zoo tools if you want to use it.

Download here.

djResetBindPose.mel + Move Skinned Joints Tool

david | animation,mel script,tutorials | Thursday, September 27th, 2007

Maya 2008 introduces a new "Move Skinned Joints Tool" in the "Edit Smooth Skin" menu.

moveSkinnedJointsToolMenu

This makes it much easier to fine-tune joint positions after skinning without the need to detach and rebind the skin. However this tool forgets about the bind pose as I will show in the next few pictures.

Here is my skeleton in its original bind pose.

originalBindPose

I then use the "Move Skinned Joints Tool" to reposition the sholder joint.

skinnedJointMoved

The problem is that if I use the "Skin|Go to Bind Pose" menu I get this.

afterGotoBindPose

The solution requires a mel command, but it needs to be executed for each joint that was moved and the name of the bind pose node must be specified. These are details you probably dont want to be thinking about so I wrote a little mel script to simplify the process.

djResetBindPose.mel allows you to just select a joint and run the script. The bind pose will be reset for every joint in the heirarchy. If you do this after the "Move Skinned Joints Tool" and before "Go to Bind Pose" then everything should work correctly.

Download here.

That Nifty Colored Ball Facial Control Rig Thingie

david | animation,mel script,tutorials | Wednesday, September 19th, 2007

The other day somebody told me about this excellent video tutorial that Keith Lango posted on his blog back in May this year. It runs for almost 30 minutes and demonstrates a rigging technique that is ideal for placing controls for facial animation on the mesh that they are deforming such that they move with the surface.

The cool thing for me was to discover that he uses my djRivet.mel script

poseDeformer for maya 2008

david | animation,mel script | Sunday, September 16th, 2007

My favourite plugin by Michael Comet has now been compiled for maya 2008. I have not tested it much but it seems to be working. If you find problems let me know.

Download here.

Bad Apple

david | animation | Saturday, June 30th, 2007

A guy I work with named Rod Clifton recently unearthed this little gem that he made a long time ago. It was never finished, but I still smile when I watch it even though I know what is going to happen.

Davvey World and modules

david | animation,mel script,tutorials | Friday, June 22nd, 2007

chainsResult.jpg

How long would it take to create an animating chain and sprocket setup like the one in this picture? Thanks to a really cool mel script by Dave Lake, you can do it in a matter of seconds. Check out the UI.

chainsUI.jpg

Three clicks and you hit "play" and it animates. There is even a little chain jiggle on the slack side. Very nice!

You can download Dave's wonderful tools from this link at highend3d.

I grabbed the whole lot which meant I ended up with over 80 mel scripts, not to mention the bitmaps. Some organization is required to keep things tidy. Time to talk about modules.

Modules are a way to package mel scripts, icons and plugin files in their own folder, which could be anywhere on your system. It avoids cluttering your usual maya scripts folder and keeps related files like icons in the same location. If you are part of a team you could have a shared module folder on the network to make updates easier.

The module folder can contain sub-folders called scripts, icons and plug-ins and maya will access them just like your normal scripts or plug-ins folder. The .mel files go in scripts, the .xpm's and .bmp's go in icons and the .mll's in plug-ins. (Actually there are no plug-ins to worry about with the Davvey tools, but if there were...)

There are two ways to tell maya about the module.

Method 1: Using the default modules definition folder

By default maya looks for a folder called modules in your maya application folder. If the folder is found maya will look in it for module definition files. These are simple text files that give the name of the module and point to the location of the folder.

For example my folder called X:\david\maya\8.5\modules contains a text file called DavveyWorld.module, which contains the following text

+ DavveyWorld 8.5 X:\david\maya\DavveyWorld

Method 2: Using the Maya.env file

You can also use Maya.env to tell maya to look in other places for module definition files. Maya looks for Maya.env in X:\david\maya\8.5 and I would need to add the following line

MAYA_MODULE_PATH = X:\david\maya\DavveyWorld;

then maya would look in X:\david\maya\DavveyWorld for a module definition file, like the one described in method 1.

If you have several different modules just add a module definition file for each one. If you use method 2, the Maya.env line needs to specify each folder in a semi-colon seperated list like in the following example

MAYA_MODULE_PATH = X:\david\maya\DavveyWorld;K:\andrew\omtoolbox;P:\rex\tinytools1.3

NOTE: The name of the module definition files is unimportant. Maya simply reads the all the files in the folder you specify looking for a line starting with "+". This means you should not mix module definition files with other kinds of files. For example if your text editor creates backups you should delete those before starting maya.

Which method you choose is upto you. Method 1 probably suits a single user working alone. I can look into X:\david\maya\8.5\modules and see immediately what modules are installed. I can make changes to a local copy of the module without upsetting anyone else. On the other hand, method 2 may be better suited to a group of users where setting up shared module folders ensures everyone is using the same version. Each user just needs a copy of Maya.env.

a little help from the keymaster

david | animation,mel script,tutorials | Tuesday, June 19th, 2007

Hamish McKenzie's zoo toolbox has some very useful animation tools. Here are some I have used in the last couple of days with a few modifications.

zooKeymasterUI.jpg

zooKeymaster.mel invokes the UI shown above. You use it to nudge keyframes forwards and backwards and to scale animation curve values relative to a selection of pivot points. What is really cool is the "curve pivot" mode. For example you can specify the pivot to be "max" and activate "curve pivot". When you "push up" or "push down" the curves are each scaled relative to their own maximum value.

The absolute flag plays an important roll in how the scaling works. Setting the "absolute" flag means the keyframe value is always decreased when pushing down and increased when pushing up. If "absolute" is NOT set, then "push down" means scale the keys to be closer to the value of the pivot. This can be a little confusing until you see it in the graph editor, but essentially it means that a keyframe whose value is less than that of the pivot will increase in value (moving it closer to the pivot value) if you "push down".

I discovered that the "absolute" flag was ignored when the "curve pivot" flag was set, so I made a small modification to the code to fix that. You can download it at the end of this post.

zooTangentWksMenu.jpg

zooTangentWorks is a marking menu that can be created from the zooToolboxUI. To take full advantage of this wonderful menu you need to use weighted tangents with unlocked weights. You can then use it to sharpen/unsharpen or tighten/untighten tangents in increments, which is much less trouble that manipulating the tangent handles directly. But the best function of all is "make sensible tangents".

"make sensible tangents" pulls your animation curves into shape by minimising the exagerated over-shoot that often results from spline tangents, but it avoids the jerky feel of using linear tangents. You specify a "sensible factor" so the curve reshaping is incremental. I have the marking menu assigned to a key, but "make sensible tangents" is the default action for tapping the key once. So as I animate I can quickly tap it a few times to iron out those kinks.

zooSetKeyMenu.jpg

zooSetKey.mel & zooKeyCommands.mel Together this pair of scripts make the marking menu shown above. This menu provides some really powerful animation tools.

For example sometimes I animate something and think in hindsight that I would actually like the pose at one keyframe to be a bit closer to the look of the previous keyframe. So I step back a few frames in the timeslider and use "copycat value towards next" to copy this inbetween pose to the next keyframe.

A more complicated example involves the concept of "space switching" or "dynamic parenting". Rigs built with zooCST have space switching capability on most of their control objects. You can animate the parenting of the control objects and their transforms are automatically recalculated to maintain orientation under the new parent. The "setParent" functions in this marking menu allow you to take an existing animation that has animated parenting and to reparent the control objects. The values of all the keyframes are recalculated to work under the new parent. This is heavy duty stuff, but once you get the hang of it its quite easy to use.

The features highlighted in yellow in the image are my additions.

Download my modified version of these zoo mel scripts.

In the code I have commented any changes that I made with the "DJ MOD" flag. To use these scripts you will need to also download the rest of the zooToolbox from Hamish McKenzie .

Thanks for your generosity Hamish.

djBuildPoleVector.mel

david | animation,mel script,opinions | Monday, June 18th, 2007

djBuildPoleVector.jpg

When I'm rigging a character in maya I generally use some kind of auto rigging system. My current preference is Hamish McKenzie's zoo toolbox (zooCST). This means that things pole vector constraints are created for me. Recently I was helping Jeremy rig something where the auto rigger just didnt seem appropriate. When we got to adding the pole vector constraints, Jeremy asked why we couldn't just put the control objects where we wanted them. He was getting frustrated because the joints would rotate when he added the constraint.

With zooCST I knew how to put a control object at the exact location that would not cause this rotation, but my collegue insisted that we should be able to just place the control object where we wanted, click a button and let maya figure out how to keep the joints in place.

After some searching I found a little mel script on highend3d called nilsNoFlipIK.mel (written by Nils Lerin). It lets you specify a vector and an ik handle and it calculates the twist value required to keep the joints from rotating. Since the ikHandle.twist can be calculated for a given vector, I just needed to figure out how to calculate that vector from the location of the control object.

The result is djBuildPoleVector.mel.

Download djBuildPoleVector.mel and nilsNoFlipIK.mel (both are required). Put them both in your scripts folder.

Select a control object and an ik handle and type djBuildPoleVector

A pole vector constraint is created, the ikHandle.twist attribute is set and there is no joint rotation.

« Previous Page | Next Page »

Powered by WordPress | Based on a theme by Roy Tanck