def readCorrectives(drivers, human, part):
    shapeList = []
    warpmodifier.resetWarpTargets(human)
    for (pose, lr, expr, vars) in drivers:
        print "Corrective", part, pose
        if warp.numpy:
            shape = warpmodifier.compileWarpTarget(
                "shared/mhx/targets/correctives/%s/${ethnic}/${gender}-${age}/%s.target" % (part, pose),
                "GenderAgeEthnicModifier",
                human,
                part,
            )
        else:
            shape = loopGendersAges((part, pose), human, "Corrective")

        shapeList.append((shape, pose, lr))
    return shapeList
def readExpressionUnits(human, t0, t1):
    shapeList = []
    warpmodifier.resetWarpTargets(human)
    dt = t1 - t0
    n = len(Expressions)
    if n > 0:
        dt /= n
    t = t0
    for name in ExpressionUnits:
        gui3d.app.progress(t, text="Reading expression %s" % name)
        if warp.numpy:
            shape = warpmodifier.compileWarpTarget(
                "data/targets/expression/units/${ethnic}/${gender}_${age}/%s.target" % name,
                "GenderAgeEthnicModifier2",
                human,
                "face",
            )
        else:
            shape = loopGendersAges(name, human, "ExpressionUnits")
        shapeList.append((name, shape))
        t += dt
    return shapeList
def readFaceShapes(human, drivers, t0, t1):
    shapeList = []
    shapes = {}
    warpmodifier.resetWarpTargets(human)
    dt = t1 - t0
    n = len(drivers.keys())
    if n > 0:
        dt /= n
    t = t0
    for name, value in drivers.items():
        (fname, bone, channel, sign, min, max) = value
        if name[-2:] in ["_L", "_R"]:
            lr = "LR"
            sname = name[:-2]
        else:
            lr = "Sym"
            sname = name

        try:
            shape = shapes[fname]
            doLoad = False
        except:
            doLoad = True
        if doLoad:
            gui3d.app.progress(t, text="Reading face shape %s" % fname)
            if warp.numpy:
                shape = warpmodifier.compileWarpTarget(
                    "shared/mhx/targets/body_language/${gender}-${age}/%s.target" % fname,
                    "GenderAgeEthnicModifier",
                    human,
                    "face",
                )
            else:
                shape = readShape("shared/mhx/targets/body_language/female-young/%s.target" % fname)
            shapes[fname] = shape
            shapeList.append((sname, shape, lr, min, max))
            t += dt
    shapeList.sort()
    return shapeList