如何再次从ZIP文件生成USDZ文件?

时间:2019-04-05 22:38:27

标签: scenekit augmented-reality arkit usdz

大家好,我正在尝试解压缩USDZ文件,修改纹理,然后再次压缩USDZ文件,但是会中断。

有什么特殊的方法可以将文件压缩回去吗?即使我再次解压缩,它也会停止工作并具有不同的文件大小。

我不使用压缩和加密来压缩文件。我注意到的一件事是,USDZ文件的“需要提取”属性为“ 2.0或更高版本”,而我的新zip文件值为“ 1.0或更高版本”。另外,原始USDZ压缩文件中的文件还有一些我无法读取或添加到新文件中的额外字段。

可能会发生什么?任何帮助将不胜感激。

2 个答案:

答案 0 :(得分:2)

第一步(解压缩usdz文件)

  

要在macOS Mojave中解压缩usdz文件,请使用以下方法(或者,如果您没有Mac,请使用Hackintosh):

  • 在Finder中,将.usdz文件的扩展名更改为.zip
  • 使用.zipArchive_Utility.app解压缩RAR_Extractor.app文件。
  • 打开未压缩的目录并更改模型的.png纹理。

enter image description here

第二步(再次创建usdz

确保已安装Xcode 10.2。

  

要将解压缩的文件夹的内容(二进制usdc文件及其纹理)再次转换为usdz文件格式,请在Terminal.app中使用以下命令:

cd ~/Desktop/Gramophone_Directory/


xcrun usdz_converter Gramophone.usdc Gramophone.usdz 
-g GramophoneMesh
-color_map Gramophone_Albedo.png
-metallic_map Gramophone_Metallic.png
-roughness_map Gramophone_Roughness.png
-normal_map Gramophone_Normal.png
-ao_map Gramophone_AO.png

这是选项的完整列表(在终端中输入 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

enter image description here

希望这会有所帮助。

答案 1 :(得分:-1)

要打包修改后的USDZ文件,我使用了此处提供的工具:https://github.com/PixarAnimationStudios/USD(usdzip),该工具可在Windows和Linux中使用。