Skip to content

Instantly share code, notes, and snippets.

@mcenirm
Created April 19, 2015 20:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mcenirm/122c6dd18c91ccba4c5c to your computer and use it in GitHub Desktop.
Save mcenirm/122c6dd18c91ccba4c5c to your computer and use it in GitHub Desktop.
Extract data urls from gltf (or any json?) into separate files
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