def generateFace(context): mask = getMask(context) base = getBaseChar(context) warpField = warp.CWarp(context) warpField.setupFromObject(mask, context) #createTestFace(context, warpField, mask) warpField.warpMesh(mask, base) scn = context.scene scn.objects.active = base
def warpMorph(context): scn = context.scene warpField = warp.CWarp(context) warpField.setupFromCharacters(context, theSourceCharacter, theTargetCharacter) srcPath = os.path.join(scn.MhSourceMorphTopDir, scn.MhSourceMorphDir, scn.MhSourceMorphFile) trgPath = os.path.join(scn.MhTargetMorphTopDir, scn.MhTargetMorphDir, scn.MhTargetMorphFile) if scn.MhWarpAllMorphsInDir: srcDir = os.path.dirname(srcPath) trgDir = os.path.dirname(trgPath) for file in os.listdir(srcDir): (fname, ext) = os.path.splitext(file) if ext == ".target": warpSingleMorph(os.path.join(srcDir, file), os.path.join(trgDir, file), warpField, scn) else: warpSingleMorph(srcPath, trgPath, warpField, scn) print("File(s) warped")