Git Product home page Git Product logo

usd_from_gltf's Introduction

USD from glTF

Library, command-line tool, and import plugin for converting glTF models to [USD] (https://graphics.pixar.com/usd/docs/index.html) formatted assets for display in AR Quick Look.

Please note that this is not an officially supported Google product.

This is a C++ native library that serves as an alternative to existing scripted solutions. Its main benefits are improved compatibility with iOS and conversion speed (see Compatibility and Performance). It is treating USDZ as a transmission format rather than an interchange format. For more information about transmission and interchange file formats see here.

TLDR: Install it, then convert with: usd_from_gltf <source.gltf> <destination.usdz>

Background

glTF is a transmission format for 3D assets that is well suited to the web and mobile devices by removing data that is not important for efficient display of assets. USD is an interchange format that can be used for file editing in Digital Content Creation tools (ie. Maya).

However, iOS Quick Look supports displaying USDZ files with a subset of the USD file specification. This tool converts glTF files to USDZ for display in Quick Look, attempting to emulate as much of glTF’s functionality as possible in iOS Quick Look runtime.

The emulation process is lossy. For example, to support double sided glTF materials, the geometry is doubled. This allows the converted glTF to display correctly on iOS, but importing back into a DCC application will not be the same data as the original source file.

This tool specifically addresses the use case of converting a file from glTF->USDZ->QuickLook. Going DCC->glTF optimizes the asset for runtime viewing, and may lose information if the converted USDZ is imported back in the DCC tool, like subdivision surfaces.

When converting glTF->USD->DCC, Apple's USDPython tools will better preserve the data in the glTF file at the cost of not having the same compatibility with existing versions of iOS Quick Look.

Installation Steps

  • Download and build USD. See the associated README for prerequisites and build steps. Refer to USD installation directory as {USD}.

  • Install NASM.

    • (Linux) sudo apt-get install nasm
    • (OSX) brew install nasm (requires Homebrew)
    • (Windows) Use the installer for the latest stable release.
  • Install PIL.

    • pip install Pillow
  • Download usd_from_gltf source to {UFG_SRC}.

  • Install to {UFG_BUILD} (with optional test data):

    python {UFG_SRC}/tools/ufginstall/ufginstall.py {UFG_BUILD} {USD} --testdata
    
  • (Linux/OSX) Set LD_LIBRARY_PATH to the USD and usd_from_gltf lib directories. See ufginstall script output for the paths.

  • (Optional) Add executable to PATH. See ufginstall script output for the exe path.

  • (Optional) Build test data. See ufginstall script output for the ufgtest.py command.

  • (Optional) Set PXR_PLUGINPATH_NAME so the glTF import plugin is available in Usdview. See ufginstall script output for the path.

Using the Command-Line Tool

The command-line tool is called usd_from_gltf and is in the {UFG_BUILD}/bin directory. Run it with (use --help for full documentation):

usd_from_gltf <source.gltf> <destination.usdz>

Batch Converting and Testing

The library contains {UFG_SRC}/tools/ufgbatch/ufgbatch.py to facilitate batch conversion. Run it with (use --help for full documentation):

python {UFG_SRC}/tools/ufgbatch/ufgbatch.py my_tests.csv --exe "{UFG_BUILD}/bin/usd_from_gltf"

Each input CSV contains a list of conversion tasks of the form:

name,path/to/input.gltf,dir/to/output/usd[, optional usd_from_gltf flags]

The library also contains {UFG_SRC}/tools/ufgbatch/ufgtest.py to facilitate testing, and preview deployment. Run it with (use --help for full documentation):

python {UFG_SRC}/tools/ufgbatch/ufgtest.py my_tests.csv --exe "{UFG_BUILD}/bin/usd_from_gltf"

For development and testing, the ufgtest.py has a couple additional features:

  • Golden file diffs. After a build completes, the tool compares built files against files in a known-good 'golden' directory. This is useful for determining if changes to the library affect generated data. This can be disabled with --nodiff.
  • Preview web site deployment. This copies changed USDZ files (different from golden) to a directory and generates an index.html to view the listing in a browser, compatible with QuickLook on iOS. This can be disabled with --nodeploy.

Using the Library

The converter can be linked with other applications using the libraries in {UFG_BUILD}/lib/ufg. Call ufg::ConvertGltfToUsd to convert a glTF file to USD.

Using the Import Plugin

The plugin isn't necessary for conversion, but it's useful for previewing glTF files in UsdView.

To use it, set the PXR_PLUGINPATH_NAME environment variable to the directory containing plugInfo.json. See ufginstall script output for the path.

Compatibility

While USD is a general-purpose format, this library focuses on compatibility with AR Quick Look. The AR Quick Look renderer only supports a subset of the glTF 2.0 specification though, so there are several limitations. Where reasonable, missing features are emulated in an effort to reproduce glTF files as faithfully as possible on iOS. The emulation can be lossy process and the output is not well suited as an interchange format.

Key Features

Emulated Functionality for AR Quick Look

Several rendering features of glTF are not currently supported in AR Quick Look, but they are emulated where reasonable. The emulated features are:

  • Texture channel references. USD supports this, but currently AR Quick Look requires distinct textures for the roughness, metallic, and occlusion channels. The converter splits channels into separate textures and recompresses them as necessary.
  • Texture color scale and offset. These are emulated by baking the scale and offset into the texture. This potentially increases the output size if a texture is referenced multiple times with different settings.
  • Texture UV transforms. These are emulated by baking transforms into vertex UVs. Note that because they are baked into the single UV set for the model, so different textures can't use different transformations on the same mesh.
  • Specular workflow. Currently AR Quick Look does not support this. The converter with generate metallic+roughness textures as an approximation.
  • Arbitrary asset sizes. AR Quick Look has some limit (empirically, around 200MB) to the decompressed size, and will fail to load models larger than this. The converter works around this by globally resizing textures to fit within the configured limit.
  • Unlit materials. The converter emulates these with a pure emissive material. This mostly works, but there are some differences due a rim light factor in the AR Quick Look renderer.
  • sRGB emissive texture. AR Quick Look incorrectly treats the emissive texture as linear rather than sRGB, so the converter works around this by converting to linear.
  • Alpha cutoff. The converter works around this by baking alpha values to 0 or 1 for alpha cutoff materials. This will increase the output size if the texture is referenced by materials with different cutoff state. Also, due to the lack of transparency sorting, alpha cutoff materials may exhibit sorting errors.
  • Double-sided geometry. The converter works around this by duplicating geometry.
  • Normal-map normalization. AR Quick Look does not normalize normal-map normals, causing incorrect lighting for some textures. The converter explicitly renormalizes normal-map textures to work around this.
  • Inverted transforms. AR Quick Look will incorrectly face-cull for inverted geometry, so the converter works around this by baking the reversed polygon winding into the mesh where necessary.
  • Quaternion-based rigid animation. This is not supported in iOS 12. The converter works around this by converting to Euler, which may suffer from Gimbal lock issues. To reduce error, the converter bakes Euler keys at a higher frequency, which can increase animation size.
  • Spherical linear (slerp) interpolation for rotations. All interpolation is linear, so blends between matrix or quaternion keys are incorrect and can induce scale changes. The converter works around this by converting to Euler for rigid animation, and by baking quaternion keys at higher frequency for skinned animation.
  • Per-joint animation channels. Skinning does not make use of independent animation channels, so the converter expands source channels to a grid of (joints * keys) elements. Animations will be significantly larger than their glTF source for complex skeletons.
  • Multiple skeletons. AR Quick Look only supports a single skeleton, so the converter emulates this by merging multiple skeletons into one (at some cost to animation size).
  • Step and cubic animation interpolation modes. The converter emulates these by baking them to linear (again, at a cost of animation size).
  • Vertex quantization/compression. All vertex components are converted to full float precision, and Draco-compressed meshes are decompressed.

Features Unsupported by AR Quick Look

These features are not supported in AR Quick Look, and cannot be reasonably supported by the converter.

  • Vertex colors.
  • Morph targets and vertex animation.
  • Texture filter modes. All textures are sampled linearly, with mipmapping.
  • Clamp and mirror texture wrap modes. All textures use repeat mode.
  • Cameras.
  • Shadow animation. Shadows are generated from the first frame.
  • Transparent shadows. This is particularly noticable for transparent geometry near the ground, which will appear very dark due to shadow falloff.
  • Multiple UV sets. The converter works around this by disabling textures using secondary UV sets, which works best for the most common-use case: AO.
  • Multiple animations. The converter just exports a single animation.
  • Multiple scenes. The converter just exports a single scene.
  • Transparency sorting. Overlapping transparent surfaces are likely to look incorrect.
  • Skinned animation for vertex normals. Lighting will look incorrect for skinned models, which is especially noticeable for highly reflective surfaces (it will have a painted-on appearance). The converter attempts to mitigate this by baking normals to the first frame of animation, but it will still look incorrect.

Rendering Differences Between glTF and AR Quick Look

The AR Quick Look renderer does not precisely match the rendering model described by the glTF spec, but it is reasonably close. There are a few exceptions:

  • Occlusion (AO) is applied to the output color rather than ambient, so shadowed areas look a lot darker than in glTF. In some cases, this can cause the model to show up completely black, so the converter works around this by disabling all-black occlusion.
  • Transparent areas appear dark and washed-out, seemingly due to misapplication of premultiplied alpha.
  • Z-fighting with shadow geometry at zero height.

Potential solutions to unsupported issues

  • Cameras, vertex animation, and vertex colors are supported by the USD spec but not currently by AR Quick Look. These should be added in the interest of completeness and future-proofing.
  • Emulate texture mirror wrap mode by mirroring the texture. This is simple, but can increase texture size up to 4x.
  • Emulate texture clamp wrap mode by clipping UVs. This involves relatively complicated clipping, but should not have a significant impact on model size.
  • Emulate vertex colors by baking them into the texture. This is difficult to do generally because it may involve re-uv-mapping the model - something better left to content authors. It can be simplified for certain special cases, though (e.g. untextured models with only vertex colors can use a simple color atlas).
  • Combine multiple UV sets. This is difficult to do because it requires re-uv-mapping the model - something better left to content authors.

Performance

usd_from_gltf is roughly 10-15x faster than current alternatives.

The bulk of the conversion time is spent in image processing and recompression, necessary for emulating otherwise unsupported functionality in AR Quick Look.

Primary Optimizations

  • Implemented in native C++.
  • Supports multi-process model conversion through the ufgbatch.py script.
  • Can generate both USDA and USDZ files in a single pass.

Benchmarks

Each benchmark was run 3 times on a Xeon E5-1650 @ 3.50GHz with 6 cores, 2x hyperthreaded for 12 hardware threads.

Converting 55 glTF sample models to USDZ:

  • usd_from_gltf, 1 process: 20.1, 19.9, 19.9 (average: 20 seconds)
  • usd_from_gltf, 12 processes: 6.9, 6.9, 6.7 (average: 6.8 seconds)

Converting 28 complex skinned and animated glTF models to USDZ:

  • usd_from_gltf, 1 process: 22.6, 22.5, 22.6 (average: 22.6 seconds)
  • usd_from_gltf, 12 processes: 5.0, 5.3, 5.1 (average: 5.2 seconds)

Troubleshooting

If you are having trouble building or running usd_from_gltf, please follow the steps below.

  • Ensure that the environment variables were set correctly after installing USD.
  • Add the Zlib libraries to your PATH.

usd_from_gltf's People

Contributors

c0ded00d avatar hujasonx avatar jason-cooke avatar jesteele-g avatar tylindberg avatar usdfromgltf-bot avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

usd_from_gltf's Issues

Improved commit messages

👋Truly amazing and useful tool y'all built.

you're awesome

Moving forward, can we have more descriptive commit messages?

Most of the commits on the master branch are Internal change or just generally not representative of what the commit relates to.

It would be awesome to have a bit more context as to why you're making a change instead of having to read through the diff and guess.

Thanks!

Segmentation fault when trying to convert

Platform: Amazon Linux
USD version: USD 20.02
Example files

I have provided 2 gltf files, which are at some point converted to .glb and then to .usdz using usd_from_gltf. I Also provided the converted glbs. It's worth noting that the gltfs are draco compressed.

The files are identical except that TEXCOORD_0 and TEXCOORD_1 values have been removed from the attributes under primitives and also from attributes under extensions.KHR_draco_mesh_compression in one of the files.

To reproduce, simply convert the file that keeps TEXCOORD values (broken.glb) to usdz.

Screenshot 2021-03-12 at 10 13 33

The glTF Validator claims that both the non-working and working files are valid and glTF viewer display the models without any issue.

Any ideas why this might happen?

i am getting 'std::map': too few template arguments error while compiling on windows

i am getting 'std::map': too few template arguments error while compiling on windows

..\process/mesh.h(57,25): error C2976: 'std::map': too few template arguments [..\build\usd_from_gltf\process\process.vcxproj]
..\include\boost-1_70\boost/detail/container_fwd.hpp(136): message : see declaration of 'std::map' [..\process\process.vcxproj]

Option for skipping Python linking in build

I noticed that commit 2a5f940 seems to have rolled back the changes in #26. I assume this was because it broke builds on one of the platforms.

In order to still include the ability to not link against the Python libraries, I'm thinking that adding a build arg, something like --no-python, would be a good solution. This would allow usd_from_gltf to still be run in environments that don't have access to Python libraries.

Let me know your thoughts.

Broken normals on Skinned Meshes

Hi there,

I'm trying to convert some GLTF models to USDZ but am discovering that many skinned meshes will have incorrect normals after transformation. I am aware that this converter attempts to correct problems with Apple's QuickView by baking/fixing normals when the associated mesh is skinned, but toggling those options does not seem to make any difference in this case.

What's strange is that this is not always the case? For instance, the following official sample GLTF file fails to convert properly:
https://github.com/KhronosGroup/glTF-Sample-Models/tree/master/2.0/RiggedFigure

But this older 2.0 model from Blender converts just fine:
https://github.com/KhronosGroup/glTF-Blender-Exporter/tree/master/polly

(The exception is that the local transforms for the eyes are ignored, but I think that's actually how the specifications treat it?)

Here's the output for the RiggedFigure.gltf after conversion:
with_skin

And here's the output after removing the skin:
without_skin

I have not been able to figure out why some GLTF will produce skinned models with proper normals without problems while others will not.

Installation fails with undefined reference

On Ubuntu 16.04, USD and all other dependencies installed successfully but i'm getting the following:

cmake /home/julien/usd_from_gltf -DCMAKE_INSTALL_PREFIX=/usr/local/usd_from_gltf -DCMAKE_PREFIX_PATH=/usr/local/usd_from_gltf -DUSD_DIR=/usr/local/USD
-- The C compiler identification is GNU 7.5.0
-- The CXX compiler identification is GNU 7.5.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Configuring done
-- Generating done
-- Build files have been written to: /usr/local/usd_from_gltf/build/usd_from_gltf

cmake --build . --config Release --target install --
Scanning dependencies of target gltf
[  2%] Building CXX object gltf/CMakeFiles/gltf.dir/internal_util.cc.o
[  4%] Building CXX object gltf/CMakeFiles/gltf.dir/load.cc.o
[  7%] Building CXX object gltf/CMakeFiles/gltf.dir/memory_stream.cc.o
[  9%] Building CXX object gltf/CMakeFiles/gltf.dir/message.cc.o
[ 11%] Building CXX object gltf/CMakeFiles/gltf.dir/stream.cc.o
[ 14%] Building CXX object gltf/CMakeFiles/gltf.dir/validate.cc.o
[ 16%] Building CXX object gltf/CMakeFiles/gltf.dir/cache.cc.o
[ 19%] Building CXX object gltf/CMakeFiles/gltf.dir/disk_stream.cc.o
[ 21%] Building CXX object gltf/CMakeFiles/gltf.dir/disk_util.cc.o
[ 23%] Building CXX object gltf/CMakeFiles/gltf.dir/glb_stream.cc.o
[ 26%] Building CXX object gltf/CMakeFiles/gltf.dir/gltf.cc.o
[ 28%] Building CXX object gltf/CMakeFiles/gltf.dir/image_parsing.cc.o
/home/julien/usd_from_gltf/gltf/image_parsing.cc:313:23: warning: multi-character character constant [-Wmultichar]
     if (chunk.type != 'IHDR') {
                       ^~~~~~
[ 30%] Linking CXX static library libgltf.a
[ 30%] Built target gltf
Scanning dependencies of target common
[ 33%] Building CXX object common/CMakeFiles/common.dir/config.cc.o
[ 35%] Building CXX object common/CMakeFiles/common.dir/logging.cc.o
[ 38%] Building CXX object common/CMakeFiles/common.dir/platform.cc.o
[ 40%] Linking CXX static library libcommon.a
[ 40%] Built target common
Scanning dependencies of target process
[ 42%] Building CXX object process/CMakeFiles/process.dir/math.cc.o
[ 45%] Building CXX object process/CMakeFiles/process.dir/mesh.cc.o
[ 47%] Building CXX object process/CMakeFiles/process.dir/process_util.cc.o
[ 50%] Building CXX object process/CMakeFiles/process.dir/skin.cc.o
[ 52%] Building CXX object process/CMakeFiles/process.dir/animation.cc.o
[ 54%] Building CXX object process/CMakeFiles/process.dir/color.cc.o
[ 57%] Building CXX object process/CMakeFiles/process.dir/float_image.cc.o
[ 59%] Building CXX object process/CMakeFiles/process.dir/image.cc.o
[ 61%] Building CXX object process/CMakeFiles/process.dir/image_fallback.cc.o
[ 64%] Building CXX object process/CMakeFiles/process.dir/image_gif.cc.o
[ 66%] Building CXX object process/CMakeFiles/process.dir/image_jpg.cc.o
[ 69%] Building CXX object process/CMakeFiles/process.dir/image_png.cc.o
[ 71%] Linking CXX static library libprocess.a
[ 71%] Built target process
Scanning dependencies of target convert
[ 73%] Building CXX object convert/CMakeFiles/convert.dir/tokens.cc.o
[ 76%] Building CXX object convert/CMakeFiles/convert.dir/convert_util.cc.o
[ 78%] Building CXX object convert/CMakeFiles/convert.dir/converter.cc.o
[ 80%] Building CXX object convert/CMakeFiles/convert.dir/materializer.cc.o
[ 83%] Building CXX object convert/CMakeFiles/convert.dir/package.cc.o
[ 85%] Building CXX object convert/CMakeFiles/convert.dir/texturator.cc.o
[ 88%] Linking CXX static library libconvert.a
[ 88%] Built target convert
Scanning dependencies of target usd_from_gltf
[ 90%] Building CXX object usd_from_gltf/CMakeFiles/usd_from_gltf.dir/args.cc.o
[ 92%] Building CXX object usd_from_gltf/CMakeFiles/usd_from_gltf.dir/usd_from_gltf.cc.o
[ 95%] Linking CXX executable usd_from_gltf
/usr/local/USD/lib/libusdUtils.so: undefined reference to `pxrInternal_v0_20__pxrReserved__::Sdf_Children<pxrInternal_v0_20__pxrReserved__::Sdf_VariantSetChildPolicy>::FindKey[abi:$
collect2: error: ld returned 1 exit status
usd_from_gltf/CMakeFiles/usd_from_gltf.dir/build.make:127: recipe for target 'usd_from_gltf/usd_from_gltf' failed
make[2]: *** [usd_from_gltf/usd_from_gltf] Error 1
CMakeFiles/Makefile2:331: recipe for target 'usd_from_gltf/CMakeFiles/usd_from_gltf.dir/all' failed
make[1]: *** [usd_from_gltf/CMakeFiles/usd_from_gltf.dir/all] Error 2
Makefile:148: recipe for target 'all' failed
make: *** [all] Error 2

cmake /home/julien/usd_from_gltf -DCMAKE_INSTALL_PREFIX=/usr/local/usd_from_gltf -DCMAKE_PREFIX_PATH=/usr/local/usd_from_gltf -DUSD_DIR=/usr/local/USD
-- Configuring done
-- Generating done
-- Build files have been written to: /usr/local/usd_from_gltf/build/usd_from_gltf

cmake --build . --config Release --target install --
[ 30%] Built target gltf
[ 40%] Built target common
[ 71%] Built target process
[ 88%] Built target convert
[ 90%] Linking CXX executable usd_from_gltf
/usr/local/USD/lib/libusdUtils.so: undefined reference to `pxrInternal_v0_20__pxrReserved__::Sdf_Children<pxrInternal_v0_20__pxrReserved__::Sdf_VariantSetChildPolicy>::FindKey[abi:$
collect2: error: ld returned 1 exit status
usd_from_gltf/CMakeFiles/usd_from_gltf.dir/build.make:127: recipe for target 'usd_from_gltf/usd_from_gltf' failed
make[2]: *** [usd_from_gltf/usd_from_gltf] Error 1
CMakeFiles/Makefile2:331: recipe for target 'usd_from_gltf/CMakeFiles/usd_from_gltf.dir/all' failed
make[1]: *** [usd_from_gltf/CMakeFiles/usd_from_gltf.dir/all] Error 2
Makefile:148: recipe for target 'all' failed
make: *** [all] Error 2

Any idea how to solve this?

Moving Local Install to Another Computer

Does anyone have any tips on how to move the usd_from_gltf to another computer?

I have a server that I am working with that is not connected to the internet. I successfully installed usd_from_gltf on my local computer and was able to start converting files. However, when I moved the USD install and the usd_from_gltf install to the other computer, I began to get many missing .dll errors, and eventually a "The Application was Unable to Start Correctly (0xc000007b)" error when attempting to run the usd_from_gltf from terminal.

I would really like to be able to run this from a internet-less computer, but since I can't install it locally on the other computer I am beginning to think that this isnt possible.

Failed linking on amazonlinux

I was trying to build on an amazonlinux docker image and ran into an error when linking usd_from_gltf. It seems that libpng and libturbojpeg were installed to lib64 instead of lib, causing the following gmake error.

gmake[2]: *** No rule to make target `/root/build/lib/libpng16.a', needed by `usd_from_gltf/usd_from_gltf'

It seems that the error occurs here, where it is assumed that those two libraries are installed in lib.

set(INSTALLED_LIBRARY_DIR ${stb_image_LIBRARY_DIR})

GLTF_ERROR_ID_OUT_OF_RANGE when more than 65535 accessors

Hello there 👋

I've stumbled upon "exotic" GlTF files which have more than 65535 accessors (imagine a GlTF file with 12k primitives, each having a POSITION, indices, NORMAL, TANGENT and 2 TEXCOORDS accessors -> 72k accessors in total).

In the code, an entity "Id" is defined as a uint16:

enum class Id : uint16_t {
which makes it impossible to convert a GlTF with more than 65535 of one type of data (acessors, buffers, animation channels...): the conversion fails with both GLTF_ERROR_MISSING_ACCESSOR and GLTF_ERROR_ID_OUT_OF_RANGE errors.

My question is then quite simple, ignoring the fact that such files are far from being optimized and that I should probably not try to convert them in the first place:

Is there a "hard" limit in USD to use uint16 indices for this data other than size optimization, or can I safely replace this type with uint32_t for such files ?

Error while installing usd_from_gltf : [USD\include\pxr/base/tf/diagnosticHelper.h(35,10): fatal error C1083: Cannot open include file: 'boost/any.hpp': No such file or directory ]

Hi,
I've been trying to identify this issue. Couldn't get anything on it. Any idea on this?

gltf.vcxproj -> C:\USDGLTF\build\usd_from_gltf\gltf\Release\gltf.lib
config.cc
C:\USD\include\pxr/base/tf/diagnosticHelper.h(35,10): fatal error C1083: Cannot open include file: 'boost/any.hpp': No such file or directory [C:\USDGLTF\build\usd_from_gltf\common\common.vcxproj]
logging.cc
C:\USD\include\pxr/base/tf/diagnosticHelper.h(35,10): fatal error C1083: Cannot open include file: 'boost/any.hpp': No such file or directory [C:\USDGLTF\build\usd_from_gltf\common\common.vcxproj]

image

The log file.
log.txt

We could create a docker build and auto publish it using github actions

To make it simpler to use this.
a docker build of the tool should be made.

I put a couple of hour into it today. I was able to get a USD build working with the docker file below
But it fails during the linking phase of usd_from_gltf, and I'm lost as to why.

I added what I thought was needed to the LD_LIBRARY_PATH but to no success.

In my case I simply want to use the docker container as a tool, so I don't think we need python support. but I'm not sure how to disable it in the best way.

Questions
Does anyone know how to get my linking to work?
If I only want a working usd_from_gltf what do I need to keep around after the build?

FROM python:2.7.16-buster

# our binary versions where applicable
ENV USD_VERSION 19.11

WORKDIR /usr/src/app

# Required for compiling the USD source
RUN apt-get update && apt-get install -y \
	git \
	g++ \
	gcc \
	make \
	cmake \
	doxygen \
	graphviz

# Clone, setup and compile the Pixar USD Converter. This is required
# for converting GLTF2->USDZ
# More info @ https://github.com/PixarAnimationStudios/USD
RUN mkdir xrutils && \
  git clone --branch v${USD_VERSION} --single-branch --depth 1 https://github.com/PixarAnimationStudios/USD && \
	cd USD && git checkout tags/v${USD_VERSION} && cd ../ && \
	python USD/build_scripts/build_usd.py /usr/local/USD --build-args TBB,extra_inc=big_iron.inc --python --no-imaging --docs --no-usdview --build-monolithic && \
	rm -rf USD

# Install dependencies according to https://github.com/google/usd_from_gltf#installation-steps
RUN apt-get update && \
  apt-get install nasm -y && \
  pip install Pillow

# Set the LD_LIBRARY_PATH so that when we are trying to build, it can find the shared libraries
ENV LD_LIBRARY_PATH "${LD_LIBRARY_PATH}:/usr/local/USD/lib:/usr/local/usd_from_gltf/lib"

ENV PYTHONPATH "${PYTHONPATH}:/usr/local/USD/lib/python"

ENV PATH "${PATH}:/usr/local/USD/bin"

# Download gltf_to_usdz sources and build using the USD library previously built.
RUN git clone --depth 1 https://github.com/google/usd_from_gltf usd_from_gltf_src && \
  python usd_from_gltf_src/tools/ufginstall/ufginstall.py /usr/local/usd_from_gltf /usr/local/USD && \
  rm -rf usd_from_gltf_src

CMD ["/usr/local/usd_from_gltf/bin/usd_from_gltf"]

The error log

Install Settings:
  Source Directory:   /usr/src/app/usd_from_gltf_src
  Install Directory:  /usr/local/usd_from_gltf
  USD Directory:      /usr/local/USD
  Download Directory: /usr/local/usd_from_gltf/src
  Build Directory:    /usr/local/usd_from_gltf/build
  Build Config:       Release
  CMake Generator:    Default
  Already Installed:  DRACO, GIF, JPG, JSON, PNG, STB_IMAGE, TCLAP
  Installing:         USD_FROM_GLTF

-------- Installing USD_FROM_GLTF --------
  USD_FROM_GLTF: CWD: /usr/local/usd_from_gltf/build/usd_from_gltf_src
  USD_FROM_GLTF: Run: cmake /usr/src/app/usd_from_gltf_src -DCMAKE_INSTALL_PREFIX=/usr/local/usd_from_gltf -DCMAKE_PREFIX_PATH=/usr/local/usd_from_gltf -DUSD_DIR=/usr/local/USD
  USD_FROM_GLTF: CWD: /usr/local/usd_from_gltf/build/usd_from_gltf_src
  USD_FROM_GLTF: Run: cmake --build . --config Release --target install --
[ 30%] Built target gltf
[ 40%] Built target common
[ 71%] Built target process
[ 88%] Built target convert
[ 90%] Linking CXX executable usd_from_gltf
/usr/bin/ld: cannot find -lgf
/usr/bin/ld: cannot find -lplug
/usr/bin/ld: cannot find -lsdf
/usr/bin/ld: cannot find -ltf
/usr/bin/ld: cannot find -lusd
/usr/bin/ld: cannot find -lusdGeom
/usr/bin/ld: cannot find -lusdShade
/usr/bin/ld: cannot find -lusdSkel
/usr/bin/ld: cannot find -lusdUtils
/usr/bin/ld: cannot find -lvt
collect2: error: ld returned 1 exit status
make[2]: *** [usd_from_gltf/CMakeFiles/usd_from_gltf.dir/build.make:111: usd_from_gltf/usd_from_gltf] Error 1
make[1]: *** [CMakeFiles/Makefile2:317: usd_from_gltf/CMakeFiles/usd_from_gltf.dir/all] Error 2
make: *** [Makefile:130: all] Error 2

  USD_FROM_GLTF: ERROR: Command failed: cmake --build . --config Release --target install --
  USD_FROM_GLTF: See log at: /usr/local/usd_from_gltf/build/usd_from_gltf_src/log.txt

UFG_ERROR_ASSERT when converting glTF asset

When running usd_from_gltf on my glTF file, I get the following errors and warnings:

% usd_from_gltf Goat_PBR.gltf Goat_PBR.usdz
ERROR: /Users/ddewit/usd_from_gltf/convert/texturator.cc(900) : ASSERT(!dst_path.empty()) [UFG_ERROR_ASSERT]
Warning: Cannot delete file: T_Goat_SpecularSmoothness_metal.jpg [UFG_WARN_IO_DELETE]
Warning: Cannot delete file: T_Goat_BaseColor_base.jpg [UFG_WARN_IO_DELETE]
Warning: Cannot delete file: T_Goat_SpecularSmoothness_rough.jpg [UFG_WARN_IO_DELETE]
Warning: Cannot delete file: T_Goat_Normal_norm.jpg [UFG_WARN_IO_DELETE]
Warning: Cannot delete file: T_Goat_Occlusion_occl.jpg [UFG_WARN_IO_DELETE]

and my glTF asset folder looks like this:

Goat_PBR.gltf
Goat_PBR.bin
T_Goat_BaseColor.png
T_Goat_Occlusion.jpg
T_Goat_SpecularSmoothness.png
T_Goat_Normal.jpg

The file is viewable on this online glTF viewer , as well as in Apple's Reality Converter. I suppose the warnings come from files generated by the tool as I don't have those in my original asset.

Any ideas how to solve this?

Failure to convert Blender glTF files to USDZ using usd_from_gltf

Hello, I am having an issue with glTF files that I created using Blender. When I try to run the converter, I am greeted with the following error:
ERROR: Cannot open file for read: /home/ec2-user/docker-gltf-to-udsz/gltf/Shoe.gltf [GLTF_ERROR_IO_OPEN_READ]

I've tried this with many different glTF files from blender with the same issue. Please let me know if there is something I can do to fix this.

Alpha mask didn't work in USDZ.

Hi there, I have a alpha blend problem. I'm using blender to export the glTF file and it looks prefect on windows and android handset.

However, after I converted to usdz it looks fine in usdview on windows, but not in Iphone Xs.

I have tried --noprefer_jpeg , --bake_alpha_cutoff , on converted.

can anyone help?

Error compiling against USD 21.05

Hello,

We are trying to compile this tool against USD version 21.05 and getting the following errors. It looks like some API changes have been made.

Screen Shot 2021-06-10 at 12 02 45 pm

We have attempted to build using both of these commands, leading to the same error

python3 ufgsrc/tools/ufginstall/ufginstall.py ufg ${USD_BUILD_PATH}

and

python ufgsrc/tools/ufginstall/ufginstall.py ufg ${USD_BUILD_PATH}

we have both python-dev and python3-dev also installed.

Any help is much appreciated, thank you!

Build Error - Could not load cache.

Hello everyone! Maybe someone stumbled on something like this?
Windows 10 x64
Visual Studio 2017
USD 21.02 Build with Python 2.7

After some issues I ran into this and I could not find anything related to this issue:
Command:
H:\usd_from_gltf-master>python ./tools/ufginstall/ufginstall.py H:/UFG-CP37 H:/USD-CP27

Install Settings:
Source Directory: H:\usd_from_gltf-master
Install Directory: H:\UFG-CP37
USD Directory: H:\USD-CP27
Download Directory: H:\UFG-CP37\src
Build Directory: H:\UFG-CP37\build
Build Config: Release
CMake Generator: Default
Already Installed: DRACO, GIF, JPG, JSON, ZLIB, PNG, STB_IMAGE, TCLAP
Installing: USD_FROM_GLTF

-------- Installing USD_FROM_GLTF --------
USD_FROM_GLTF: CWD: H:\UFG-CP37\build\usd_from_gltf-master
USD_FROM_GLTF: Run: cmake H:\usd_from_gltf-master -DCMAKE_INSTALL_PREFIX=H:\UFG-CP37 -DCMAKE_PREFIX_PATH=H:\UFG-CP37 -DUSD_DIR=H:\USD-CP27 -DCMAKE_GENERATOR_PLATFORM=x64
USD_FROM_GLTF: CWD: H:\UFG-CP37\build\usd_from_gltf-master
USD_FROM_GLTF: Run: cmake --build . --config Release --target install -- /m
Error: could not load cache

USD_FROM_GLTF: ERROR: Command failed: cmake --build . --config Release --target install -- /m
USD_FROM_GLTF: See log at: H:\UFG-CP37\build\usd_from_gltf-master\log.txt

------------------ Log File Attached ----------------

Thanks in advance!
Cheers, Felipe.
log.txt

Installation error

I have error. Please help.
I installed on Win10 with
Python 3.7.4
Visual Studio 14 2015

-------- Installing USD_FROM_GLTF --------
USD_FROM_GLTF: CWD: c:\OpenServer\domains\3d\usd_from_gltf_build\build\usd_from_gltf
USD_FROM_GLTF: Run: cmake c:\OpenServer\domains\3d\usd_from_gltf -DCMAKE_INSTALL_PREFIX=c:\OpenServer\domains\3d\usd_from_gltf_build -DCMAKE_PREFIX_PATH=c:\OpenServer\domains\3d\usd_from_gltf_build -DUSD_DIR=c:\OpenServer\domains\3d\usdp -DCMAKE_GENERATOR_PLATFORM=x64
USD_FROM_GLTF: CWD: c:\OpenServer\domains\3d\usd_from_gltf_build\build\usd_from_gltf
USD_FROM_GLTF: Run: cmake --build . --config Release --target install -- /m
Microsoft (R) Build Engine ўҐабЁЁ 14.0.25420.1
(C) Љ®аЇ®а жЁп Њ ©Єа®б®дв (Microsoft Corporation). ‚ᥠЇа ў  § йЁйҐ­л.

gltf.vcxproj -> C:\OpenServer\domains\3d\usd_from_gltf_build\build\usd_from_gltf\gltf\Release\gltf.lib
config.cc
c:\OpenServer\domains\3d\usdp\include\pxr/base/tf/diagnosticHelper.h(35): fatal error C1083: Cannot open include file: 'boost/any.hpp': No such file or directory [C:\OpenServer\domains\3d\usd_from_gltf_build\build\usd_from_gltf\common\common.vcxproj]
logging.cc
c:\OpenServer\domains\3d\usdp\include\pxr/base/tf/diagnosticHelper.h(35): fatal error C1083: Cannot open include file: 'boost/any.hpp': No such file or directory [C:\OpenServer\domains\3d\usd_from_gltf_build\build\usd_from_gltf\common\common.vcxproj]
Generating Code...

GLTF_ERROR_BAD_SEMANTIC error when encountering (allowed) application specific attributes

According to the glTF 2.0 specs, application-specific attributes are allowed (as long as they start with an underscore):

Valid attribute semantic property names include POSITION, NORMAL, TANGENT, TEXCOORD_0, TEXCOORD_1, COLOR_0, JOINTS_0, and WEIGHTS_0. Application-specific semantics must start with an underscore, e.g., _TEMPERATURE.

However, the converter refuses conversion when encountering such an attribute, for example _UV3. It returns the following error and stops the conversion:

ERROR: meshes[4].primitives[0].attributes: Unrecognized attribute semantic: _UV3 [GLTF_ERROR_BAD_SEMANTIC]

Compilation Error: no instance of overloaded function

Hi,
I got the below many compilation error of below.

E0304	no instance of overloaded function "pxrInternal_v0_21__pxrReserved__::UsdShadeOutput::ConnectToSource" matches the argument list

Error	C2664	'bool pxrInternal_v0_21__pxrReserved__::UsdShadeOutput::ConnectToSource(const pxrInternal_v0_21__pxrReserved__::UsdShadeConnectionSourceInfo &,const pxrInternal_v0_21__pxrReserved__::UsdShadeOutput::ConnectionModification) const': cannot convert argument 1 from 'pxrInternal_v0_21__pxrReserved__::UsdShadeShader' to 'const pxrInternal_v0_21__pxrReserved__::UsdShadeConnectionSourceInfo &'

Looks like there is no ConnectToSource which takes UsdShadeShader as its 1st argument.

How to fix it?

DLL search PATH for windows

A pitfall I ran into trying to run this on windows is that usd_from_gltf.exe depends on USD and ZLIB DLLs which it dynamically loads, and if these are not found it silently exits. I had to use dependency walker to track down these missing run time dependencies and make sure the executable can find them. I would add a hint to the README that these DLLs need to be added to PATH, or make the exe print an error.

Handling of baseColorFactor alpha highlights Quick Look renderer issue

Currently when a glTF file specifies a baseColorFactor with an alpha value less than 1 and sets alphaMode to BLEND, the converter will bake that alpha value into base color texture. Doing so causes the transparency rendering issue referenced in the README to occur. If instead the the alpha value is set directly in the USD material and the texture is left unchanged, the renderer better represents the transparency while also decreasing overall file size by keeping JPEG compression on the texture.

I've attached a source glb file with an example alpha material along with two directories of USD assets. One is the output from usd_from_gltf and the other is model with the alpha set directly in the USD material.

usd_from_gltf_alpha_example.zip

Error while installing usd_from_gltf : No rule to make target '$USDROOT/lib/libboost_python.so', needed by 'usd_from_gltf/usd_from_gltf'

  • {USD} = USDROOT
  • {UFG_SRC} = usd_from_gltf
  • {UFG_BUILD} = UFG_BUILD

`python usd_from_gltf/tools/ufginstall/ufginstall.py UFG_BUILD USDROOT
Install Settings:
Source Directory: /home/aman/usd_from_gltf
Install Directory: /home/aman/UFG_BUILD
USD Directory: /home/aman/USDROOT
Download Directory: /home/aman/UFG_BUILD/src
Build Directory: /home/aman/UFG_BUILD/build
Build Config: Release
CMake Generator: Default
Already Installed: DRACO, GIF, JPG, JSON, ZLIB, PNG, STB_IMAGE, TCLAP
Installing: USD_FROM_GLTF

-------- Installing USD_FROM_GLTF --------
USD_FROM_GLTF: CWD: /home/aman/UFG_BUILD/build/usd_from_gltf
USD_FROM_GLTF: Run: cmake /home/aman/usd_from_gltf -DCMAKE_INSTALL_PREFIX=/home/aman/UFG_BUILD -DCMAKE_PREFIX_PATH=/home/aman/UFG_BUILD -DUSD_DIR=/home/aman/USDROOT
USD_FROM_GLTF: CWD: /home/aman/UFG_BUILD/build/usd_from_gltf
USD_FROM_GLTF: Run: cmake --build . --config Release --target install --
[ 30%] Built target gltf
[ 40%] Built target common
[ 71%] Built target process
[ 88%] Built target convert
make[2]: *** No rule to make target '/home/aman/USDROOT/lib/libboost_python.so', needed by 'usd_from_gltf/usd_from_gltf'. Stop.
CMakeFiles/Makefile2:331: recipe for target 'usd_from_gltf/CMakeFiles/usd_from_gltf.dir/all' failed
make[1]: *** [usd_from_gltf/CMakeFiles/usd_from_gltf.dir/all] Error 2
Makefile:148: recipe for target 'all' failed
make: *** [all] Error 2
`

UFG_ERROR_LOAD_PLUGINS when using usd_from_gltf command line tool

Hello,
I've build UFG, as a result I've got usd_from_gltf.exe in bin folder. When I tried to run it first it was complaining about missing DLLs but I've copied (a lot) them from USD install bin and lib directory and it's now at least starting.
But I cannot go any further because it's now giving me:
ERROR: Unable to load USD plugins. Could not locate plugin search path. [UFG_ERROR_LOAD_PLUGINS]
I've tried to set --plugin_path to {UFG_install}\bin\ufg_plugin directory and {USD_install}\plugin\usd but it's telling me only that:
ERROR: Unable to load USD plugins. No plugins found at search path: ... [UFG_ERROR_LOAD_PLUGINS]

In code I see that it's using GetPluginWithName("usd"). Where do I get this plugin? What plugin does it expect?

I'm using Windows 10 and VS2017.

Error installing USD from GLTF - fatal error: pxr/base/gf/bbox3d.h

Hello,
I have issue during istalling UFG. I have completed all steps that are listed before (installing USD, NASM, PIL) successfully

-------- Installing USD_FROM_GLTF --------
  USD_FROM_GLTF: CWD: /home/maciejze/UFG/build/usd_from_gltf
  USD_FROM_GLTF: Run: cmake /home/maciejze/usd_from_gltf -DCMAKE_INSTALL_PREFIX=/home/maciejze/UFG -DCMAKE_PREFIX_PATH=/home/maciejze/UFG -DUSD_DIR=/home/maciejze/USD
  USD_FROM_GLTF: CWD: /home/maciejze/UFG/build/usd_from_gltf
  USD_FROM_GLTF: Run: cmake --build . --config Release --target install --
Scanning dependencies of target gltf
[  2%] Building CXX object gltf/CMakeFiles/gltf.dir/internal_util.cc.o
[  4%] Building CXX object gltf/CMakeFiles/gltf.dir/load.cc.o
[  7%] Building CXX object gltf/CMakeFiles/gltf.dir/memory_stream.cc.o
[  9%] Building CXX object gltf/CMakeFiles/gltf.dir/message.cc.o
[ 11%] Building CXX object gltf/CMakeFiles/gltf.dir/stream.cc.o
[ 14%] Building CXX object gltf/CMakeFiles/gltf.dir/validate.cc.o
[ 16%] Building CXX object gltf/CMakeFiles/gltf.dir/cache.cc.o
[ 19%] Building CXX object gltf/CMakeFiles/gltf.dir/disk_stream.cc.o
[ 21%] Building CXX object gltf/CMakeFiles/gltf.dir/disk_util.cc.o
[ 23%] Building CXX object gltf/CMakeFiles/gltf.dir/glb_stream.cc.o
[ 26%] Building CXX object gltf/CMakeFiles/gltf.dir/gltf.cc.o
[ 28%] Building CXX object gltf/CMakeFiles/gltf.dir/image_parsing.cc.o
/home/maciejze/usd_from_gltf/gltf/image_parsing.cc:313:23: warning: multi-character character constant [-Wmultichar]
     if (chunk.type != 'IHDR') {
                       ^~~~~~
[ 30%] Linking CXX static library libgltf.a
[ 30%] Built target gltf
Scanning dependencies of target common
[ 33%] Building CXX object common/CMakeFiles/common.dir/config.cc.o
In file included from /home/maciejze/usd_from_gltf/common/../common/config.h:20:0,
                 from /home/maciejze/usd_from_gltf/common/config.cc:17:
/home/maciejze/usd_from_gltf/common/../common/common.h:29:10: fatal error: pxr/base/gf/bbox3d.h: No such file or directory
 #include "pxr/base/gf/bbox3d.h"
          ^~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
common/CMakeFiles/common.dir/build.make:62: recipe for target 'common/CMakeFiles/common.dir/config.cc.o' failed
make[2]: *** [common/CMakeFiles/common.dir/config.cc.o] Error 1
CMakeFiles/Makefile2:85: recipe for target 'common/CMakeFiles/common.dir/all' failed
make[1]: *** [common/CMakeFiles/common.dir/all] Error 2
Makefile:129: recipe for target 'all' failed
make: *** [all] Error 2

  USD_FROM_GLTF: ERROR: Command failed: cmake --build . --config Release --target install --
  USD_FROM_GLTF: See log at: /home/maciejze/UFG/build/usd_from_gltf/log.txt

.glb to .usd increases the file size by 3x

Hi guys,

I have a draco compression encoded .glb file that I want to convert to .usdz using this tool. After conversion, the filesize gets increased by 3x. Does anybody know why?

ERROR: meshes[0].primitives[0].attributes: Unrecognized attribute semantic: _MaxHandle [GLTF_ERROR_BAD_SEMANTIC]

When we try to convert glb to usdz, usd_from_gltf throws the error below:
ERROR: meshes[0].primitives[0].attributes: Unrecognized attribute semantic: _MaxHandle [GLTF_ERROR_BAD_SEMANTIC]

Further investigation shows that Houdini .gltf exporter adds some extra attributes that trip up the usd_from_gltf

We are still not able to solve the issue except manually remove the attributes it doesn't recognize.

Error during build when installing ZLIB

I'm attempting to build with NVIDIA's prebuilt binaries. However, am getting an error in my build when it attempts to install ZLIB.
My output is below showing the exact error message.

Any help is much appreciated, thanks!

(ufg) D:\Development\Python>python C:\UFG_SRC\tools\ufginstall\ufginstall.py C:\UFG_BUILD C:\USD-NVIDIA
Install Settings:
Source Directory: C:\UFG_SRC
Install Directory: C:\UFG_BUILD
USD Directory: C:\USD-NVIDIA
Download Directory: C:\UFG_BUILD\src
Build Directory: C:\UFG_BUILD\build
Build Config: Release
CMake Generator: Default
Already Installed:
Installing: DRACO, GIF, JPG, JSON, ZLIB, PNG, STB_IMAGE, TCLAP, USD_FROM_GLTF

-------- Installing DRACO --------
DRACO: Downloading https://github.com/google/draco/archive/1.3.5.zip to C:\UFG_BUILD\src\draco.zip
DRACO: Unpacking to: C:\UFG_BUILD\src\draco-1.3.5
DRACO: CWD: C:\UFG_BUILD\build\draco-1.3.5
DRACO: Run: cmake C:\UFG_BUILD\src\draco-1.3.5 -DCMAKE_INSTALL_PREFIX=C:\UFG_BUILD -DCMAKE_PREFIX_PATH=C:\UFG_BUILD -DCMAKE_POSITION_INDEPENDENT_CODE=1 -DCMAKE_GENERATOR_PLATFORM=x64
DRACO: CWD: C:\UFG_BUILD\build\draco-1.3.5
DRACO: Run: cmake --build . --config Release --target install -- /m

-------- Installing GIF --------
GIF: Downloading https://sourceforge.net/projects/giflib/files/giflib-5.1.9.tar.gz/download to C:\UFG_BUILD\src\giflib.tar.gz
GIF: Unpacking to: C:\UFG_BUILD\src\giflib-5.1.9
GIF: CWD: C:\UFG_BUILD\build\giflib-5.1.9
GIF: Run: cmake C:\UFG_BUILD\src\giflib-5.1.9 -DCMAKE_INSTALL_PREFIX=C:\UFG_BUILD -DCMAKE_PREFIX_PATH=C:\UFG_BUILD -DCMAKE_POSITION_INDEPENDENT_CODE=1 -DCMAKE_GENERATOR_PLATFORM=x64
GIF: CWD: C:\UFG_BUILD\build\giflib-5.1.9
GIF: Run: cmake --build . --config Release --target install -- /m

-------- Installing JPG --------
JPG: Downloading https://github.com/libjpeg-turbo/libjpeg-turbo/archive/2.0.2.zip to C:\UFG_BUILD\src\jpg.zip
JPG: Unpacking to: C:\UFG_BUILD\src\libjpeg-turbo-2.0.2
JPG: CWD: C:\UFG_BUILD\build\libjpeg-turbo-2.0.2
JPG: Run: cmake C:\UFG_BUILD\src\libjpeg-turbo-2.0.2 -DCMAKE_INSTALL_PREFIX=C:\UFG_BUILD -DCMAKE_PREFIX_PATH=C:\UFG_BUILD -DCMAKE_POSITION_INDEPENDENT_CODE=1 -DCMAKE_GENERATOR_PLATFORM=x64
JPG: CWD: C:\UFG_BUILD\build\libjpeg-turbo-2.0.2
JPG: Run: cmake --build . --config Release --target install -- /m

-------- Installing JSON --------
JSON: Downloading https://github.com/nlohmann/json/releases/download/v3.6.1/json.hpp to C:\UFG_BUILD\src\json/json.hpp
JSON: CWD: C:\UFG_BUILD\build\json
JSON: Run: cmake C:\UFG_BUILD\src\json -DCMAKE_INSTALL_PREFIX=C:\UFG_BUILD -DCMAKE_PREFIX_PATH=C:\UFG_BUILD -DCMAKE_GENERATOR_PLATFORM=x64
JSON: CWD: C:\UFG_BUILD\build\json
JSON: Run: cmake --build . --config Release --target install -- /m

-------- Installing ZLIB --------
ZLIB: Downloading https://github.com/madler/zlib/archive/v1.2.11.zip to C:\UFG_BUILD\src\zlib.zip
ZLIB: Unpacking to: C:\UFG_BUILD\src\zlib-1.2.11
ZLIB: CWD: C:\UFG_BUILD\src\zlib-1.2.11
ZLIB: Run: cmake -DCMAKE_GENERATOR_PLATFORM=x64 .
ZLIB: CWD: C:\UFG_BUILD\src\zlib-1.2.11
ZLIB: Run: cmake
ZLIB: CWD: C:\UFG_BUILD\src\zlib-1.2.11
ZLIB: Run: msbuild /P:Configuration=Release zlib.sln
ZLIB: ERROR: [WinError 2] The system cannot find the file specified

ERROR: COMMAND failed: cmake --build ....

Hello

Thanks for the great program. I'm trying to install usd_from_gltf on a Windows 10 machine.

python C:\UFG_SRC\tools\ufginstall\ufginstall.py C:\Programm\UFG2 C:\Programm\USD --testdata

cmake C:\UFG_SRC -DCMAKE_INSTALL_PREFIX=C:\Programm\UFG2 -DCMAKE_PREFIX_PATH=C:\Programm\UFG2 -DUSD_DIR=C:\Programm\USD -DCMAKE_GENERATOR_PLATFORM=x64
-- Building for: Visual Studio 16 2019
-- The C compiler identification is MSVC 19.23.28106.4
-- The CXX compiler identification is MSVC 19.23.28106.4
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.23.28105/bin/Hostx64/x64/cl.exe
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.23.28105/bin/Hostx64/x64/cl.exe -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.23.28105/bin/Hostx64/x64/cl.exe
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.23.28105/bin/Hostx64/x64/cl.exe -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found Python: C:/Program Files (x86)/Microsoft Visual Studio/Shared/Python37_64/libs/python37.lib (found version "3.7") found components: Development
-- Found ZLIB: C:/Program Files/zlib/lib/zlib.lib (found version "1.2.11")
-- Configuring done
-- Generating done
-- Build files have been written to: C:/Programm/UFG2/build/UFG_SRC

I'm getting the following error and I would appreciate any help!

ERROR: COMMAND failed: cmake --build ....

grafik

The Error.log

cmake --build . --config Release --target install -- /m
Microsoft (R)-Build-Engine, Version 16.3.2+e481bbf88 für .NET Framework
Copyright (C) Microsoft Corporation. Alle Rechte vorbehalten.

Checking Build System
Building Custom Rule C:/UFG_SRC/gltf/CMakeLists.txt
internal_util.cc
load.cc
memory_stream.cc
message.cc
stream.cc
validate.cc
cache.cc
disk_stream.cc
disk_util.cc
glb_stream.cc
gltf.cc
image_parsing.cc
Code wird generiert...
gltf.vcxproj -> C:\Programm\UFG2\build\UFG_SRC\gltf\Release\gltf.lib
Building Custom Rule C:/UFG_SRC/common/CMakeLists.txt
config.cc
Unknown compiler version - please run the configure tests and report the results
logging.cc
Unknown compiler version - please run the configure tests and report the results
platform.cc
Code wird generiert...
common.vcxproj -> C:\Programm\UFG2\build\UFG_SRC\common\Release\common.lib
Building Custom Rule C:/UFG_SRC/process/CMakeLists.txt
math.cc
Unknown compiler version - please run the configure tests and report the results
mesh.cc
Unknown compiler version - please run the configure tests and report the results
process_util.cc
Unknown compiler version - please run the configure tests and report the results
skin.cc
Unknown compiler version - please run the configure tests and report the results
animation.cc
Unknown compiler version - please run the configure tests and report the results
color.cc
Unknown compiler version - please run the configure tests and report the results
float_image.cc
Unknown compiler version - please run the configure tests and report the results
image.cc
Unknown compiler version - please run the configure tests and report the results
image_fallback.cc
Unknown compiler version - please run the configure tests and report the results
image_gif.cc
Unknown compiler version - please run the configure tests and report the results
image_jpg.cc
Unknown compiler version - please run the configure tests and report the results
image_png.cc
Unknown compiler version - please run the configure tests and report the results
Code wird generiert...
process.vcxproj -> C:\Programm\UFG2\build\UFG_SRC\process\Release\process.lib
Building Custom Rule C:/UFG_SRC/convert/CMakeLists.txt
tokens.cc
Unknown compiler version - please run the configure tests and report the results
convert_util.cc
Unknown compiler version - please run the configure tests and report the results
converter.cc
Unknown compiler version - please run the configure tests and report the results
C:\Programm\USD\include\pxr/usd/usd/modelAPI.h(324,1): warning C4003: Nicht genügend Argumente für den Aufruf des funktionsähnlichen Makros "BOOST_VMD_IS_TUPLE". [C:\Programm\UFG2\build\UFG_SRC\convert\convert.vcxproj]
C:\Programm\USD\include\pxr/usd/usd/modelAPI.h(324,1): warning C4003: Nicht genügend Argumente für den Aufruf des funktionsähnlichen Makros "BOOST_VMD_DETAIL_IS_TUPLE". [C:\Programm\UFG2\build\UFG_SRC\convert\convert.vcxproj]
C:\Programm\USD\include\pxr/usd/usd/modelAPI.h(324,1): warning C4003: Nicht genügend Argumente für den Aufruf des funktionsähnlichen Makros "BOOST_VMD_DETAIL_PARENS_SPLIT". [C:\Programm\UFG2\build\UFG_SRC\convert\convert.vcxproj]
C:\Programm\USD\include\pxr/usd/usd/modelAPI.h(324,1): warning C4003: Nicht genügend Argumente für den Aufruf des funktionsähnlichen Makros "BOOST_PP_SEQ_DETAIL_IS_NOT_EMPTY". [C:\Programm\UFG2\build\UFG_SRC\convert\convert.vcxproj]
C:\Programm\USD\include\pxr/usd/usd/modelAPI.h(324,1): warning C4003: Nicht genügend Argumente für den Aufruf des funktionsähnlichen Makros "BOOST_PP_SEQ_DETAIL_EMPTY_SIZE". [C:\Programm\UFG2\build\UFG_SRC\convert\convert.vcxproj]
C:\Programm\USD\include\pxr/usd/usd/modelAPI.h(324,1): warning C4003: Nicht genügend Argumente für den Aufruf des funktionsähnlichen Makros "BOOST_PP_TUPLE_SIZE". [C:\Programm\UFG2\build\UFG_SRC\convert\convert.vcxproj]
C:\UFG_SRC\convert\converter.cc(443,43): error C2440: "Initialisierung": "initializer list" kann nicht in "pxrInternal_v0_18__pxrReserved__::VtArray<pxrInternal_v0_18__pxrReserved__::GfVec3f>" konvertiert werden [C:\Programm\UFG2\build\UFG_SRC\convert\convert.vcxproj]
C:\UFG_SRC\convert\converter.cc(450,3): message : Quelltyp konnte von keinem Konstruktor angenommen werden, oder die Überladungsauflösung des Konstruktors ist mehrdeutig [C:\Programm\UFG2\build\UFG_SRC\convert\convert.vcxproj]
C:\UFG_SRC\convert\converter.cc(451,42): error C2440: "Initialisierung": "initializer list" kann nicht in "pxrInternal_v0_18__pxrReserved__::VtArray<pxrInternal_v0_18__pxrReserved__::GfVec3f>" konvertiert werden [C:\Programm\UFG2\build\UFG_SRC\convert\convert.vcxproj]
C:\UFG_SRC\convert\converter.cc(458,3): message : Quelltyp konnte von keinem Konstruktor angenommen werden, oder die Überladungsauflösung des Konstruktors ist mehrdeutig [C:\Programm\UFG2\build\UFG_SRC\convert\convert.vcxproj]
C:\UFG_SRC\convert\converter.cc(460,43): error C2440: "Initialisierung": "initializer list" kann nicht in "pxrInternal_v0_18__pxrReserved__::VtArray" konvertiert werden [C:\Programm\UFG2\build\UFG_SRC\convert\convert.vcxproj]
C:\UFG_SRC\convert\converter.cc(467,3): message : Quelltyp konnte von keinem Konstruktor angenommen werden, oder die Überladungsauflösung des Konstruktors ist mehrdeutig [C:\Programm\UFG2\build\UFG_SRC\convert\convert.vcxproj]
C:\UFG_SRC\convert\converter.cc(501,66): error C2664: "pxrInternal_v0_18__pxrReserved__::VtArray<pxrInternal_v0_18__pxrReserved__::GfVec3f>::VtArray(const pxrInternal_v0_18__pxrReserved__::VtArray<pxrInternal_v0_18__pxrReserved__::GfVec3f> &)" : Konvertierung von Argument 1 von "initializer list" in "size_t" nicht möglich [C:\Programm\UFG2\build\UFG_SRC\convert\convert.vcxproj]
C:\UFG_SRC\convert\converter.cc(501,33): message : Der Initialisierer enthält zu viele Elemente. [C:\Programm\UFG2\build\UFG_SRC\convert\convert.vcxproj]
C:\Programm\USD\include\pxr/base/vt/array.h(300,5): message : Siehe Deklaration von "pxrInternal_v0_18__pxrReserved__::VtArray<pxrInternal_v0_18__pxrReserved__::GfVec3f>::VtArray" [C:\Programm\UFG2\build\UFG_SRC\convert\convert.vcxproj]
C:\UFG_SRC\convert\converter.cc(727,66): error C2664: "pxrInternal_v0_18__pxrReserved__::VtArray<pxrInternal_v0_18__pxrReserved__::GfVec3f>::VtArray(const pxrInternal_v0_18__pxrReserved__::VtArray<pxrInternal_v0_18__pxrReserved__::GfVec3f> &)" : Konvertierung von Argument 1 von "initializer list" in "size_t" nicht möglich [C:\Programm\UFG2\build\UFG_SRC\convert\convert.vcxproj]
C:\UFG_SRC\convert\converter.cc(727,35): message : Der Initialisierer enthält zu viele Elemente. [C:\Programm\UFG2\build\UFG_SRC\convert\convert.vcxproj]
materializer.cc
package.cc
texturator.cc
Code wird generiert...
C:\Programm\USD\include\pxr/base/vt/array.h(300,5): message : Siehe Deklaration von "pxrInternal_v0_18__pxrReserved__::VtArray<pxrInternal_v0_18__pxrReserved__::GfVec3f>::VtArray" [C:\Programm\UFG2\build\UFG_SRC\convert\convert.vcxproj]
C:\Programm\USD\include\pxr/base/vt/array.h(300,5): message : Unknown compiler version - please run the configure tests and report the results [C:\Programm\UFG2\build\UFG_SRC\convert\convert.vcxproj]
C:\Programm\USD\include\pxr/base/vt/array.h(300,5): message : Unknown compiler version - please run the configure tests and report the results [C:\Programm\UFG2\build\UFG_SRC\convert\convert.vcxproj]
C:\Programm\USD\include\pxr/base/vt/array.h(300,5): message : Unknown compiler version - please run the configure tests and report the results [C:\Programm\UFG2\build\UFG_SRC\convert\convert.vcxproj]

The error log is unfortunately partly in German.

thanks
Ralf

I found sharpen edge along the UV seam line on the mesh.

I have a problem when I convert the *.gltf file to *.usdz file using the gltf_from_usb.
There are sharpen edge line along UV Seam even it doesn't have any texture file.(If i apply those textures it has same problem.)
But *.gltf file is fine and I can't fine on the Babylon viewer.
Especially when I converted to *.usd format at blender 2.8 there are not found sharpen edge along UV line.

I would like to solve this problem....

image

Crash when a GLB's diffuse and specGloss maps have different dimensions

I'm building 64bit usd_from_gltf on Windows 10.
These two draco compressed GLBs have the KHR_materials_pbrSpecularGlossiness extension, and they both fail in FloatImage::ConvertSpecDiffToMetalBase with either access violation or bad allocation.
If I resize the diffuse and specGloss maps to be the same size they convert correctly.

https://www.dropbox.com/s/12hzs9diz1fua5v/Midi_dress_blue_Light%20Grey.glb?dl=0
https://www.dropbox.com/s/3za1es5bwtvfii4/Seersucker%20Tailored%20Blazer_Colorway%201.glb?dl=0

Texture filter mode unsupported on iOS viewer

Hello
I try to learning conversion process and get this message
Warning: Texture filter mode [min=NEAREST, mag=NEAREST] unsupported on iOS viewer. Sampler(s): sampler0 [UFG_WARN_TEXTURE_FILTER_UNSUPPORTED]
Why? And how to solve it
It happends with all my textures

$ /home/bm/bin/usd_from_gltf/build/bin/usd_from_gltf 2/ar-test_v2.glb ar-test_v2.usdz
Warning: Texture filter mode [min=NEAREST_MIPMAP_LINEAR, mag=LINEAR] unsupported on iOS viewer. Sampler(s): sampler0 [UFG_WARN_TEXTURE_FILTER_UNSUPPORTED]

and with sample models by this command
$ python "/home/bm/bin/usd_from_gltf/tools/ufgbatch/ufgtest.py" samp_gltf.csv samp_glb.csv samp_embed.csv samp_draco.csv samp_specgloss.csv ref.csv -i "/home/bm/bin/usd_from_gltf/build/src/testdata" -o "/home/bm/bin/usd_from_gltf/build/build/testdata" --exe "/home/bm/bin/usd_from_gltf/build/bin/usd_from_gltf" --nodiff --nodeploy

Feature Request: Add Copyright Flag

Hi,

Would it be possible to add a --copyright flag so that we can attribute embedded copyright to the generated files?

So we could then run something like: usd_from_gltf in.gltf out.usdz --copyright TheCompany 2021

Thank you.

png/zlib related error while running cmake on "Installing USD_FROM_GLTF" step

Hi all,

Thanks for the great program. I'm trying to install ufg on a fresh Ubuntu 14.04 machine on AWS EC2. (I was running into too many problems on Ubuntu 18.04 so I downgraded to the same OS that USD's Travis CI uses)

I'm getting the following error and I would appreciate any help!

ubuntu@ip-172-31-36-22:~/Downloads/usd_from_gltf$ python tools/ufginstall/ufginstall.py ~/Downloads/ufg_build /usr/local/USD --force png
Install Settings:
  Source Directory:   /home/ubuntu/Downloads/usd_from_gltf
  Install Directory:  /home/ubuntu/Downloads/ufg_build
  USD Directory:      /usr/local/USD
  Download Directory: /home/ubuntu/Downloads/ufg_build/src
  Build Directory:    /home/ubuntu/Downloads/ufg_build/build
  Build Config:       Release
  CMake Generator:    Default
  Already Installed:  DRACO, GIF, JPG, JSON, STB_IMAGE, TCLAP
  Installing:         PNG, USD_FROM_GLTF

-------- Installing PNG --------
  PNG: Downloading https://download.sourceforge.net/libpng/libpng-1.6.37.tar.gz to /home/ubuntu/Downloads/ufg_build/src/png.zip
  PNG: Unpacking to: /home/ubuntu/Downloads/ufg_build/src/libpng-1.6.37
  PNG: CWD: /home/ubuntu/Downloads/ufg_build/build/libpng-1.6.37
  PNG: Run: cmake /home/ubuntu/Downloads/ufg_build/src/libpng-1.6.37 -DCMAKE_INSTALL_PREFIX=/home/ubuntu/Downloads/ufg_build -DCMAKE_PREFIX_PATH=/home/ubuntu/Downloads/ufg_build -DCMAKE_POSITION_INDEPENDENT_CODE=1
  PNG: CWD: /home/ubuntu/Downloads/ufg_build/build/libpng-1.6.37
  PNG: Run: cmake --build . --config Release --target install --

-------- Installing USD_FROM_GLTF --------
  USD_FROM_GLTF: CWD: /home/ubuntu/Downloads/ufg_build/build/usd_from_gltf
  USD_FROM_GLTF: Run: cmake /home/ubuntu/Downloads/usd_from_gltf -DCMAKE_INSTALL_PREFIX=/home/ubuntu/Downloads/ufg_build -DCMAKE_PREFIX_PATH=/home/ubuntu/Downloads/ufg_build -DUSD_DIR=/usr/local/USD
  USD_FROM_GLTF: CWD: /home/ubuntu/Downloads/ufg_build/build/usd_from_gltf
  USD_FROM_GLTF: Run: cmake --build . --config Release --target install --
[ 30%] Built target gltf
[ 40%] Built target common
Scanning dependencies of target process
[ 42%] Building CXX object process/CMakeFiles/process.dir/image_png.cc.o
[ 45%] Linking CXX static library libprocess.a
[ 71%] Built target process
[ 88%] Built target convert
[ 90%] Linking CXX executable usd_from_gltf
/home/ubuntu/Downloads/ufg_build/lib/libpng16.a(png.c.o): In function `png_reset_crc':
png.c:(.text+0x1e2): undefined reference to `crc32'
/home/ubuntu/Downloads/ufg_build/lib/libpng16.a(png.c.o): In function `png_calculate_crc':
png.c:(.text+0x29f): undefined reference to `crc32'
/home/ubuntu/Downloads/ufg_build/lib/libpng16.a(png.c.o): In function `png_reset_zstream':
png.c:(.text+0x1779): undefined reference to `inflateReset'
/home/ubuntu/Downloads/ufg_build/lib/libpng16.a(png.c.o): In function `png_compare_ICC_profile_with_sRGB':
png.c:(.text+0x3c6d): undefined reference to `adler32'
png.c:(.text+0x3c87): undefined reference to `adler32'
png.c:(.text+0x3cc6): undefined reference to `crc32'
png.c:(.text+0x3ce0): undefined reference to `crc32'
/home/ubuntu/Downloads/ufg_build/lib/libpng16.a(pngread.c.o): In function `png_read_destroy':
pngread.c:(.text+0x1794): undefined reference to `inflateEnd'
/home/ubuntu/Downloads/ufg_build/lib/libpng16.a(pngrutil.c.o): In function `png_inflate_claim':
pngrutil.c:(.text+0x8db): undefined reference to `inflateReset2'
pngrutil.c:(.text+0x901): undefined reference to `inflateInit2_'
pngrutil.c:(.text+0x94f): undefined reference to `inflateValidate'
/home/ubuntu/Downloads/ufg_build/lib/libpng16.a(pngrutil.c.o): In function `png_zlib_inflate':
pngrutil.c:(.text+0xa0e): undefined reference to `inflate'
/home/ubuntu/Downloads/ufg_build/lib/libpng16.a(pngrutil.c.o): In function `png_decompress_chunk':
pngrutil.c:(.text+0xe2a): undefined reference to `inflateReset'
/home/ubuntu/Downloads/ufg_build/lib/libpng16.a(pngwrite.c.o): In function `png_write_destroy':
pngwrite.c:(.text+0x18d8): undefined reference to `deflateEnd'
/home/ubuntu/Downloads/ufg_build/lib/libpng16.a(pngwutil.c.o): In function `png_deflate_claim':
pngwutil.c:(.text+0x997): undefined reference to `deflateEnd'
pngwutil.c:(.text+0xa24): undefined reference to `deflateReset'
pngwutil.c:(.text+0xa56): undefined reference to `deflateInit2_'
/home/ubuntu/Downloads/ufg_build/lib/libpng16.a(pngwutil.c.o): In function `png_text_compress':
pngwutil.c:(.text+0xd0b): undefined reference to `deflate'
/home/ubuntu/Downloads/ufg_build/lib/libpng16.a(pngwutil.c.o): In function `png_compress_IDAT':
pngwutil.c:(.text+0x15d8): undefined reference to `deflate'
collect2: error: ld returned 1 exit status
make[2]: *** [usd_from_gltf/usd_from_gltf] Error 1
make[1]: *** [usd_from_gltf/CMakeFiles/usd_from_gltf.dir/all] Error 2
make: *** [all] Error 2

  USD_FROM_GLTF: ERROR: Command failed: cmake --build . --config Release --target install --
  USD_FROM_GLTF: See log at: /home/ubuntu/Downloads/ufg_build/build/usd_from_gltf/log.txt

As I understand it, it seems that the png library cannot find zlib.
So far I've tried installing zlib1g and zlib1g-dev via apt and installing from source (http://zlib.net/zlib-1.2.11.tar.gz).
I added the most obvious directories to PATH:

/bin
/sbin
/usr/bin
/usr/include
/usr/local/bin
/usr/local/games
/usr/local/lib/
/usr/local/sbin
/usr/local/USD/bin
/usr/sbin

Here are all the zlib/libz related files I could find:

ubuntu@ip-172-31-36-22:~/Downloads/usd_from_gltf$ ls /usr/local/lib/
cmake/                         libboost_graph.so              libboost_locale.so.1           libboost_python34.so           libz.so
libboost_fiber.so              libboost_graph.so.1            libboost_locale.so.1.71        libboost_python34.so.1         libz.so.1
libboost_fiber.so.1            libboost_graph.so.1.71         libboost_locale.so.1.71.0      libboost_python34.so.1.71      libz.so.1.2.11
libboost_fiber.so.1.71         libboost_graph.so.1.71.0       libboost_log.so                libboost_python34.so.1.71.0    pkgconfig/
libboost_fiber.so.1.71.0       libboost_iostreams.so          libboost_log.so.1              libboost_regex.so              python2.7/
libboost_filesystem.so         libboost_iostreams.so.1        libboost_log.so.1.71           libboost_regex.so.1            python3.4/
libboost_filesystem.so.1       libboost_iostreams.so.1.71     libboost_log.so.1.71.0         libboost_regex.so.1.71         
libboost_filesystem.so.1.71    libboost_iostreams.so.1.71.0   libboost_python.so             libboost_regex.so.1.71.0       
libboost_filesystem.so.1.71.0  libboost_locale.so             libboost_python34.a            libz.a                         
ubuntu@ip-172-31-36-22:~/Downloads/usd_from_gltf$ find /usr | grep zlib.h
/usr/src/linux-headers-3.13.0-170/include/linux/zlib.h
/usr/src/linux-headers-3.13.0-170-generic/include/config/jffs2/zlib.h
/usr/src/linux-headers-3.13.0-170-generic/include/config/squashfs/zlib.h
/usr/src/linux-headers-3.13.0-170-generic/include/config/crypto/zlib.h
/usr/src/linux-headers-3.13.0-170-generic/include/config/ubifs/fs/zlib.h
/usr/src/linux-headers-3.13.0-170-generic/include/linux/zlib.h
/usr/include/zlib.h
/usr/local/USD/src/tbb-4.4.6/examples/graph/fgbzip2/bzlib.h
/usr/local/USD/src/boost_1_55_0/boost/iostreams/filter/zlib.hpp
/usr/local/USD/src/boost_1_55_0/boost/iostreams/detail/config/zlib.hpp
/usr/local/USD/include/boost/iostreams/filter/zlib.hpp
/usr/local/USD/include/boost/iostreams/detail/config/zlib.hpp
/usr/local/include/zlib.h
/usr/local/include/boost/beast/zlib.hpp
/usr/local/include/boost/beast/zlib/zlib.hpp
/usr/local/include/boost/iostreams/filter/zlib.hpp
/usr/local/include/boost/iostreams/detail/config/zlib.hpp
/usr/share/doc/zlib1g-dev/examples/zlib_how.html
ubuntu@ip-172-31-36-22:~/Downloads/usd_from_gltf$ /sbin/ldconfig -p| grep libz.so
	libz.so.1 (libc6,x86-64) => /usr/local/lib/libz.so.1
	libz.so.1 (libc6,x86-64) => /lib/x86_64-linux-gnu/libz.so.1
	libz.so (libc6,x86-64) => /usr/local/lib/libz.so

I'm not sure what LIBRARY_PATH and LD_LIBRARY_PATH variables do so I haven't really touched those.

Again, any pointers would be appreciated!

Thanks.

--noprefer_jpeg function in usdconvert doesn't work

Problem:

It seems that at the moment usdconvert is forcing all of the .png files to .jpg files. This is causing major issues for some files.

Details:

As I can see, --prefer_jpeg is set to default, but setting --noprefer_jpeg during a conversion doesn't do anything. I've tested my syntax with other commands and they worked.

To reproduce:

Use converter command: usd_from_gltf.exe --noprefer_jpeg "input.gltf" "output.usdz"

*edit: Seems that if .png has transparency mask, converter doesn't force it to .jpg

KHR_texture_transform tiles the occlusionTexture

I have a glTF model with a baseColorTexture using the KHR_texture_transform extension and an occlusionTexture.

This is how it looks in the glTF Viewer

Here is how my converted USDZ looks like

I believe this is not the expected behavior according to the specs, as the maps should be tiled according to their own KHR_texture_transform extension values, and the occlusionTexture should thus not be tiled.

(On a side note, unless I'm mistaken, it seems that Three's glTF Viewer also does not respect the specs, as it seem to never tile the occlusionTexture and tile all other maps based on the baseColorTexture KHR_texture_transform values.)

GLTF_ERROR_JSON_PARSE

I tried Khronos glTF sample, and also blender default cube but I still get an error when converting to usdz.

I get an error when I run this command:
./usd_from_gltf test.gltf test.usdz

Error:
ERROR: Failed parsing JSON: [json.exception.parse_error.101] parse error at line 7, column 1: syntax error while parsing value - invalid literal; last read: '<U+000A><U+000A><U+000A><U+000A><U+000A><U+000A><' [GLTF_ERROR_JSON_PARSE]

Error while installing usd_from_gltf: DRACO: ERROR: [Error 2] The system cannot find the file specified

I'm at a loss for where to begin debugging this error, given that the missing file isn't specified. Hoping at first for suggestions.


C:\Users\neoke>python .\usd_from_gltf\tools\ufginstall\ufginstall.py .\usd_from_gltf_build .\usd-20-11-win64_py27_release --testdata
Install Settings:
  Source Directory:   C:\Users\neoke\usd_from_gltf
  Install Directory:  C:\Users\neoke\usd_from_gltf_build
  USD Directory:      C:\Users\neoke\usd-20-11-win64_py27_release
  Download Directory: C:\Users\neoke\usd_from_gltf_build\src
  Build Directory:    C:\Users\neoke\usd_from_gltf_build\build
  Build Config:       Release
  CMake Generator:    Default
  Already Installed:  <none>
  Installing:         DRACO, GIF, JPG, JSON, ZLIB, PNG, STB_IMAGE, TCLAP, TESTDATA_SAMPLES, TESTDATA_REFERENCE, USD_FROM_GLTF

-------- Installing DRACO --------
  DRACO: File already exists, skipping download: C:\Users\neoke\usd_from_gltf_build\src\draco.zip
  DRACO: Unpacking to: C:\Users\neoke\usd_from_gltf_build\src\draco-1.3.5
  DRACO: CWD: C:\Users\neoke\usd_from_gltf_build\build\draco-1.3.5
  DRACO: Run: cmake C:\Users\neoke\usd_from_gltf_build\src\draco-1.3.5 -DCMAKE_INSTALL_PREFIX=C:\Users\neoke\usd_from_gltf_build -DCMAKE_PREFIX_PATH=C:\Users\neoke\usd_from_gltf_build -DCMAKE_POSITION_INDEPENDENT_CODE=1 -DCMAKE_GENERATOR_PLATFORM=x64
  DRACO: ERROR: [Error 2] The system cannot find the file specified

Installation fails with undefined reference

On Ubuntu 16.04, USD and all other dependencies installed successfully but i'm getting the following:

cmake /home/julien/usd_from_gltf -DCMAKE_INSTALL_PREFIX=/usr/local/usd_from_gltf -DCMAKE_PREFIX_PATH=/usr/local/usd_from_gltf -DUSD_DIR=/usr/local/USD
-- The C compiler identification is GNU 7.5.0
-- The CXX compiler identification is GNU 7.5.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Configuring done
-- Generating done
-- Build files have been written to: /usr/local/usd_from_gltf/build/usd_from_gltf

cmake --build . --config Release --target install --
Scanning dependencies of target gltf
[  2%] Building CXX object gltf/CMakeFiles/gltf.dir/internal_util.cc.o
[  4%] Building CXX object gltf/CMakeFiles/gltf.dir/load.cc.o
[  7%] Building CXX object gltf/CMakeFiles/gltf.dir/memory_stream.cc.o
[  9%] Building CXX object gltf/CMakeFiles/gltf.dir/message.cc.o
[ 11%] Building CXX object gltf/CMakeFiles/gltf.dir/stream.cc.o
[ 14%] Building CXX object gltf/CMakeFiles/gltf.dir/validate.cc.o
[ 16%] Building CXX object gltf/CMakeFiles/gltf.dir/cache.cc.o
[ 19%] Building CXX object gltf/CMakeFiles/gltf.dir/disk_stream.cc.o
[ 21%] Building CXX object gltf/CMakeFiles/gltf.dir/disk_util.cc.o
[ 23%] Building CXX object gltf/CMakeFiles/gltf.dir/glb_stream.cc.o
[ 26%] Building CXX object gltf/CMakeFiles/gltf.dir/gltf.cc.o
[ 28%] Building CXX object gltf/CMakeFiles/gltf.dir/image_parsing.cc.o
/home/julien/usd_from_gltf/gltf/image_parsing.cc:313:23: warning: multi-character character constant [-Wmultichar]
     if (chunk.type != 'IHDR') {
                       ^~~~~~
[ 30%] Linking CXX static library libgltf.a
[ 30%] Built target gltf
Scanning dependencies of target common
[ 33%] Building CXX object common/CMakeFiles/common.dir/config.cc.o
[ 35%] Building CXX object common/CMakeFiles/common.dir/logging.cc.o
[ 38%] Building CXX object common/CMakeFiles/common.dir/platform.cc.o
[ 40%] Linking CXX static library libcommon.a
[ 40%] Built target common
Scanning dependencies of target process
[ 42%] Building CXX object process/CMakeFiles/process.dir/math.cc.o
[ 45%] Building CXX object process/CMakeFiles/process.dir/mesh.cc.o
[ 47%] Building CXX object process/CMakeFiles/process.dir/process_util.cc.o
[ 50%] Building CXX object process/CMakeFiles/process.dir/skin.cc.o
[ 52%] Building CXX object process/CMakeFiles/process.dir/animation.cc.o
[ 54%] Building CXX object process/CMakeFiles/process.dir/color.cc.o
[ 57%] Building CXX object process/CMakeFiles/process.dir/float_image.cc.o
[ 59%] Building CXX object process/CMakeFiles/process.dir/image.cc.o
[ 61%] Building CXX object process/CMakeFiles/process.dir/image_fallback.cc.o
[ 64%] Building CXX object process/CMakeFiles/process.dir/image_gif.cc.o
[ 66%] Building CXX object process/CMakeFiles/process.dir/image_jpg.cc.o
[ 69%] Building CXX object process/CMakeFiles/process.dir/image_png.cc.o
[ 71%] Linking CXX static library libprocess.a
[ 71%] Built target process
Scanning dependencies of target convert
[ 73%] Building CXX object convert/CMakeFiles/convert.dir/tokens.cc.o
[ 76%] Building CXX object convert/CMakeFiles/convert.dir/convert_util.cc.o
[ 78%] Building CXX object convert/CMakeFiles/convert.dir/converter.cc.o
[ 80%] Building CXX object convert/CMakeFiles/convert.dir/materializer.cc.o
[ 83%] Building CXX object convert/CMakeFiles/convert.dir/package.cc.o
[ 85%] Building CXX object convert/CMakeFiles/convert.dir/texturator.cc.o
[ 88%] Linking CXX static library libconvert.a
[ 88%] Built target convert
Scanning dependencies of target usd_from_gltf
[ 90%] Building CXX object usd_from_gltf/CMakeFiles/usd_from_gltf.dir/args.cc.o
[ 92%] Building CXX object usd_from_gltf/CMakeFiles/usd_from_gltf.dir/usd_from_gltf.cc.o
[ 95%] Linking CXX executable usd_from_gltf
/usr/local/USD/lib/libusdUtils.so: undefined reference to `pxrInternal_v0_20__pxrReserved__::Sdf_Children<pxrInternal_v0_20__pxrReserved__::Sdf_VariantSetChildPolicy>::FindKey[abi:$
collect2: error: ld returned 1 exit status
usd_from_gltf/CMakeFiles/usd_from_gltf.dir/build.make:127: recipe for target 'usd_from_gltf/usd_from_gltf' failed
make[2]: *** [usd_from_gltf/usd_from_gltf] Error 1
CMakeFiles/Makefile2:331: recipe for target 'usd_from_gltf/CMakeFiles/usd_from_gltf.dir/all' failed
make[1]: *** [usd_from_gltf/CMakeFiles/usd_from_gltf.dir/all] Error 2
Makefile:148: recipe for target 'all' failed
make: *** [all] Error 2

cmake /home/julien/usd_from_gltf -DCMAKE_INSTALL_PREFIX=/usr/local/usd_from_gltf -DCMAKE_PREFIX_PATH=/usr/local/usd_from_gltf -DUSD_DIR=/usr/local/USD
-- Configuring done
-- Generating done
-- Build files have been written to: /usr/local/usd_from_gltf/build/usd_from_gltf

cmake --build . --config Release --target install --
[ 30%] Built target gltf
[ 40%] Built target common
[ 71%] Built target process
[ 88%] Built target convert
[ 90%] Linking CXX executable usd_from_gltf
/usr/local/USD/lib/libusdUtils.so: undefined reference to `pxrInternal_v0_20__pxrReserved__::Sdf_Children<pxrInternal_v0_20__pxrReserved__::Sdf_VariantSetChildPolicy>::FindKey[abi:$
collect2: error: ld returned 1 exit status
usd_from_gltf/CMakeFiles/usd_from_gltf.dir/build.make:127: recipe for target 'usd_from_gltf/usd_from_gltf' failed
make[2]: *** [usd_from_gltf/usd_from_gltf] Error 1
CMakeFiles/Makefile2:331: recipe for target 'usd_from_gltf/CMakeFiles/usd_from_gltf.dir/all' failed
make[1]: *** [usd_from_gltf/CMakeFiles/usd_from_gltf.dir/all] Error 2
Makefile:148: recipe for target 'all' failed
make: *** [all] Error 2

Any idea how to solve this?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.