djSetKeyframe.mel and “straight ahead” animation

david | animation,mel script | Tuesday, April 22nd, 2008

I usually animate in a straight ahead manner, where I create a pose... keyframe... move forward on the timeline... create the next pose and so on. Since there are no keys ahead of where I am working, the last pose is held when I move forward. I find it easy to do a first pass this way.

But the first pass is rarely final and when changing some animation in the middle of a sequence it is often easier to delete a block of keyframes rather than mess with the existing ones. But now the keyframes that come after the deleted section mean those poses are no longer held when I move forward in time.

djSetKeyframe.mel was written to enable a more "straight ahead" approach when making changes to these middle bits.

Say for example, I delete all the keyframes between frame 100 and 200 so I can redo that section. I would then start by setting a new keyframe at frame 199. Then I goto to the last keyframe before frame 100 and run djSetKeyframe 1 0; which copies that keyframe to frame 199 and sets the inbetween tangents to linear. This creates a "hold" until frame 199.

Now I can work forward as I did in my first pass. Each new keyframe I set using djSetKeyframe 1 0; to simultaneously update the hold frame at 199. Of course, at some point the new animation needs to blend back into the old, so then I just delete the keyframe at 199.

The numbers you see after the command in the above examples, change its behaviour. The first is the "push" flag; set to 0 behaves just like the channel box rmb-menu Key Selected. Set to 1 and it will also copy the new keyframe forward.

The second number is the "unlock tangent weights" flag. (I wish I knew how to make unlocked weighted tangents the default in maya) Set this 2nd number to 0 and you get the usual locked tangent weights, but set it to 1 and the weights will be unlocked as you create new keyframes.

djSetKeyframe.mel was written to be mapped to hot-keys (or marking menus if you prefer). I have djSetKeyframe 0 1; mapped to [s] and djSetKeyframe 1 1; mapped to [S].

NOTES and CREDITS: This script requires the installation of Hamish McKenzies zooToolbox. I have used a proc called zooSetkeyPush which is just one of many useful functions that are part of the marking menu built by zooSetKey.mel.

Download djSetKeyframe.rar from here. (see file header for full usage details)

An afterthought: As I re-read this tonight, I realize that I will probably be asked "Why dont you just use "step" tangents instead ?". The simple answer is... um... that's not the way I prefer to work. I like to be able to scrub through my animation as I am creating it so I can judge the momentum and flow of my action. I know this is a departure from the widely used workflow of blocking out the action using only poses and step tangents on the first pass. (And I was reminded of this recently while reading Cameron Fielding's blog where he links to a nice document by Mike Walling) Getting those key poses down is essential, I agree. I'm impatient though. I want to see it move too. This is what I have become used to.

default manipulators and zooTriggered

david | animation,mel script,tutorials | Wednesday, April 16th, 2008

Yesterday I learned something new. Stev Kalinowski posted this on CGTalk

In the attribute editor, under the Display rollout you set the "Show Manip Default" drop down list to Translate or Rotate for each control. Then to select objects hit "t" (Show Manipulators) instead of the move or rotate tool. Now when you select objects you'll get the manipulator you set for each control.

I tested it out using two objects called "translateMe" and "rotateMe" and I set the Show Manip Default attribute as shown here



Now, as long as I am in Show Manipulators mode (invoked with the "t" hotkey by default) then the manipulator handle will change based on my selection.

This is quite handy when animating, but it depends on being in the Show Manipulators mode, which I would not be as comfortable with alot of the time, since I frequently need to also use the translate, rotate and scale modes.

Well, there is another way to do the same thing using Hamish McKenzie's zooTriggered scripts.

I have written about using zooTriggered here, but if you read that quick walk-through, you might think it's use is restricted to selecting a control object to trigger the selection of another object(s). In fact zooTriggered can trigger almost any mel command(s) which means it can be used to activate a specified manipulator when you select an object.

Here's a really quick look.

Open the zooTriggered UI and in the View menu make sure "Edit zooTriggered command" is selected. Then add the objects you want to configure (to the top left pane). Then right-mouse-click in the lower pane and select either the "use move tool preset" or the "use rotate tool preset".


You should end up with something like this


Now enable the trigger by clicking the "load" button so that the "load status" bar changes to green


That's it. Now whenever you select the object, the manipulator tool you specified will become active.

There is a slight delay between your selection and the change of the manipulator, which is not the case with the Show Manipulators mode, but my preference is still the zooTriggered method since it allows me to stick with the regular translate, rotate, scale modes that I generally use.

cMusclePaint.mel update for maya2008 ext2

david | animation,dj mod,mel script | Saturday, March 8th, 2008

If you downloaded my modified version of cMusclePaint.mel recently and you have since upgraded to maya2008 ext2 then you should download my updated version of cMusclePaint.mel

The cMusclePaint RAR file on the downloads page now contains both versions. Choose the one thats right for you.

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.


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.


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.


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.


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).


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 for more info). The integrated menu looks like this.



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.


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.


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


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


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.

« Previous Page | Next Page »

Powered by WordPress | Based on a theme by Roy Tanck