Zoo Scene

thumbnails(directory, fileList)

Returns a list of thumbnail image paths from a zooScene list without extensions

Return thumbPathList:

List of thumbnail paths one for each zooScene file (no extension)

Rtype thumbFullPathList:

list of basestring

thumbnail(zooSceneFile, directory)

Get thumbnail from zooScene

Parameters:
  • zooSceneFile

  • directory

Returns:

infoDictionaries(zooSceneNameList, directory)

Returns a list of info dictionaries for each .zooScene file.

These dictionaries contain information such as author, tag, descriptions etc

Return infoDictList:

A list of info dictionaries for each .zooScene file

Rtype infoDictList:

list[dict]

infoDictionary(zooSceneFile, directory)

Zoo Info dictionary

Parameters:
  • zooSceneFile

  • directory

Returns:

updateOldFolders(fileName, directoryPath)

Renames dependency folder from old to new “fileName_fileDependency” to “fileName_jpg_fileDependency”

Parameters:

fileName – Path to the file

Returns:

Return type:

createEmptyInfoDict()

Creates an empty .zooInfo dictionary

Return infoDict:

Zoo info dictionary

Rtype infoDict:

dict()

renameZooSceneOnDisk(newNameNoExtension, filePath, extension='zooScene')

Renames all .zooScene re-nameable dependency files on disk, and the .zooScene itself Also renames the subdir given the newName (no ext) will check that the files and directory is writable and error if the files can’t be written before renaming

Parameters:
  • newNameNoExtension (str) – the filename with no extension, will delete all files named this with an extension

  • filePath (str) – the full file path to the zoo scene including file and extension. Expects zooScene, but it doesn’t have to be

  • extension (basestring) – The file extension

Return renamedFullPathFiles:

a list of the full paths of the renamed files, can be many dependency files

Rtype renamedFullPathFiles:

list

getDependencyFolder(zooSceneFullPath, create=True)

creates the dependency directory for .zooscene files, these can contain .abc, .info, .obj, .fbx, textures etc

Parameters:
  • zooSceneFullPath (str) – the full path to the .zooscene file

  • create (bool) – Create if doesn’t exist

Return fullDirPath:

the full directory path to the new folder

Rtype fullDirPath:

str

createDependencies(fullDirPath)

Create dependencies if it doesnt exist

Parameters:

fullDirPath

Returns:

Return type:

getFileDependenciesList(zooScenePath, ignoreThumbnail=False)

Retrieve a list of all files in the dependency directory DIRECTORYNAMEDEPENDENCIES Files do not have full path so directory path is also returned, files are [“fileName.abc”, “fileName.zooInfo”] etc

Parameters:
  • zooScenePath (str) – the full path to the file usually .zooscene but can be any extension

  • ignoreThumbnail (str) – ignores the files called thumbnail.* useful for renaming

Return fileDependencyList:

list of short name files found in the subdirectory DIRECTORYNAMEDEPENDENCIES

Rtype fileDependencyList:

list

Return fullDirPath:

the full path of the sub directory DIRECTORYNAMEDEPENDENCIES

Rtype fullDirPath:

str

getZooFiles(filePath, ignoreThumbnail=False)

Retrieves all zoo files related to the given file (usually .zooscene).

Expects .zooscene file but can be any file under the main folder that has file dependencies

returns only filenames not the directory path

Parameters:
  • filePath (basestring) – full path of a .zooscene file or a file in the main folder

  • ignoreThumbnail (str) – ignores the files called thumbnail.* useful for renaming

Return relatedFiles, subDir:

all files related to the .zooscene in the current directory as string paths, and the dependency subdirectory

Rtype relatedFiles:

tuple(list[basestring], basestring)

getSingleFileFromZooScene(zooSceneFullPath, fileExtension)

Check if file exists in zooScene dependencies

Returns the name of the file if it exists given the extension eg .abc from the zooSceneFullPath Gets all the files in the subdirectory associated with the .zooScene file and filters for the file type Supports returning of one file, the first it finds so not appropriate for textures

Parameters:
  • zooSceneFullPath (str) – the full path of the .zooScene file to be saved

  • fileExtension (str) – the file extension to find no “.”, so alembic is “abc”

Return extFileName:

the filename (no directory) of the extension given > for example “myFileName.abc”

Rtype extFileName:

str

createTagInfoDict(assetType, creator, website, tags, description, saveInfo, animInfo)

Creates a dict ready for the zooInfo file

Parameters:
  • assetType (str) – the information about asset type, model, scene, lights, shaders, etc

  • creator (str) – the information about creator/s

  • website (str) – the information about the creators website links

  • tags (str) – the tag information

  • description (str) – the full description

  • saveInfo (list) – the file information saved as a list [“alembic”, “generic lights”] etc

  • animInfo (str) – the animation information of the file “0 100” or “” or None if none

Return zooInfoDict:

the dict containing all information including the file version number

Rtype zooInfoDict:

str

updateZooInfo(zooSceneFullPath, assetType='Not Specified', creator='', website='', tags='', description='', saveInfo='', animInfo='')

Updates the .zooInfo file depending on the incoming values, if not variable then leave the values as are.

