commands

Wrappers around common maya commands. These functions are inteded to be used in jukeboxcore.actions.ActionUnit.

jukeboxmaya.commands.open_scene(f, kwargs=None)[source]

Opens the given JB_File

Parameters:
  • f (jukeboxcore.filesys.JB_File) – the file to open
  • kwargs (dict|None) –

    keyword arguments for the command maya.cmds file. defaultflags that are always used:

    open:True

    e.g. to force the open command use {'force'=True}.

Returns:

An action status. The returnvalue of the actionstatus is the opened mayafile

Return type:

ActionStatus

Raises:

None

jukeboxmaya.commands.save_scene(f, kwargs=None)[source]

Save the current scene to the given JB_File

Note

This will rename the currently open scene. So if you save again afterwards, you will save to the location of the given JB_File. No files are renamed. This just uses:

cmds.file(rename=f.get_fullpath())
Parameters:
  • f (jukeboxcore.filesys.JB_File) – the file to save the current scene to
  • kwargs (dict|None) –

    keyword arguments for the command maya.cmds file. defaultflags that are always used:

    save:True

    e.g. to force the save command use {'force'=True}.

Returns:

An action status. The returnvalue of the actionstatus is the saved mayafile

Return type:

ActionStatus

Raises:

None

jukeboxmaya.commands.import_all_references(arg, kwargs=None)[source]

Import all references in the currently open scene

Parameters:
  • arg – this argument is ignored. But thisway you can use this function in an ActionUnit more easily.
  • kwargs (dict|None) –

    keyword arguments for the command maya.cmds file. defaultflags that are always used:

    importReferences:
     True
Returns:

An action status. The returnvalue of the actionstatus are the imported references.

Return type:

ActionStatus

Raises:

None

jukeboxmaya.commands.update_scenenode(f)[source]

Set the id of the current scene node to the id for the given file

Parameters:f (jukeboxcore.filesys.JB_File) – the file to save the current scene to
Returns:None
Return type:None
Raises:None