Space Switch Tool 1.0

Creates a fast and reliable space switch setup with a selection based marking menu to switch between spaces while maintaining the object's position. The tool provides a very flexible design that would easily allow the user to edit, add, remove and bake created spaces.

 

Click to view GIF (Executing the tool command in the script editor)

userSetup.py file example

userSetup.py file example

Installation

Maya versions: 2014, 2015, 2016, 2017

1 - Place the spaceSwitchTool folder in your user scripts folder. for example C:\Users\(user)\Documents\maya\<version>\scripts

2 - In a python tab in the script editor add these lines: 

from spaceSwitchTool import spaceSwitchSetup as switchSetup
switchSetup.show()

3 - Run the marking menu command in the script editor, in a python tab run these lines:

PS: you will need to run these lines every time you open Maya to use the marking menu. If you would like to have this step added to Maya automatically at startup follow step 4.

from spaceSwitchTool import spaceSwitchScripts
spaceSwitchScripts.spaceSwitch_MM()

4 - To automatically run the marking menu command at startup, add these lines to your userSetup.py file:

import maya.cmds as cmds
from spaceSwitchTool import spaceSwitchScripts
cmds.evalDeferred('''spaceSwitchScripts.spaceSwitch_MM()''')

Creating the Space Switch Setup

In The Create Spaces Tab you have all the options to create and add spaces to your target object.

  1. In The Create Spaces Tab you have all the options to create and add spaces to your target object.

  2. Add the Target Node (The object you want to follow different spaces) using the << Button next to the Target Node Field.
     
  3. You will need a parent transform/group on top of your Target Node that has the same pivot. Select the parent and add it to the Parent Group field using the << Button. If you don't have a parent group,  use the Create a parent Space switch Group button and it will create a parent group that meets the below conditions and add it automatically to the Parent Group field.
    The Parent Group is what we will add the constraints on to drive the Target Node.There are a few conditions the parent transform needs to meet:
          It needs to have the same pivot as the Target Node.
          It needs to be editable which means that it shouldn't have any connections, constraints or locked              channels on it.
     
  4. Add the name of the space switch attribute that will be added to the Target Node. This is the attribute we will use to animate and switch between the different spaces.
     
  5. Choose the constraint type you would like to drive the parent group with.
     
  6. The spaces group is the setup group. You should have one for each rig you have and re-use it when you create a space switch setup for another node in the same rig. If you don't have one the tool will create one for you. Make sure to parent the spaces group to you rig's move, rotate and scale group.
     
  7. select the driver controllers/spaces in the scene and click on Add A New Space button. The spaces will be added in the order of selection. You can re-order the spaces and change their display names in the Switch Attribute we defined earlier.
     
  8. create the setup by pressing the Generate Spaces button
 

Create Spaces Tab


Click to play GIF (spaces group in the outliner)

Click to play GIF (Created switch attribute and marking menu)

Click to view GIF (Adding a new space to an existing setup)

The Space Switch Setup Behaviour

After creating the setup, you should see the spaces group (if you didn't initially have one) in the outliner. Parent the spaces group under your rig's rig's move, rotate and scale group.

The switch attribute is added to the target node.

The marking menu is hooked to the CTRL+MMB with all the spaces you added to the setup.

 

The Marking menu

The marking menu is not only to switch faster between spaces, but it also executes a script to maintain the the object's position and orientation when you switch between spaces (This behaviour doesn't apply to the switch attribute in the channel box).

When you start animating the object and use the marking menu to switch to another space, the marking menu will add a keyframe one frame before and on the current frame to make sure the object doesn't jump between frames.If you don't have any keyframes on the target node, the marking menu will assume you are just trying the spaces out and will not add keyframes.

 

Adding a New Space to an Existing setup

Adding a new space works exactly like the creating the space switch setup. Only this time when you add the target node the tool will detect the options were used before to create the previous setup and load this info for you. All you have to do is add the new drivers and the tool will append it to the space switch attribute and the marking menu. (See GIF Below)


Baking Spaces

Baking Spaces can be very useful after you are done animating a prop/target node under the chosen spaces and now you would like to separate them from each other. So that tweaking the animations on the driver space doesn't affect the animation on the target node.

You can use the options in the Bake Spaces tab to chose the space you would like to bake to and the time range you would like to use.

  1. Select the Target Node and add to the Target Node field by pressing the << button
     
  2. Select the space you would like to bake the animations under from the available spaces drop down menu
     
  3. Add the start and end frame manually by selecting the Custom Range option, or use a predefined option like the Use Timeline Range and the Use the Playback Range.

You can also use the marking menu to bake the spaces to the playback frame range automatically.

Using the Bake Spaces tab to bake spaces.

Using the Marking Menu to bake spaces.


Editing and Debugging Spaces Setup

Editing and Debugging a space switch setup is fairly easy in the EditAndDebug tab.

Warning:  Re-ordering or deleting spaces in the Edit mode is animation destructive and you should only use it before publishing the rig. However, Renaming the display names of the spaces will not affect any existing animations.

Editing in the Edit and Debug tab.

After adding the target node (the object that has the setup on), you will see that the Drivers section will be populated with all the driver spaces you have on the target node.

The Driven Node is the parent group you defined earlier in the setup. And this is the group we are constraining to the driver spaces.

The Diving constraint is the constraint node we created and has all the driver spaces weights.

You can re-name, re-order and delete spaces in the Drivers section.

You can also delete the whole space switch setup cleanly from your object and it will delete all the associated nodes created for that setup.

 

 

 


Terms Of Use

The basic license is for personal projects only. If you are intending to use the tool for a project or distributing rigs you need a commercial license. You may not redistribute, rename or claim rights for the tool.

Feedback, questions and bug reporting are always welcome. However do not expect the author to provide any extra features not shown or documented in the tool.

copyright: 2017 © purplepuppet AB. All Rights Reserved