Parameters:
  • zooSceneFullPath (str) – the full path of the zooScene file, this will save out as another file zooInfo

  • assetType (str) – the information about asset type, model, scene, lights, shaders, etc

  • creator (str) – the information about creator/s

  • website (str) – the information about the creators website links

  • tags (str) – the tag information

  • description (str) – the full description

  • saveInfo (list) – the file information saved as a list [“alembic”, “generic lights”] etc

  • animInfo (str) – the animation information of the file “0 100” or “” or None if none

Return zooInfoFullPath:

the full path of the .zooInfo file

Rtype zooInfoFullPath:

str

Return zooInfoDict:

the dict containing all information including the file version number

Rtype zooInfoDict:

str

writeZooInfo(zooSceneFullPath, assetType, creator, website, tags, description, saveInfo, animInfo, message=True)

Saves a zooInfo file in the subdirectory from the zooScene file

Parameters:
  • zooSceneFullPath (str) – the full path of the zooScene file, this will save out as another file zooInfo

  • assetType (str) – the information about asset type, model, scene, lights, shaders, etc

  • creator (str) – the information about creator/s

  • website (str) – the information about the creators website links

  • tags (str) – the tag information

  • description (str) – the full description

  • saveInfo (list) – the save info list, what did the file save?

  • animInfo

  • message (bool) – report the save success message to the user?

Return zooInfoFullPath:

the full path of the file saved (zooInfo)

Rtype zooInfoFullPath:

getZooInfoFromFile(zooSceneFullPath, message=True)

Gets other files from the .zooScene, for example .zooInfo from a file on disk

Parameters:

zooSceneFullPath (str) – the full path of the zooScene file, this will save out as another file zooInfo

Return zooInfoDict:

the dictionary with all info information, if None the file wasn’t found

Rtype zooInfoDict:

dict

Return fileFound:

was the zooInfo file found?

Rtype fileFound:

bool

deleteZooDependencies(filePathZooScene, message=True, keepThumbnailOverride=False)

Deletes zoo file dependencies and the .zooScene leaving the subDirectory, deletes the actual files on disk. Useful for saving over existing files

Parameters:
  • filePathZooScene (str) – The full file path of the .zooscene to be deleted, other files are deleted automatically

  • message (bool) – report the message to the user in Maya?

  • keepThumbnailOverride (bool) – keeps the existing thumbnail image if over righting, usually for delete when renaming

Return filesFullPathDeleted:

The files deleted

Rtype filesFullPathDeleted:

list

deleteZooSceneFiles(fileFullPath, message=True, keepThumbnailOverride=False)

Deletes a file and it’s related dependencies on disk, usually a .zooScene but can have any extension

Parameters:
  • fileFullPath (str) – The full file path of the file to be deleted, dependency files are deleted automatically

  • message (bool) – report the message to the user in Maya?

  • keepThumbnailOverride (bool) – If True will skip the thumbnail image deletion. Used while renaming.

Return filesFullPathDeleted:

The files deleted

Rtype filesFullPathDeleted:

list

updateZooSceneDir(directory)

Updates .zoo Scenes from pre v1 format where generic light and shader data was saved inside the .zooScene Will batch all .zooScene files in the given directory and fix them from the old format

Parameters:

directory

writeZooGShaders(zooShaderDict, zooSceneFullPath)

Writes a shader dict to disk in the zoo dependency sub folder

Parameters:
  • zooShaderDict (dict) – the generic shader dictionary

  • zooSceneFullPath (str) – the full path to the zooScene file

Return zooShadFullPath:

the full path to the shader file that has been saved

Rtype zooShadFullPath:

str

writeZooGLights(zooLightsDict, zooSceneFullPath)

Writes a light dict to disk inside the zoo dependency sub folder of the given .zooScene file

Parameters:
  • zooLightsDict (dict) – the generic lights dictionary

  • zooSceneFullPath (str) – the full path to the zooScene file

Return zooShadFullPath:

the full path to the shader file that has been saved

Rtype zooShadFullPath:

str

writeExportZooInfo(zooSceneFullPath, zooSceneDict, gShaderDict, gLightDict, objectRootList, tagInfoDict, animationInfo)

While exporting writes the .zooInfo file Should add cameras

Parameters:
  • zooSceneFullPath (str) – full path the the .zooScene

  • zooSceneDict (dict) – the dictionary that will be written to the .zooScene

  • objectRootList (list) – the scene roots from alemebic

  • tagInfoDict (dict) – the tag info if provided ok if it’s empty, this will be written

Return zooInfoFullPath:

the full path to the zooInfo file

Rtype zooInfoFullPath:

str

Return fileInfoSaved:

the info list with what was saved

Rtype fileInfoSaved:

list

loadGenericShaderLightFiles(zooSceneFullPath)

loads a .zooGShad and .zooGLight information from a zooSceneFullPath

Parameters:

zooSceneFullPath (str) – the full path to the .zooScene file

Return shadMultDict:

the generic shader dictionary

Rtype shadMultDict:

dict

Return lightMultDict:

the generic light dictionary

Rtype lightMultDict:

dict