Exemplo n.º 1
0
def new_katana_scene():
    '''
    :description to create new katana scene
    :param None
    :example
        from core import scene
        scene.new_katana_scene()               
    '''
    KatanaFile.New()
    return True
Exemplo n.º 2
0
def close_file():
    if HOST == STANDALONE:
        from tentaculo.api import standalone
        standalone.message_function("close_file")
    elif HOST == MAYA or HOST == MAYA2:
        mc.file(new=True, force=True)
    elif HOST == NUKE:
        nuke.scriptClear()
    elif HOST == HOUDINI:
        hou.hipFile.clear(suppress_save_prompt=True)
    elif HOST == MAX:
        MaxPlus.FileManager.Reset(noPrompt=True)
    elif HOST == C4D:
        c4d.documents.CloseAllDocuments()
    elif HOST == BLENDER:
        bpy.ops.wm.read_homefile()
    elif HOST == KATANA:
        KatanaFile.New()

    return True
Exemplo n.º 3
0
def create_file(log, filepath, origin_path=None):
    dir = os.path.dirname(filepath)
    if not os.path.exists(dir):
        raise Exception('{0} does not exist'.format(dir))

    if origin_path is None: origin_path = filepath

    if HOST == STANDALONE:
        from tentaculo.api import standalone
        standalone.message_function("create_file", [filepath])
    elif HOST == MAYA or HOST == MAYA2:
        check_workspace_maya(log, origin_path)
        mc.file(new=True, force=True)
        mc.file(rename=filepath)
        mc.file(save=True, type="mayaAscii")
    elif HOST == NUKE:
        nuke.scriptClear()
        nuke.scriptSaveAs(filepath, overwrite=1)
    elif HOST == HOUDINI:
        hou.hipFile.clear(suppress_save_prompt=True)
        hou.hipFile.save(filepath)
    elif HOST == MAX:
        MaxPlus.FileManager.Reset(noPrompt=True)
        MaxPlus.FileManager.Save(filepath)
    elif HOST == C4D:
        c4d.documents.CloseAllDocuments()
        newDoc = c4d.documents.BaseDocument()
        c4d.documents.InsertBaseDocument(newDoc)
        c4d.documents.SaveDocument(newDoc, str(filepath),
                                   c4d.SAVEDOCUMENTFLAGS_0,
                                   c4d.FORMAT_C4DEXPORT)
        c4d.documents.LoadFile(str(filepath))
    elif HOST == BLENDER:
        bpy.ops.wm.read_homefile()
        bpy.ops.wm.save_mainfile(filepath=filepath, check_existing=False)
    elif HOST == KATANA:
        KatanaFile.New()
        KatanaFile.Save(filepath)

    return filepath
def openNew():
    KatanaFile.New()