How to create USDZ file using Xcode converter?

偶尔善良 提交于 2019-11-27 01:59:25

问题


At the 2018 WWDC Apple annouced the introduction of new USDZ file format.

https://developer.apple.com/videos/play/wwdc2018/603/

In relation to creating USDZ file the following was said:

To create your own usdz files, a usdz_converter has been bundled as part of Xcode 10 beta. Its a command line tool for creating the usdz file from OBJ files, Single-frame Alembic (ABC) files, USD file (either .usda or usd.c)

the basic command line is

xcrun usdz_converter myFile.obj myFile.usdz

I have installed Xcode 10 beta, but have been unable to run or even find usdz_converter in the Xcode 10 beta bundle made available on the 4th June 2018 (build 10L176w).

note: I’m still running on macOS highSierra, I have not installed macOS Mojave 10.14 beta yet... but didn’t think that should be the reason why.

Has anyone else been able to get this xcrun usdz_converter to work?

If so please share the steps.


回答1:


You have to enable the Xcode 10 command line tools on Xcode>Preferences>Locations

Example




回答2:


usdzconvert command for Xcode 11

In macOS 10.15 Catalina and Xcode 11 USDZ converter has a rich set of commands and supports more input formats for conversion than previous version. But before using it you need to download usdz Tools. And don't forget to setup a global variables for Python usdz tools. Here's how a new command looks like in Terminal:

usdzconvert myFile.gltf -diffuseColor albedo.png -metallic brass.jpg
  • In macOS Catalina the default command shell is ZSH.

So, if you want to use USDPython tools you need to create a Shell Resource file .zshrc using the following Terminal command:

touch ~/.zshrc

Then you have to open this file using:

open ~/.zshrc

After all you can add these lines in it:

export PATH=$PATH:/Users/yourUserName/USDPython/USD
export PYTHONPATH=$PYTHONPATH:/Users/yourUserName/USDPython/USD

echo "Now I can use USDPython commands here."

Save it and restart Terminal.

xcrun usdz_converter command for Xcode 10

In macOS 10.14 Mojave and Xcode 10 USDZ converter has a slightly different set of arguments and flags. Here's how an old command looks like in Terminal:

xcrun usdz_converter file.obj file.usdz -color_map color.jpg -ao_map ao.png
  • In macOS Mojave the default command shell is BASH.



回答3:


You have to activate the command line tools in Xcode preferences, in case they're not actived yet (that was my case). See this topic:

How to create a USDZ file?



来源:https://stackoverflow.com/questions/50846627/how-to-create-usdz-file-using-xcode-converter

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!