def setSkeleton()

in renderer/glViewer.py [0:0]


def setSkeleton(skel_list, jointType=None, colorRGB=None, bReset= True):
    global g_skeletons,g_frameLimit #nparray: (skelNum, skelDim, frameNum)
    # global g_skeletons_GT #nparray: (skelNum, skelDim, frameNum)

    #If skel_list is not a list
    if isinstance(skel_list,list) == False and len(skel_list.shape)==2:
        skel_list = skel_list[np.newaxis,:]

    #add joint type
    if g_skeletons is None or bReset:
        g_skeletons =[]

    # if color is None:
    #     color = (255,0,0)
    #color can None

    for s in skel_list:
        g_skeletons.append({"skeleton":s, "color":colorRGB, "type":jointType})

    # else:# bisGT == False:      TODO: no need to have g_skeletons_GT anymore?
    #     g_skeletons_GT =[]
    #     for s in skel_list:
            
    #         g_skeletons_GT.append({"skeleton":s, "color":(255,0,0), "type":jointType})

    # if jointType =='smpl':
    #     print("Use smplcoco instead of smpl!")
    #     assert(False)
   

    # if bIsGT==False:
    #     #Add Skeleton Data

    #     # if len(skel_list)>1:
    #     #     lens = [len(l) for l in skel_list]
    #     #     minLeng=max(lens)

    #     #     for i in range(0,len(skel_list)):
    #     #         skel_list[i] = skel_list[i][:,:minLeng]

    #     #g_skeletons = np.asarray(skel_list)  #no effect if skel_list is already np.array
    #     g_skeletons = skel_list #List of 2dim np.array

    #     #g_frameLimit = g_skeletons.shape[2]
    #     # frameLens = [l.shape[1] for l in g_skeletons]
    #     # g_frameLimit = max(g_frameLimit,min(frameLens))

    # else:
    #      #Add Skeleton Data
    #     g_skeletons_GT = skel_list #List of 2dim np.array

    #     #g_frameLimit = g_skeletons.shape[2]
    #     # frameLens = [l.shape[1] for l in g_skeletons_GT]
    #     # g_frameLimit = max(g_frameLimit,min(frameLens))

    setFrameLimit()