common

Module for common maya actions

jukeboxmaya.common.preserve_namespace(*args, **kwds)[source]

Contextmanager that will restore the current namespace

Parameters:newns (str | None) – a name of namespace that should be set in the beginning. the original namespace will be restored afterwards. If None, does not set a namespace.
Returns:None
Return type:None
Raises:None
jukeboxmaya.common.preserve_selection(*args, **kwds)[source]

Contextmanager that will restore the current selection

Returns:None
Return type:None
Raises:None
jukeboxmaya.common.locknode(*args, **kwds)[source]

Contextmanager that will lock or unlock the given node and afterwards, restore the original status

Parameters:
  • node (str | list | tuple) – the node to lock/unlock or nodes
  • lock (bool) – True for locking, False for unlocking
Returns:

None

Return type:

None

Raises:

None

jukeboxmaya.common.get_top_namespace(node)[source]

Return the top namespace of the given node

If the node has not namespace (only root), ”:” is returned. Else the top namespace (after root) is returned

Parameters:node (str) – the node to query
Returns:The top level namespace.
Return type:str
Raises:None
jukeboxmaya.common.get_namespace(node)[source]

Return the namespace of the given node

If the node has not namespace (only root), ”:” is returned. Else the namespace is returned

Parameters:node (str) – the node to query
Returns:The top level namespace.
Return type:str
Raises:None
jukeboxmaya.common.disconnect_node(node, src=True, dst=True)[source]

Disconnect all connections from node

Parameters:node (str) – the node to disconnect
Returns:None
Return type:None
Raises:None