Exemple #1
0
def open_selected(*args):
    # if no file then warn and skip
    selFile = cmds.textScrollList(widgets["filesTSL"], q=True, si=True)[0]
    if selFile == "No Files":
        cmds.warning("No files available to open!")
        return ()

    # construct the paths
    tab, phase, assetPath, assetFiles = [None, None, None, None]
    selTab = cmds.tabLayout(widgets["assetsTab"], q=True, st=True)
    if selTab != "STGS":
        tab, phase, assetPath, assetFiles = get_asset_info()
    else:
        tab, phase, assetPath, assetFiles = get_stage_info()
    selIndex = cmds.textScrollList(widgets["filesTSL"], q=True, sii=True)[0]
    filePath = os.path.join(assetPath, assetFiles[selIndex - 1])

    # check mods, if so then. .
    changed = cmds.file(q=True, modified=True)
    svState = True
    if changed:
        svState = save_current_dialog()
    if svState:
        of.run(filePath)
    else:
        return ()
Exemple #2
0
def openFile(*args, **kwargs):
    reload(osf)
    osf.run()