示例#1
0
def singleTeamCity(tricode):
    ''' A full scene-building routine for single-team CITY elements.'''
    loadTeamsLite(tricode)
    #sort
    sort.sceneTeardown()
    sc = sort.SortControl('Single_Team_CITY')
    sc.run()
    # change output path
    vrs = pm.PyNode('vraySettings')
    vrs.fileNamePrefix.set('TEAMS/{}/%l/%l.#'.format(tricode))
    # rename / save scene
    scene = project.Scene()
    scene.rename(tricode)
示例#2
0
def splitMatchup(tricode, package):
    ''' A full scene-building routine for single-team elements.'''
    #load in the new team
    loadTeamsStadium(tricode, tricode, diagnostic=False, clean=True)
    #sort
    sort.sceneTeardown()
    sc = sort.SortControl('Split_Matchup_{}'.format(package.upper()))
    sc.run()
    #change output path
    vrs = pm.PyNode('vraySettings')
    vrs.fileNamePrefix.set('TEAMS/{}/%l/%l.#'.format(tricode))
    #rename / save scene
    scene = project.Scene()
    scene.rename(tricode)
示例#3
0
def getAnimPath(filetype, message, use_maya_subfolder, folder_only=False, override_name=False):

    # check that the scene is controlled by the pipeline
    try: scene_controller = pm.PyNode('sceneControlObject')
    except: pass

    if override_name:
        folder_name = override_name
    else:
        folder_name = filetype

    # set up export paths
    scene       = project.Scene()
    # The use_maya_subfolder flag determines whether this export goes into a folder
    # below the main project folder or below the maya folder instead.
    anim_folder = {0: scene.project_folder, 1: scene.maya_project_folder}[use_maya_subfolder] + '\\{0}\\'.format(folder_name)
    anim_file   = scene.scene_name

    # If exporting (i.e. determining a full destination file name)
    if not folder_only:
        if override_name:
            anim_file += '.{0}'.format(override_name)

        else:
            custom_string = pm.promptDialog(
                title='Custom name tag?',
                message=message,
                text='',
                b=['OK', 'No'],
                db='OK',
                cb='No',
                ds='No'
                )
            if custom_string == 'OK':
                custom_string = pm.promptDialog(q=True, text=True)
            else:
                custom_string = ''
            anim_file += '_{}.{}'.format(custom_string, filetype)

        return anim_folder + anim_file

    # i.e., if import (just returning a path)
    elif folder_only:
        return anim_folder
示例#4
0
def quad(team, *a):
    ''' A full scene-building routine for 'quad' logo slicks '''
    loadTeamsLite(team, team)
    sorter = sort.SortControl('Quad')
    sorter.run()

    try:
        pm.PyNode('HOMELOGO:GEO_05').visibility.set(0)
        pm.PyNode('AWAYLOGO:GEO_05').visibility.set(0)
    except:
        pass
    try:
        pm.PyNode('HOMELOGO:GEO_06').visibility.set(0)
        pm.PyNode('AWAYLOGO:GEO_06').visibility.set(0)
    except:
        pass

    v_ray = pm.PyNode('vraySettings')
    v_ray.fileNamePrefix.set("""TEAMS/{0}/%l/%l.#""".format(team))

    scene = project.Scene()
    scene.rename(team)
示例#5
0
def init_scene(*a):
    scene = project.Scene()
示例#6
0
def rename_ui(*a):
    if project.isScene():
        scene = project.Scene()
        scene.rename()
    else:
        return
示例#7
0
def save_ui(*a):
    if project.isScene():
        scene = project.Scene()
        scene.save()
    else:
        return
示例#8
0

def init_scene(*a):
    scene = project.Scene()


try:
    pm.deleteUI('cfbTools')
except:
    pass
try:
    pm.deleteUI('pipeline')
except:
    pass

scene = project.Scene(delay=True)

g_main = pm.getMelGlobal('string', '$gMainWindow')

pm.setParent(g_main)
mmenu = pm.menu('cfbTools', l='CFB \'15', to=True)

pm.setParent(menu=True)
#pm.menuItem(l="Reload Scripts", c=lambda *args: pm.evalDeferred( "exec('reload(cfb) in globals()')", lp=True )
#pm.menuItem(divider=True)
#pm.menuItem(l="Launch Widget", c=run)

#pm.menuItem(divider=True)

pm.menuItem(l="Open Scene", c=open_ui)
pm.menuItem(l="Save Scene", c=save_ui)
示例#9
0
def multiTeam(tricode_list, playoff=False, force_name=None):

    if (playoff):
        attachments = getMultiTeamAttachments()

        if len(attachments) > len(tricode_list):
            pm.warning(
                'ERROR  Not enough teams specified ({} minimum).  Aborting...'.
                format(len(attachments)))
            return

        if len(attachments) < len(tricode_list):
            pm.warning(
                'ERROR  Too many teams specified ({} maximum).  Aborting...'.
                format(len(attachments)))
            return

        for idx, loc in enumerate(attachments):
            print attachments[idx]
            attachments[idx] = loc[:-7].strip()

        for idx, tricode in enumerate(tricode_list):
            loadAssetsLite(tricode, attachments[idx], playoff=playoff)

    elif not (playoff):
        namespaces = getMultiTeamAttachments(references=True)

        if len(namespaces) > len(tricode_list):
            pm.warning(
                'ERROR  Not enough teams specified ({} minimum).  Aborting...'.
                format(len(namespaces)))
            return

        if len(namespaces) < len(tricode_list):
            pm.warning(
                'ERROR  Too many teams specified ({} maximum).  Aborting...'.
                format(len(namespaces)))
            return

        for idx, namespace in enumerate(namespaces):
            namespaces[idx] = namespace[:-4].strip()

        for idx, tricode in enumerate(tricode_list):
            loadAssetsNYS(tricode, namespaces[idx])

    sort.sceneTeardown()
    sc = sort.SortControl('Multi-Team (NYS / CHAMP)')
    sc.run()

    if project.isScene():
        scene = project.Scene()
        scene.rename(name=force_name, save=False)

        prefix = scene.custom_string
        vrs = pm.PyNode('vraySettings')
        vrs.fileNamePrefix.set('{}/%l/%l.#'.format(prefix))

        scene.save()
        return
    else:
        return