ART_SpaceSwitcher

Module for handling space switching. Contains classes for creating spaces, and interface classes for managing spaces.

class Tools.Animation.ART_SpaceSwitcher.BakeSpace(control, space_to_bake, start, end)[source]

Class for baking into a space over a frame range.

Example:

import Tools.Animation.ART_SpaceSwitcher as sw
sw.BakeSpace("char:weapon_jnt_anim", "r hand", 0, 52)
sw.BakeSpace("char:weapon_jnt_anim", "l hand", 53, 72)
__init__(control, space_to_bake, start, end)[source]
Parameters:
  • control (str) – The name of the control to bake the space onto.
  • space_to_bake (str) – The name of the space to bake.
  • start (float) – The start frame of the range to bake.
  • end (float) – The end frame of the range to bake.
class Tools.Animation.ART_SpaceSwitcher.CreateGlobalSpaces(template=None)[source]

This class creates a global space for multiple controls in one go, rather than having to create the same space on individual controls one at a time. It takes in a template file (*.spaces) that can be created with the GUI.

See also

Tools.Animation.Interfaces.ART_SpaceSwitcherUI.ART_CreateGlobalSpacesUI

__init__(template=None)[source]
Parameters:template (file path string) – File path to the *.spaces file to build global spaces from.
class Tools.Animation.ART_SpaceSwitcher.CreateSpace(name, control, target, space_type='parent')[source]

Class for creating a space on a control.

Example:

import Tools.Animation.ART_SpaceSwitcher as sw
sw.CreateSpace("l hand", "weapon_jnt_anim", "weapon_jnt_l_anim")
__init__(name, control, target, space_type='parent')[source]
Parameters:
  • name (str) – The name of the space.
  • control (str) – The control which is getting the space.
  • target (str) – The object which is the space for the control.
  • space_type (str) – The type of constraint to use when creating the space.
class Tools.Animation.ART_SpaceSwitcher.DeleteSpace(control, space_to_delete)[source]

Class for handling deletion of spaces.

Example:

import Tools.Animation.ART_SpaceSwitcher as sw
sw.DeleteSpace("char:ik_hand_l_anim", "l hand")
__init__(control, space_to_delete)[source]
Parameters:
  • control (str) – The name of the control to delete the space from.
  • space_to_delete (str) – The name of the space to remove.
class Tools.Animation.ART_SpaceSwitcher.RenameSpace(control, space, new_name)[source]

Class for handling renaming of spaces.

Example:

import Tools.Animation.ART_SpaceSwitcher as sw
sw.RenameSpace("char:ik_hand_l_anim", "l hand", "IK left hand")
__init__(control, space, new_name)[source]
Parameters:
  • control (str) – The name of the control which has the space to rename.
  • space (str) – The name of the space to rename.
  • new_name (str) – The new name of the space.
class Tools.Animation.ART_SpaceSwitcher.SwitchSpace(control, space)[source]

Class for switching spaces on a control

Example:

import Tools.Animation.ART_SpaceSwitcher as sw
sw.SwitchSpace("char:ik_hand_l_anim", "weapon")
__init__(control, space)[source]
Parameters:
  • control (str) – The control to switch the space on.
  • space (str) – The name of the space to switch to.
class Tools.Animation.ART_SpaceSwitcher.UpdateSpaceMatching(control, match_previous, match_next)[source]

This class updates matching on space switching frames for cases when the motion has been changed since the space- switching occurred.

__init__(control, match_previous, match_next)[source]
Parameters:
  • control (str) – The control to update the matching on.
  • match_previous (bool) – Whether to match the previous frame’s pose.
  • match_next (bool) – Whether to match the next frame’s pose.
Tools.Animation.ART_SpaceSwitcher.find_control_spaces(control)[source]

Given the control, find all spaces available to that control.

Parameters:control (str) – The animation control to locate spaces on.
Returns:Returns a list of spaces found.
Return type:An array of strings.
Tools.Animation.ART_SpaceSwitcher.get_array_size(space_node)[source]

Gets the number of spaces on the given control.

Parameters:space_node (str) – The control that has an array of spaces to query.
Returns:Returns the array size and the MPlug of the spaces attribute in a list.
Return type:[int, MPlug]