File Management

Save Export Import

saving exporting and importing and references

from zoo.libs.maya.cmds.filemanage import saveexportimport saveexportimport.multipleImport(“D:/aFile.ma”, duplicates=4, namespace=”xx”)

fileModified()

Checks if the current scene has been modified, returns True if it needs saving.

Returns:

True is there have been modifications to the current scene

Return type:

bool

untitledFileName()

Returns the default maya file name i.e. untitled :rtype: str

isCurrentSceneUntitled()

Determines if the current maya scene is the default untitled file path :rtype: bool

isPathUntitled(path)

Determines if the provided path is an untitled file i.e. mayas default untitled scene

Parameters:

path (str) – The File Path to check

Return type:

bool

currentSceneFilePath()

Returns the current full file path name of the scene, will be “” if not saved

Returns:

The full file path of the current scene

Return type:

str

saveAsDialogMaMb(windowCaption='Save File', directory='', okCaption='OK')

Pops up a save file dialog and save’s to the new path, returns the name of the file to save.

Returns:

The path of the file saved, if cancelled will be “”.

Return type:

str

sceneModifiedDialogue()

Checks if the file has already been saved. Returns “save”, “discard” or “cancel”.

If not saved opens “save”, “discard” or “cancel” window. Returns the button pressed if “discard” or “cancel”

If “save” is clicked it will try to save the current file, if cancelled will return “cancel”

Returns:

The button clicked returned as a lower case string “save”, “discard” or “cancel”

Return type:

str

createNewScene(force=True)

Creates a new maya scene

Parameters:

force (bool) – Will force a new scene even if the current scene has not been saved, False will error if not saved

asciiOrBinary(filePath)
importAllReferences()
multipleReference(filePath, duplicates=4, namespace='xx')

References multiple files into the scene

Parameters:
  • filePath (str) – The full path of the file to import, must be a .ma or .mb file

  • duplicates (int) – How many times to import the file

  • namespace (str) – The name of the namespace, will increment with each import xx0, xx1, xx2 etc

Returns:

success if the import was successful

Return type:

bool

multipleImport(filePath, duplicates=4, namespace='xx')

Import a file multiple times in the scene

Parameters:
  • filePath (str) – The full path of the file to import, must be a .ma or .mb file

  • duplicates (int) – How many times to import the file

  • namespace (str) – The name of the namespace, will increment with each import xx0, xx1, xx2 etc

Returns:

success if the import was successful

Return type:

bool