PixarAnimationStudios / OpenUSD

Universal Scene Description
http://www.openusd.org
Other
5.95k stars 1.18k forks source link

Conversion gets an USDZ without textures #643

Open ghost opened 5 years ago

ghost commented 5 years ago

Description of Issue

I first installed USD on a Debian distribution on AWS and I was able to convert my model to a USDZ model. But now I'm trying to do the same on an Amazon Linux 2 distribution and I can convert my model to a USDZ but it loses all the textures.

I might be missing something basic here. Any idea where I should start looking?

Steps to Reproduce

  1. Instal a basic AWS EC2 instance
  2. Execute this commands
sudo -i

echo 'export PATH="$PATH:/usr/local/bin"' >> ~/.bashrc
echo 'export PATH="$PATH:/usr/local/USD/bin"' >> ~/.bashrc
echo 'export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/usr/local/lib"' >> ~/.bashrc
echo 'export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/usr/local/USD/lib"' >> ~/.bashrc
echo 'export PYTHONPATH="/usr/local/USD/lib/python"' >> ~/.bashrc
source ~/.bashrc

# Dependencies
yum update
yum remove cmake
yum install git tree python-pip automake autoconf gcc-c++ zlib-devel qt-devel
# yum install libtiff-devel libpng-devel libjpeg-devel
# yum install libxml2-devel libxslt-devel qt-devel
# yum install gettext-devel gettext  gettext-libs flex-devel flex  bison-devel bison

# Download git sources
git clone https://github.com/glfw/glfw.git /usr/local/src/glfw
git clone https://github.com/PixarAnimationStudios/USD /usr/local/src/USD
git clone https://github.com/kcoley/gltf2usd.git /usr/local/gltf2usd

# gltf2usd
cd /usr/local/gltf2usd/ && pip install -r requirements.txt

# cmake 3.12.3
cd /usr/local/ && wget https://cmake.org/files/v3.12/cmake-3.12.3.tar.gz
tar -xvzf cmake-3.12.3.tar.gz && rm -rf cmake-3.12.3.tar.gz
cd /usr/local/cmake-3.12.3
./bootstrap
make
make install

# GLFW (for Imaging and USD Imaging)
cd /usr/local/src/glfw && mkdir build && cd build
cmake ..
cmake --build .
cmake --build . --target install

# Python dependencies
pip install pyopengl
pip install pyside

# USD
# add: `include <functional>` to: /usr/local/src/USD/pxr/imaging/lib/hd/renderThread.h
python /usr/local/src/USD/build_scripts/build_usd.py /usr/local/USD --python --ptex --openimageio

# Set workspaces
su ec2-user
mkdir  ~/workspace

# TEST
export REMOTE_SERVER="ec2-user@xxx.compute-1.amazonaws.com"                  # local
scp -i ~/.ssh/id_sayduck ~/samples/urag.zip $REMOTE_SERVER:~/workspace/                   # local
unzip ~/workspace/urag.zip -d ~/workspace/urag && cd ~/workspace/urag
python /usr/local/gltf2usd/Source/gltf2usd.py -g ./zzz-variant.gltf -o ./usdz/urag.usdz
scp -i ~/.ssh/id_sayduck $REMOTE_SERVER:~/workspace/urag/usdz/urag.usdz ~/samples/        # local

System Information (OS, Hardware)

jtran56 commented 5 years ago

Filed as internal issue #USD-4808.

ghost commented 5 years ago

Check this issue on gltf2usd repo for reference.

IT was due to the fact the paths where relative and not absolute.