def getShape(filepath, obj, isHuman=False): if isHuman: try: return algos3d.targetbuffer[filepath] except KeyError: pass return algos3d.Target(obj, filepath)
for i, filterStr in enumerate(filterStrArr): if not result[i]: result[i] = [] result[i].extend(getFiles(root, filenames, filterStr)) return result def getFiles(root, filenames, filterStr): foundFiles = [] for filename in fnmatch.filter(filenames, filterStr): foundFiles.append(os.path.join(root, filename)) return foundFiles if __name__ == '__main__': obj = algos3d.Target(None, None) allFiles = getAllFiles('data', ['*.target', '*.png']) npzPath = 'data/targets.npz' with zipfile.ZipFile(npzPath, mode='w', compression=zipfile.ZIP_DEFLATED) as zip: npzdir = os.path.dirname(npzPath) allTargets = allFiles[0] # License for all official MH targets lpath = 'data/targets/targets.license.npy' np.save(lpath, makehuman.getAssetLicense().toNumpyString()) zip.write(lpath, os.path.relpath(lpath, npzdir)) os.remove(lpath) for (i, path) in enumerate(allTargets): try: