-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
That should convert .glb and .gltf files into .usdz
- Loading branch information
0 parents
commit a50e696
Showing
6 changed files
with
94 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
.DS_Store |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# Convert .glb and .gltf into apples .usdz quicklook files. | ||
|
||
It uses this repo under the hood. | ||
https://github.com/google/usd_from_gltf#compatibility | ||
|
||
# Run | ||
Using helper script that will output a usdz file with same name as input | ||
``` | ||
./run.sh my-file-in-same-directory.glb | ||
``` | ||
|
||
Using raw docker command | ||
``` | ||
docker run \ | ||
--rm \ | ||
-v $(PWD):/usr/app \ | ||
leon/usd-from-gltf:latest \ | ||
inputfile.glb \ | ||
outputfile.usdz | ||
# or on one line | ||
docker run -it --rm -v $(PWD):/usr/app leon/usd-from-gltf:latest inputfile.glb outputfile.usdz | ||
``` | ||
|
||
# Build | ||
``` | ||
./build.sh | ||
``` |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#!/bin/sh | ||
|
||
# Build USD container | ||
docker build usd -t leon/usd | ||
|
||
# Build gltf_to_usdz container | ||
docker build usd-from-gltf -t leon/usd-from-gltf | ||
|
||
# Push | ||
docker push leon/usd:latest | ||
docker push leon/usd-from-gltf:latest |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
#!/bin/sh | ||
docker run -it --rm -v $(PWD):/usr/app leon/usd-from-gltf:latest "$@" "${@%.*}.usdz" |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# Since USD takes so long to build, we separate it into it's own container | ||
FROM leon/usd:latest | ||
|
||
WORKDIR /usr/src/ufg | ||
|
||
# Configuration | ||
ARG UFG_RELEASE="3bf441e0eb5b6cfbe487bbf1e2b42b7447c43d02" | ||
ARG UFG_SRC="/usr/src/ufg" | ||
ARG UFG_INSTALL="/usr/local/ufg" | ||
ENV USD_DIR="/usr/local/usd" | ||
ENV LD_LIBRARY_PATH="${USD_DIR}/lib:${UFG_SRC}/lib" | ||
ENV PATH="${PATH}:${UFG_INSTALL}/bin" | ||
ENV PYTHONPATH="${PYTHONPATH}:${UFG_INSTALL}/python" | ||
|
||
# Build + install usd_from_gltf | ||
RUN git init && \ | ||
git remote add origin https://github.com/google/usd_from_gltf.git && \ | ||
git fetch --depth 1 origin "${UFG_RELEASE}" && \ | ||
git checkout FETCH_HEAD && \ | ||
python "${UFG_SRC}/tools/ufginstall/ufginstall.py" -v "${UFG_INSTALL}" "${USD_DIR}" && \ | ||
cp -r "${UFG_SRC}/tools/ufgbatch" "${UFG_INSTALL}/python" && \ | ||
rm -rf "${UFG_SRC}" "${UFG_INSTALL}/build" "${UFG_INSTALL}/src" | ||
|
||
RUN mkdir /usr/app | ||
WORKDIR /usr/app | ||
|
||
# Start the service | ||
ENTRYPOINT ["usd_from_gltf"] | ||
CMD ["usd_from_gltf"] |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
FROM python:2-slim-buster | ||
|
||
WORKDIR /usr/src/usd | ||
|
||
# Configuration | ||
ARG USD_RELEASE="19.11" | ||
ARG USD_INSTALL="/usr/local/usd" | ||
ENV PYTHONPATH="${PYTHONPATH}:${USD_INSTALL}/lib/python" | ||
ENV PATH="${PATH}:${USD_INSTALL}/bin" | ||
|
||
# Dependencies | ||
RUN apt-get -qq update && apt-get install -y --no-install-recommends \ | ||
git build-essential cmake nasm \ | ||
libglew-dev libxrandr-dev libxcursor-dev libxinerama-dev libxi-dev zlib1g-dev && \ | ||
rm -rf /var/lib/apt/lists/* | ||
|
||
# Build + install USD | ||
RUN git clone --branch "v${USD_RELEASE}" --depth 1 https://github.com/PixarAnimationStudios/USD.git /usr/src/usd | ||
RUN python ./build_scripts/build_usd.py -v --no-usdview "${USD_INSTALL}" && \ | ||
rm -rf "${USD_REPO}" "${USD_INSTALL}/build" "${USD_INSTALL}/src" | ||
|
||
# Share the volume that we have built to | ||
VOLUME ["/usr/local/usd"] |