如何创建文件 USDZ 使用转换器 Xcode?

在会议上 WWDC 2018 当年 Apple 宣布引入新的文件格式 USDZ.

https://developer.apple.com/vi ... /603/
/

与文件的创建有关 USDZ 据说:

创建自己的文件 usdz, usdz_converter 包含在Beta版本中 Xcode 10. 这是创建文件的命令行工具。 usdz 来自文件 OBJ, 单帧蒸馏立方体 /ABC/, 文件 USD /或者 .usda, 或者 usd.c/

主要命令行是


xcrun usdz_converter myFile.obj myFile.usdz


我安装了一个beta版本 Xcode 10, 但无法跑步甚至找到 usdz_converter 在beta. Xcode 10 bundle, 可用的 4 六月 2018 当年 /部件 10L176w/.

注意:我还在努力 macOS highSierra, 我没有安装 macOS Mojave 10.14 beta... 但我认为这应该是原因。

别人能够强迫这一点 xcrun usdz_converter 工作?

如果是这样,请分享您的步骤。
已邀请:

裸奔

赞同来自:

更新日期: 20 八月 2020

当年 .


Export

队伍在现实作曲家 1.5 为了 Xcode 12



macOS 11 大苏尔



现实作曲家 1.5

为了

Xcode 12

现在您可以导出模型
usdz

右侧 UI 作曲家的现实。 为此,您只需激活导出 USDZ 在菜单上 RealityComposer –

Preferences

.

https://i.stack.imgur.com/DLK9z.jpg


usdzconvert

命令 Xcode 11



macOS 10.15 Catalina



Xcode 11


USDZ converter

它具有丰富的一组命令,并支持比以前版本的转换更多的输入格式。 但是在使用它之前,您需要下载
https://developer.apple.com/au ... look/
. 并且不要忘记配置

全局变量

对于仪器 Python usdz. 这是一个新团队的样子

Terminal

:


usdzconvert ~/Desktop/file.gltf -diffuseColor albedo.png -metallic brass.jpg


在 macOS Catalina 默认shell命令是

ZSH

.

所以,如果你想使用

工具

USDPython

, 您需要创建资源文件 Shell
.zshrc

使用以下命令 Terminal:


touch ~/.zshrc


然后,您必须使用以下方式打开此文件:


open ~/.zshrc


现在,您可以将这些行添加到资源文件中。 zsh:


export PATH="/Users/yourUserName/usdpython/USD:$PATH"
export PATH="/Users/yourUserName/usdpython/usdzconvert:$PATH"
export PYTHONPATH="/Users/yourUserName/usdpython/USD/lib/python:$PYTHONPATH"

echo "Now I can use USDPython commands here."


保存并重新启动 Terminal.


usdzconvert

- 这个脚本 Python, 这转换了以下资产
usdz

:

关于。

gltf

在 FBX

ABC.

美国农业部

USD C

美元

如果您需要使用格式转换
FBX

, 您必须下载并安装
https://www.autodesk.com/devel ... 020-0
.

然后添加到文件
.zshrc

另一条线:


export PYTHONPATH="/Applications/Autodesk/FBXPythonSDK/2020.0.1/lib/Python27_ub:$PYTHONPATH"


保存文件
.zshrc

并重启 Terminal.

以下是您可以看到的完整选项列表 Terminal, 得分

usdzconvert -h


:


# DON'T USE usdzconvert 0.63 BECAUSE IT CAUSES ERRORS.

# DO USE usdzconvert 0.62
# or
# DO USE usdzconvert 0.64

outputFile Output .usd/usda/usdc/usdz files.
-h, --help Show this help message and exit.
-f <file> Read arguments from <file>
-v Verbose output.
-url <url> Add URL metadata
-copyright "copyright message" Add copyright metadata
-copytextures Copy texture files /for .usd/usda/usdc/ workflows
-metersPerUnit value Set metersPerUnit attribute with float value
-loop Set animation loop flag to 1
-no-loop Set animation loop flag to 0
-m materialName Subsequent material arguments apply to this material.
-iOS12 Make output file compatible with iOS 12 frameworks
-texCoordSet name The name of the texture coordinates to use for current material.

-diffuseColor r,g,b Set diffuseColor to constant color r,g,b with values in the range [0 .. 1]
-diffuseColor <file> fr,fg,fb Use <file> as texture for diffuseColor.
fr,fg,fb: /optional/ constant fallback color, with values in the range [0..1].

