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

I'm assuming you are familiar with the zoo space switching system. It is integrated with zooCST so that controls can easily be switched from one space to another while maintaining position and orientation, using the object's RMB-menu.

If you animate space switching, then you need to keyframe the child object on the frame before the switch and on the switch frame its self. The keyframe on the frame before the switch is required to prevent the liklihood of the object jumping if the new parent space is in a different translation/rotation to the old one.

As you refine your animation, you will probably change the transformations of the parents and that will require that the keyframes on the child objects change too which becomes messy due to those extra keyframes on the frame before the switch.

djZooSpaceSwitchingKeys.mel adds an extra function to the zoo space switch command which takes care of the "frame before the switch" keying. I have called this extra function "jump prevention".

When jump prevention is enabled and you switch space then the child object is automatically keyed at the frame before the switch so that there is no jump in the animation. Later, if the transformation of the parent changes in some way, then you can go back to the switch frame and update the parent space by reselecting the current parent from the RMB-menu. The current parent stays the same, but the keyframes on the child object at the frame before the switch are recalculated to eliminate the jump that was introduced by the parent transform being changed.

Here is a snapshot of the modified RMB-menu

spaceSwitchingDJX01.jpg

I have added a menu item to toggle "jump prevention". I have also added a check box to the "parent to..." items which updates to indicate which is the current parent (saves having to select the object and look in the channel box).

To make this work I had to slightly change two of the zooToolbox scripts - zooObjMenu.mel and zooSpaceSwitching.mel - and I wrote two new scripts called djZooSpaceSwitchingKeys.mel and djOptionVar.mel. All four scripts are contained in the RAR file and you just need to put them in your local scripts folder and restart maya. (Make sure to keep a backup copy of the two original zoo scripts.)

Download djZooSpaceSwitchingKeys.rar here.

NOTE: None of this will work unless you have the zooToolbox installed.

3 Comments »

  1. wow, this looks totally cool. I'll have to check this one out and see how it works. i've been thinking about spending some time solving this problem in the very near future, but it seems you've already done the hard work.

    i hope you don't mind if i steal you idea and put it in the toolbox? ;)

    Comment by macaronikazoo — January 22, 2008 @ 6:24 pm

  2. [...] (in many cases thats not really very hard - there are a lot of nasty edges in many of my tools).  this one caught my eye just now.  i don’t really follow his blog, but every now and then wordpress [...]

    Pingback by :: m a c a r o n i K a z o o :: » Blog Archive » dj the dude — January 22, 2008 @ 6:29 pm

  3. Hey Hamish, if you reckon that my little addition to all your awesome stuff is helpful I would be flattered to hear you have stolen it :)

    Comment by david — January 22, 2008 @ 8:21 pm

RSS feed for comments on this post.

Leave a comment

You must be logged in to post a comment.

Powered by WordPress | Based on a theme by Roy Tanck