| # Assume python 2.6 or 2.7 |
| # -- config ----------------------- |
| # Absolute path pointing to your cloned git repo of https://github.com/KhronosGroup/glTF-Sample-Models |
| sample_model_dir = "/home/syoyo/work/glTF-Sample-Models" |
| base_model_dir = os.path.join(sample_model_dir, "2.0") |
| # Include `glTF-Draco` when you build `loader_example` with draco support. |
| kinds = [ "glTF", "glTF-Binary", "glTF-Embedded", "glTF-MaterialsCommon"] |
| # --------------------------------- |
| print("Testing: " + filename) |
| cmd = ["./loader_example", filename] |
| p = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE) |
| (stdout, stderr) = p.communicate() |
| print("Failed to execute: ", cmd) |
| for d in os.listdir(base_model_dir): |
| p = os.path.join(base_model_dir, d) |
| targetDir = os.path.join(p, k) |
| g = glob.glob(targetDir + "/*.gltf") + glob.glob(targetDir + "/*.glb") |
| print("Success : {0}".format(len(success))) |
| print("Failed : {0}".format(len(failed))) |
| if __name__ == '__main__': |