我们的 USDZ 文件无法在装有 iOS 12 的 iPhone 7 上加载。它在运行 iOS 12 Beta 的我的 iPhone X 和 iPad Pro 上运行良好。
我们已尝试使用终端命令创建它并收到以下警告,但我们认为这不是问题所在。
Warning: in CreateMaterialBindings at line 59 of /BuildRoot/Library/Caches/com.apple.xbs/Sources/3DAssetTools/3DAssetTools-14207.2/external/ModelKit/extern/usd/pxr/usd/usdObj/translator.cpp -- OBJ mtl usemtl name has invalid name '15___Default', using default usemtl name: 'defaultShadeGroup0'
iPhone 7 的屏幕看起来是这样的:
您可以下载原始文件here .
最佳答案
You can't see your 3D model because you're using very bad naming convention for file
model2_$$usd_converter$$_.usdc
insideusdz
container. In macOS and iOS you have to avoid using$
in file names, because dollar sign is a special character.
按照这两个步骤解压缩、重命名和重新压缩您的 usdz
文件。
第一步(解压mmtest.usdz
文件)
To unzip a
usdz
file in macOS Mojave use the following method:
- 在 Finder 中将
.usdz
文件的扩展名更改为.zip
。 - 使用
Archive_Utility.app
或RAR_Extractor.app
解压缩.zip
文件。 - 打开解压缩的目录并更改文件名。
- 确保所有纹理都是
JPG
和/或PNG
格式。 - 确保您的
USDC
模型的 3D 法线没有反转。
第二步(重新创建usdz
)
确保已安装 Xcode 10.2。
To convert a content of unzipped folder (binary
usdc
file and its textures) tousdz
file format again, use the following command inTerminal.app
:
cd ~/Desktop/mmtest/
xcrun usdz_converter Model.usdc Model.usdz
-g SofaMesh
-color_map Diffuse.jpg
-roughness_map Roughness.png
-normal_map Normal.jpg
这里是选项的完整列表(在终端中输入 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
现在模型完美运行。
关于xcode - USDZ 文件未在 iPhone 7 上加载,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53345279/