-normal x,y,z Set normal to constant value x,y,z in tangent space [/-1, -1, -1/, /1, 1, 1/].
-normal <file> fx,fy,fz Use <file> as texture for normal.
fx,fy,fz: /optional/ constant fallback value, with values in the range [-1..1].

-emissiveColor r,g,b Set emissiveColor to constant color r,g,b with values in the range [0..1]
-emissiveColor <file> fr,fg,fb Use <file> as texture for emissiveColor.
fr,fg,fb: /optional/ constant fallback color, with values in the range [0..1].

-metallic c Set metallic to constant c, in the range [0..1]
-metallic ch <file> fc Use <file> as texture for metallic.
ch: /optional/ texture color channel /r, g, b or a/.
fc: /optional/ fallback constant in the range [0..1]

-roughness c Set roughness to constant c, in the range [0..1]
-roughness ch <file> fc Use <file> as texture for roughness.
ch: /optional/ texture color channel /r, g, b or a/.
fc: /optional/ fallback constant in the range [0..1]

-occlusion c Set occlusion to constant c, in the range [0..1]
-occlusion ch <file> fc Use <file> as texture for occlusion.
ch: /optional/ texture color channel /r, g, b or a/.
fc: /optional/ fallback constant in the range [0..1]

-opacity c Set opacity to constant c, in the range [0..1]
-opacity ch <file> fc Use <file> as texture for opacity.
ch: /optional/ texture color channel /r, g, b or a/.
fc: /optional/ fallback constant in the range [0..1]

-clearcoat c Set clearcoat to constant c, in the range [0..1]
-clearcoat ch <file> fc Use <file> as texture for clearcoat.
ch: /optional/ texture color channel /r, g, b or a/.
fc: /optional/ fallback constant in the range [0..1]

-clearcoatRoughness c Set clearcoat roughness to constant c, in the range [0..1]
-clearcoatRoughness ch <file> fc Use <file> as texture for clearcoat roughness.
ch: /optional/ texture color channel /r, g, b or a/.
fc: /optional/ fallback constant in the range [0..1]



或者,而不是使用命令行转换工具 /CLI/, 您可以使用该应用程序
https://developer.apple.com/news/?id=01132020a
/GUI/. 新应用程序使其易于转换,查看和配置对象。
.usdz

在 Mac. 只是 drag-and-drop 常用文件格式 3D, 如那个
.obj

,
.gltf


.usd

, 查看转换结果
.usdz

, 使用自己的纹理配置材料的属性并编辑文件元数据。 您甚至可以查看您的对象
.usdz

在不同的照明和环境条件下使用内置选项 IBL.


团队
xcrun usdz_converter

为了 Xcode 10



macOS 10.14 Mojave



Xcode 10


USDZ converter

它具有略微不同的参数和标志。 这是旧团队的样子 Terminal



:


xcrun usdz_converter file.obj file.usdz -color_map color.jpg -ao_map ao.png


在 macOS Mojave 默认shell命令是

BASH

.

以下是您可以看到的完整选项列表 Terminal, 得分

xcrun usdz_converter -h


:


-g groupName [groupNames ...] Apply subsequent material properties to the named group/s/.
-m materialName [materialNames ...] Apply subsequent material properties to the named material/s/.
-h Display help.
-a Generate a .usda intermediate file. Default is .usdc.
-l Leave the intermediate .usd file in the source folder.
-v Verbose output.
-f filePath Read commands from a file.
-texCoordSet set The name of the texturemap coordinate set to use if multiple exist /no quotes/.
-opacity o Floating point value 0.0...1.0

-color_default r g b a Floating point values 0.0...1.0
-normal_default r g b a Floating point values 0.0...1.0
-emissive_default r g b a Floating point values 0.0...1.0
-metallic_default r g b a Floating point values 0.0...1.0
-roughness_default r g b a Floating point values 0.0...1.0
-ao_default r g b a Floating point values 0.0...1.0

-color_map filePath
-normal_map filePath
-emissive_map filePath
-metallic_map filePath
-roughness_map filePath
-ao_map filePath


</file></file></file></file></file></file></file></file></file></file></file></file></file></file></file></file></file></file></url></file></file>

知食

赞同来自:

您必须启用命令行工具。 Xcode 10 在

Xcode > Preferences > Locations

卫东

赞同来自:

您必须在设置中激活命令行工具。 Xcode, 如果他们尚未激活 /这是我的案子/. 请参阅此主题:

https://coderoad.ru/50686813/

要回复问题请先登录注册