MayaFile

class cgp_maya_utils.files.MayaFile(path)

Bases: cgp_generic_utils.files.File

file object that manipulates any kind of maya file on the file system

classmethod create(path, content=None, **__)

create a maya file

Parameters:
  • path (str) – path of the maya file
  • content (any) – content of the maya file
Returns:

the created maya file

Return type:

cgp_maya_utils.files.MayaFile

import_(asReference=False, namespace=None)

import the maya file in the scene

Parameters:
  • asReference (bool) – True : maya file is referenced - False maya file is imported without reference
  • namespace (str or cgp_maya_utils.scene.Namespace) – namespace of the file to import
open(force=False)

open the maya file

Parameters:force (bool) – True : opening will be forced - False : prompt will show before opening