Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Model ends up without texture #68

Closed
ghost opened this issue Oct 7, 2018 · 13 comments
Closed

Model ends up without texture #68

ghost opened this issue Oct 7, 2018 · 13 comments

Comments

@ghost
Copy link

ghost commented Oct 7, 2018

I'm trying to get a GLTF converted in USDZ but somehow, my model ends up without any texture. When I uncompress the .usdz the texture file is in there.

For some context, I installed last week USD by Pixar and gltf2usd on a Debian on AWS EC2. It worked, I was able to export and get a nice looking USDZ.

Then I proceed to do the same again but on an Amazon Linux 2 on AWS EC2 and after some first tests, I see the USDZ doesn't display its texture. I taught it was because of some library compatibility or such kind of problem so I keep digging but now when I resolve myself to go back to use Debian I try again to convert the same GLTF and I get the same without texture model.

I wonder if this could come grom gltf2usd? Is there something obvious I'm missing here?

@ghost
Copy link
Author

ghost commented Oct 7, 2018

@kcoley
Copy link
Owner

kcoley commented Oct 7, 2018

Hi @sayduck-daniel . This is definitely odd. I am also seeing all files and references working when opening the usdz file. I also locally converted the original glTF and it looks to work as expected. Are you converting to usdz with usdzip or are you using gltf2usd to do this directly?

Also are you on the lastest master of gltf2usd and on Pixar's USD?

@ghost
Copy link
Author

ghost commented Oct 7, 2018

ok... I understand what is the problem...

It was no need for me to build 30h of source code for libraries needed by USD or for me to have to compile from source LLVM or CLANG.

The problem comes from how I call gltf2usd.

Initially, I was doing it with a full path:

python /usr/local/gltf2usd/Source/gltf2usd.py -g ~/workspace/variant.gltf -o ~/workspace/variant.usdz

Then when I switch from Debian to Amazon Linux 2 on EC2, while installing stuff I simplify my script to do instead:

cd  ~/workspace/
python /usr/local/gltf2usd/Source/gltf2usd.py -g ./variant.gltf -o ./variant.usdz

So long story short, I just spent 80h in total for nothing 👍

Relative paths, is it something on your side or USD side? I can open an issue on their repo if needed.

@kcoley
Copy link
Owner

kcoley commented Oct 7, 2018

Ah that makes sense. I think the relative paths would probably have to be handled within this tool. Feel free to file and issue here or make a PR if you think it’s a quick fix!

@ghost
Copy link
Author

ghost commented Oct 7, 2018

Could you add this to the README file? Just in case someone else false in this trap.

@ghost ghost closed this as completed Oct 7, 2018
@kcoley
Copy link
Owner

kcoley commented Oct 7, 2018

@sayduck-daniel actually I had a thought. The converter was able to transfer the textures so the issue may actually be with usdzip. I’ll try to reproduce when I get some time. But I’ll make a note to update the readme

@kcoley
Copy link
Owner

kcoley commented Oct 15, 2018

@sayduck-daniel I just merged a change to support relative paths in the generated usdz file. I basically change to the directory of the usdc file and switch all paths to relative so CreateNewUsdzPackage works as expected. Feel free to give this a try.

@ghost
Copy link
Author

ghost commented Oct 16, 2018

Thanks, I'm gonna try o^when we next deploy the latest of USD and your code. I let you know ASAP

@MrDChristop
Copy link

MrDChristop commented Oct 19, 2018

Usdzip can not handle relative paths, i already filed a report on USD forum
https://groups.google.com/forum/#!topic/usd-interest/jos8g0t8w00

I am not sure if gltf2usd should fix this with a workaround.
I also do this manually in my code, change to the directory of where the usd has to be created.

@MrDChristop
Copy link

MrDChristop commented Oct 19, 2018

this line which used to work now fails
gltf2usd.py -g sdf_vray_utf8.gltf -o das.usdz

Traceback (most recent call last):
  File "C:\Users\d_chr\Downloads\gltf2usd-master\Source\gltf2usd.py", line 742, in <module>
    convert_to_usd(os.path.expanduser(args.gltf_file), os.path.expanduser(args.usd_file), args.fps, args.scale, args.arkit, args.verbose, args.use_euler_rotation)
  File "C:\Users\d_chr\Downloads\gltf2usd-master\Source\gltf2usd.py", line 707, in convert_to_usd
    os.chdir(os.path.dirname(usdc_file))
WindowsError: [Error 123] The filename, directory name, or volume label syntax is incorrect: ''

This line has to be given now in the latest version instead
gltf2usd.py -g sdf_vray_utf8.gltf -o ./das.usdz

So you must specify a directory now....

@kcoley
Copy link
Owner

kcoley commented Oct 21, 2018

@MrDChristop thanks for flagging the issue. I made a recent change that converts the usd file path to absolute path for now.

@MrDChristop
Copy link

Hi. Where is the commit for this?

@kcoley
Copy link
Owner

kcoley commented Oct 22, 2018

@MrDChristop the commit is here at the bottom of gltf2usd.py: https://github.com/kcoley/gltf2usd/pull/83/files

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants