Created
April 19, 2015 20:10
-
-
Save mcenirm/122c6dd18c91ccba4c5c to your computer and use it in GitHub Desktop.
Extract data urls from gltf (or any json?) into separate files
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name=box | |
cat "$name.gltf" \ | |
| jq -r 'leaf_paths | if .[length-1] == "uri" then join(".") else empty end' \ | |
| while read p ; do | |
cat "$name.gltf" \ | |
| jq -r ".$p" \ | |
| sed -e 's/^[^,]*,//' \ | |
| base64 -d \ | |
> "$name.$p.out" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment