def show_SMPL()

in renderer/glViewer.py [0:0]


def show_SMPL(bSaveToFile = False, bResetSaveImgCnt = True, countImg = True, bShowBG = True, zoom = 230, mode = 'camera'):
    init_gl_util()

    if mode == 'init':
        #Setup for rendering
        keyboard('c',0,0)

    global g_bSaveToFile, g_bSaveToFile_done, g_bShowSkeleton, g_bShowFloor, g_viewMode, g_saveFrameIdx
    global g_xTrans,  g_yTrans, g_zoom, g_xRotate, g_yRotate, g_zRotate

    g_bSaveToFile_done = False
    g_bSaveToFile = bSaveToFile
    # g_bShowSkeleton = False
    g_bShowFloor = False

    if mode == 'youtube':
        # bShowBG = True
        g_bShowFloor = True
        if False:   #Original
            g_xTrans=  -86.0
            g_yTrans= 0.0
            g_zoom= zoom
            g_xRotate = 34.0
            g_yRotate= -32.0
            g_zRotate= 0.0
            g_viewMode = 'free'
        elif True:   # cook
            g_xTrans=  170
            g_yTrans= 0.0
            # g_zoom= 1600          #Cook
            # g_zoom= 1000                #Comedian
            g_zoom= 800                #Bengio
            g_xRotate = 34.0
            g_yRotate= -32.0
            g_zRotate= 0.0
            g_viewMode = 'free'
        elif True:   # almost size
            g_xTrans=  0
            g_yTrans= 0
            g_zoom= zoom #230
            g_xRotate = 61
            g_yRotate= 3
            g_zRotate= 0.0
            g_viewMode = 'free'
    elif mode =="side":
        bShowBG = False
        g_bShowFloor = False
        # global g_xTrans,  g_yTrans, g_zoom, g_xRotate, g_yRotate, g_zRotate
        # g_xTrans=  170
        # g_yTrans= 0.0
        # g_zoom= 1600          #Cook
        # g_zoom= 1000                #Comedian
        g_zoom= 266                #Bengio
        g_xRotate = 90
        g_yRotate= 0
        g_zRotate= 0.0
        g_viewMode = 'free'

    elif mode == 'camera' or mode == 'init':
        g_viewMode = 'camView'

    global g_bShowBackground
    g_bShowBackground = bShowBG

    if bResetSaveImgCnt:
        g_saveFrameIdx = 0 #+= 1      #always save as: scene_00000000.png
    
    if mode == 'init':
        global g_stopMainLoop
        g_stopMainLoop=False
        # while True:
        while g_rotateView_counter*g_rotateInterval<360:
            glutPostRedisplay()
            if bool(glutMainLoopEvent)==False:
                continue
            glutMainLoopEvent()
            break
            if g_stopMainLoop:
                break
    else:
        if g_bSaveToFile:
            while g_bSaveToFile_done == False:
                glutPostRedisplay()
                if bool(glutMainLoopEvent)==False:
                    continue
                glutMainLoopEvent()
        else:
            for i in range(6):   ##Render more than one to be safer
                glutPostRedisplay()
                if bool(glutMainLoopEvent)==False:
                    continue
                glutMainLoopEvent()

    if countImg:
        g_saveFrameIdx +=1
    g_bSaveToFile = False