3212 Commits

Author SHA1 Message Date
Syoyo Fujita
960dba34fa Merge pull request #266 from lighttransport/fix-openusd-windows-filename
Fix Windows OpenUSD binary filename pattern in CI
2026-01-11 01:20:22 +09:00
Syoyo Fujita
d308b9204b Fix usdcat verification - use --help instead of --version
usdcat doesn't support --version flag. It requires input files and
exits with error "inputFiles is required" when run without arguments.

Changed all verification steps to use `usdcat --help` which properly
displays the help text and exits with success.
2026-01-11 00:13:27 +09:00
Syoyo Fujita
7b4d1b04fb Fix OpenUSD binary extraction and environment setup in CI workflows
The OpenUSD release archives extract files directly to the current
directory (./bin/, ./lib/, etc.) rather than creating a top-level
directory. This fixes extraction and environment setup for all platforms:

**Changes:**
1. Extract archives into a named 'openusd' directory
2. Manually set all required environment variables:
   - PATH: Add bin, lib (Windows), and tbb/bin directories
   - LD_LIBRARY_PATH/DYLD_LIBRARY_PATH: Add lib and tbb/lib directories
   - PYTHONPATH: Add lib/python directory
   - PXR_PLUGINPATH_NAME: Set to lib/usd

**Fixes:**
- Windows: usdcat not found in PATH (bin directory not added)
- macOS: libtbb.12.dylib not found (DYLD_LIBRARY_PATH missing tbb/lib)
- Linux: Ensure TBB libraries are in LD_LIBRARY_PATH

All platforms now properly configure the environment to use the bundled
TBB libraries included in the release packages.
2026-01-10 23:39:22 +09:00
Syoyo Fujita
a7a009854e Fix Windows OpenUSD binary filename pattern in CI
Update the OpenUSD binary download pattern to match the actual release
artifact naming:
- Old: openusd-*-minsizerel-win64.zip
- New: openusd-*-minsizerel-windows-x86_64.zip

This matches the naming convention used in openusd-bin releases where
platform names follow GitHub Actions standard identifiers
(windows-x86_64, linux-x86_64, etc).

Fixes the "no assets match the file pattern" error in Windows CI.
2026-01-10 22:29:36 +09:00
Syoyo Fujita
60b617295e Add libtbb12 installation back for OpenUSD tests
Despite TBB being included in the OpenUSD binary package, the system
still requires libtbb12 to be installed for proper library resolution.
This ensures usdcat and other OpenUSD binaries can find libtbb.so.12.

Fixes failure in workflow run #20869757118.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-10 10:47:10 +09:00
Syoyo Fujita
e465c29d23 Remove TBB installation step from Linux CI
TBB library is now included in the OpenUSD binary package
(as of lighttransport/openusd-bin@4f2eda3), so separate
installation is no longer needed.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-10 09:37:33 +09:00
Syoyo Fujita
7fd278fa8d Fix OpenUSD binary download and dependency issues in Linux CI
- Fix ARM64 binary pattern: change aarch64 to arm64 to match actual release filename
- Add libtbb12 installation for x86_64 build to resolve missing libtbb.so.12 error

These changes fix the failures in workflow run #20866500999 where:
1. ARM64 build failed with "no assets match the file pattern"
2. x86_64 build failed with "error while loading shared libraries: libtbb.so.12"

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-10 07:05:38 +09:00
Syoyo Fujita
606729bbc5 Add OpenUSD binary interoperability testing to CI workflows
Downloads prebuilt OpenUSD binaries from lighttransport/openusd-bin
and tests TinyUSDZ output compatibility with official OpenUSD tools.
Validates that TinyUSDZ-generated USDA files can be read by OpenUSD's
usdcat. Tests run on Linux (x64/ARM64), macOS ARM64, and Windows x64.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-10 06:45:56 +09:00
Syoyo Fujita
744f6fcc8f Fix undefined behavior in parse_int and add UBSan build script
Fix signed integer overflow when parsing INT_MIN (-2147483648) by
negating in int64_t space before casting to int32_t. The previous
code attempted to negate the result after casting, which is undefined
behavior for INT_MIN.

Also add bootstrap-cmake-linux-ubsan.sh for UBSan builds.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-09 07:50:28 +09:00
Syoyo Fujita
9372bf99af Remove gdb/lldb debugging from ARM64 CI now that segfault is fixed
Revert to running tusdcat directly without debuggers. The ARM64 pointer
sign-extension bug has been fixed in the previous commit.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-08 12:56:38 +09:00
Syoyo Fujita
fc2b4718d6 Fix ARM64 segfault: remove sign extension for non-x86-64 architectures
The TypedArray::get() function was incorrectly sign-extending 48-bit
packed pointers on ARM64. On x86-64, user space addresses never have
bit 47 set, so sign extension is correct. However, on ARM64 user space
addresses CAN have bit 47 set (0x0000... to 0x0000FFFF...).

When an ARM64 address like 0x0000aaaaab7520d0 was stored and retrieved,
the sign extension converted it to 0xFFFFaaaaab7520d0 (kernel space),
causing SIGSEGV when accessed.

Fix: Only apply sign extension on x86-64 where canonical addresses
require it.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-08 12:39:41 +09:00
Syoyo Fujita
0eff85acd7 Run ARM64 tusdcat tests under gdb/lldb to catch segfault backtrace
- Build with Debug mode for better stack traces
- Install gdb for gcc build, lldb-21 for clang build
- Run tusdcat under debugger to capture backtrace on crash
- Clean up duplicate steps from earlier merge

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-08 12:19:28 +09:00
Syoyo Fujita
226e17facd Add ARM64 ASan build to debug segfaults in USDC timesamples parsing
Build with AddressSanitizer enabled on ARM64 runner to help identify
the root cause of segmentation faults in timesamples USDC file parsing.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-08 12:08:12 +09:00
Syoyo Fujita
0cc7674660 Merge branch 'dev' of github.com:lighttransport/tinyusdz into dev 2026-01-08 11:55:33 +09:00
Syoyo Fujita
529ea06372 Add dedicated USDC timesamples tests and artifact upload to ARM64 CI
Add explicit tusdcat tests for USDC timesamples files that have shown
parsing issues on ARM64 runners. Also upload ARM64 tusdcat binaries as
artifacts for testing in other environments (e.g., QEMU).

Run order: artifact upload -> tusdcat tests -> ctest, so that artifacts
are available even if subsequent tests fail.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-08 11:53:47 +09:00
Syoyo Fujita
18192b3dfb Add dedicated USDC timesamples tests and artifact upload to ARM64 CI
Add explicit tusdcat tests for USDC timesamples files that have shown
parsing issues on ARM64 runners. Also upload ARM64 tusdcat binaries as
artifacts for testing in other environments (e.g., QEMU).

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-08 11:38:12 +09:00
Syoyo Fujita
f125219349 Merge branch 'anim-mtlx-phase3-fix' into dev 2026-01-08 11:17:05 +09:00
Syoyo Fujita
2321baa36d Merge branch 'anim-mtlx-phase3-fix' of github.com:lighttransport/tinyusdz into anim-mtlx-phase3-fix 2026-01-08 11:16:55 +09:00
Syoyo Fujita
160aab95fb Update ARM64 CI to Ubuntu 24.04 and fix bootstrap script defaults
- Update ARM64 runners from ubuntu-22.04-arm to ubuntu-24.04-arm
- Update LLVM apt repository from jammy to noble for Ubuntu 24.04
- Remove clang default from bootstrap-cmake-linux.sh; now uses
  system default compiler unless CC/CXX are explicitly set

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-08 11:11:24 +09:00
Syoyo Fujita
b346c33cd3 Merge branch 'anim-mtlx-phase3-fix' into dev 2026-01-08 10:08:56 +09:00
Syoyo Fujita
e1e7259427 Merge branch 'anim-mtlx-phase3-fix' of github.com:lighttransport/tinyusdz into anim-mtlx-phase3-fix 2026-01-08 10:08:49 +09:00
Syoyo Fujita
39a9a656a3 Fix bootstrap-cmake-linux.sh to respect CC/CXX environment variables
The script was hardcoding CXX=clang++ CC=clang, ignoring any
user-provided environment variables. Now uses shell parameter
expansion to default to clang only if CC/CXX are not already set.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-08 10:04:16 +09:00
Syoyo Fujita
94832126eb Merge branch 'anim-mtlx-phase3-fix' into dev 2026-01-08 09:09:04 +09:00
Syoyo Fujita
e1b35b3038 Merge branch 'anim-mtlx-phase3-fix' of github.com:lighttransport/tinyusdz into anim-mtlx-phase3-fix 2026-01-08 09:08:57 +09:00
Syoyo Fujita
9422931843 Add GCC build and update Clang to v21 for ARM64 Linux CI
- Split build-arm64 into build-arm64-gcc and build-arm64-clang
- build-arm64-gcc: Uses system GCC on Ubuntu 22.04 ARM
- build-arm64-clang: Installs Clang 21 from LLVM apt repository
  (previously used system Clang 14 which is outdated)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-08 08:57:30 +09:00
Syoyo Fujita
09a1d629df Merge branch 'dev' of github.com:lighttransport/tinyusdz into dev 2026-01-08 07:05:17 +09:00
Syoyo Fujita
0b773e83cf Merge branch 'anim-mtlx-phase3-fix' of github.com:lighttransport/tinyusdz into anim-mtlx-phase3-fix 2026-01-08 07:04:04 +09:00
Syoyo Fujita
352c9fa708 suppress compiler warnings. 2026-01-08 07:03:22 +09:00
Syoyo Fujita
8834878173 Fix timeSamples pprint for array types and add bounds checking
- Fix move constructor/assignment operator to transfer value array storage
  fields (_value_array_storage, _value_array_refs, _use_value_array)
- Fix copy constructor/assignment operator for value array storage fields
- Add bounds checking for blocked[] and offsets[] array access in pprint
- Strip TYPE_ID_1D_ARRAY_BIT before type lookup in print_pod_value_dispatch
  and get_pod_type_size to handle array element types correctly
- Add handler for value array storage path in get_samples()
- Set _use_pod=false when using value array storage

This fixes the "Unknown type_id: 1048618" error when printing array-typed
timeSamples (e.g., color3f[]) and prevents heap-buffer-overflow when
printing timeSamples with None values.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-08 07:02:27 +09:00
Syoyo Fujita
eed0b84e01 Merge branch 'dev' of github.com:syoyo/tinyusdz into dev 2026-01-08 05:02:24 +09:00
Syoyo Fujita
896303432e fix MSVC warnings and Win32 build
- CMakeLists.txt: Skip libatomic linking on MSVC (atomics built into runtime)
- crate-reader.cc: Use std::transform with explicit cast to fix C4244 warning
- pprinter.cc: Remove duplicate to_string(DomeLight::TextureFormat) to fix LNK4006

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-08 04:47:00 +09:00
Syoyo Fujita
a79c8530c2 fix clang warning for unknown warning option in threejs-exporter.hh
Add -Wunknown-warning-option suppression before -Wdeprecated-literal-operator
to prevent build errors on clang versions that don't recognize the latter.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-08 04:33:09 +09:00
Syoyo Fujita
3c1b1735b7 raise C++ version requirement from C++14 to C++17
Update all CMakeLists.txt, Makefiles, meson.build, setup.py,
and documentation files to use C++17 standard.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-08 03:39:41 +09:00
Syoyo Fujita
ee72c871cd fix build errors on MSVC
- task-queue.hh: Use mutex fallback on MSVC (no GCC __atomic_* builtins)
- shape-to-mesh.hh: Use kPI/kPI_2 constants instead of M_PI/M_PI_2
- tinyexr_c_impl.c: Use Windows Interlocked functions for MSVC C mode
- unit-task-queue.cc: Fix lambda capture for MSVC

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-08 01:05:13 +09:00
Syoyo Fujita
598839897a fix build errors on macOS
- Update _POSIX_C_SOURCE from 199309L to 200112L for vsnprintf/snprintf
- Silence unused parameter warning in serializePreviewSurfaceToJson

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-08 00:17:49 +09:00
Syoyo Fujita
37ab7b515d Merge branch 'anim-mtlx-phase3' of github.com:lighttransport/tinyusdz into anim-mtlx-phase3 2026-01-07 07:28:34 +09:00
Syoyo Fujita
f7ec005ef1 Merge branch 'release' into dev 2026-01-07 06:58:28 +09:00
Syoyo Fujita
50834c9c14 Merge branch 'dev' of github.com:lighttransport/tinyusdz into dev 2026-01-07 06:55:55 +09:00
Syoyo Fujita
f017d061bd add license term 2026-01-07 06:55:43 +09:00
Syoyo Fujita
c6ace402dc Add granular coroutine yield phases for Tydra conversion
- Remove debug console.log statements from coroutine helpers
- Split Tydra conversion into multiple phases with yields:
  - detecting: Format detection
  - parsing: USD parsing
  - setup: Converter environment setup
  - assets: Asset resolution setup
  - meshes: Tydra mesh conversion
  - complete: Done

- Each phase yields to event loop, allowing browser repaints
- Update progress-demo.js phase mapping with descriptive messages
- The Tydra ConvertToRenderScene call is still blocking, but yields
  occur before and after it

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-07 04:13:51 +09:00
Syoyo Fujita
f6c9ad1d44 Use coroutine async loading in progress-demo.js with debug logging
- Add console.log debug prints at yield points in binding.cc:
  - Log when yielding to event loop
  - Log when resuming from yield (rAF or setTimeout)
  - Log phase name and progress percentage

- Add hasAsyncSupport() method to TinyUSDZLoader.js:
  - Checks if loadFromBinaryAsync is available
  - Returns true if WASM was built with TINYUSDZ_WASM_COROUTINE=ON

- Update progress-demo.js to use coroutine async when available:
  - Check hasAsyncSupport() before loading
  - Use parseAsync() for file and URL loading when available
  - Fall back to standard Promise-based loading if not
  - Map coroutine phases to progress UI stages
  - Manual fetch with progress for URL loading in async mode

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-07 03:40:00 +09:00
Syoyo Fujita
c66a71428e Add TINYUSDZ_WASM_COROUTINE cmake option for C++20 coroutine async loading
- Add CMake option TINYUSDZ_WASM_COROUTINE (default OFF) to enable/disable
  C++20 coroutine-based async loading
- Add TINYUSDZ_USE_COROUTINE compile definition for conditional compilation
- Wrap coroutine helper functions (yieldToEventLoop, reportAsyncPhaseStart)
  with #if defined(TINYUSDZ_USE_COROUTINE)
- Wrap loadFromBinaryAsync method with #if defined(TINYUSDZ_USE_COROUTINE)
- Wrap EMSCRIPTEN_BINDINGS registration with same guard

To enable coroutine support:
  cmake .. -DTINYUSDZ_WASM_COROUTINE=ON

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-07 00:40:52 +09:00
Syoyo Fujita
9d58ccc7ed Add C++20 coroutine-based async USD loading with browser yield support
- Add yieldToEventLoop() helper using EM_JS that returns a Promise for requestAnimationFrame
- Implement loadFromBinaryAsync() coroutine that yields between processing phases:
  - detecting: format detection
  - parsing: USD parsing
  - converting: Tydra conversion
  - complete: done
- Add reportAsyncPhaseStart() EM_JS callback for JS progress tracking
- Add parseAsync() and loadAsync() methods to TinyUSDZLoader.js
- Parameters passed by value (not reference) to survive co_await suspension points
- No ASYNCIFY required - uses native LLVM coroutine transform

This allows the browser to repaint between processing phases, improving
perceived loading performance for large USD files.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-07 00:22:07 +09:00
Syoyo Fujita
3b4bf5a687 update html file.
revert to use fancy-teapot for materialx.js demo.
2026-01-06 08:08:30 +09:00
Syoyo Fujita
abd5d28771 Add delayed texture loading with progress bar for faster initial scene render
- Add TextureLoadingManager class for queuing and progressive texture loading
- Add texture progress bar UI (bottom overlay with green theme)
- Modify buildSceneWithProgress to use delayed texture mode
- Scene renders immediately without textures, then textures load in background
- Support textureLoadingManager option in material conversion functions
- Update TinyUSDZMaterialX.js to support delayed loading for OpenPBR materials
- Textures load with concurrency control (2 at a time) and browser yields

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-06 07:46:03 +09:00
Syoyo Fujita
4366fdd2f1 Fix HDRI light visibility in envmap mode and improve light transform controls
- Fix lights disappearing from HDRI on refresh in envmap mode by using
  lightData.enabled (user's intention) instead of threeLights.visible
  (rendering state) for HDRI projection filtering
- Update toggleLight() to respect envmap mode - keep lights hidden for
  rendering while still allowing on/off toggling for HDRI purposes
- Fix setLightingMode() to restore lights based on user's enabled state
  when switching back to lights mode
- Fix SpotLight rotation gizmo position by resetting light.position to
  (0,0,0) after creation (Three.js r146+ defaults to (0,1,0))
- Add getAttachTargetForLight() for proper transform control attachment
  based on mode (translate/rotate/scale -> group, target -> target object)
- Add minHdriRadius (0.3) for HDRI projection to ensure lights are visible
- Improve light picking to skip disabled/invisible helpers
- Add drag state management to prevent picking different object after drag

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-06 06:58:19 +09:00
Syoyo Fujita
dc6dc91c85 Update Env Intensity GUI from DomeLight settings
- Add envIntensityController to guiState for GUI updates
- Update Env Intensity display when loading DomeLight from USD
- Update Env Intensity display when switching to usd_dome environment

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-06 04:13:33 +09:00
Syoyo Fujita
7ba445a9cb Add normal map support for UsdPreviewSurface and enhance Show Normals feature
- Export normalTextureId, occlusionTextureId, displacementTextureId in
  material-serializer.cc for UsdPreviewSurface materials
- Fix TinyUSDZLoaderUtils.js to properly extract surfaceShader from
  nested JSON structure
- Add Normal Mode selector (geometry/mapped) to Show Normals feature
- Add createViewNormalMaterial() shader for view-space normals with
  normal map support
- Add extractNormalMapFromMaterial() to extract normal maps from both
  OpenPBR/MaterialX and UsdPreviewSurface materials
- Make Env Color and Env Colorspace controls disabled when Environment
  is not constant_color

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-06 04:03:01 +09:00
Syoyo Fujita
73d7a8aa69 Add CLI test for EM_JS progress callbacks
- Add test-progress-cli.js with synthetic USD generation and file tests
- Tests verify EM_JS onTydraProgress callbacks work in Node.js
- Generates USDA on-the-fly (3 meshes, 10 meshes, mixed geometry)
- Loads real USD files (usda, usdc, usdz) with progress tracking
- Add npm script: npm run test:progress

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-05 23:59:46 +09:00
Syoyo Fujita
d04efdf8d3 Add EM_JS synchronous progress callbacks for Tydra conversion
- Add EM_JS functions in binding.cc for direct C++ to JS progress reporting
  - reportTydraProgress: mesh conversion progress (current/total, stage, name)
  - reportTydraStage: conversion stage changes
  - reportTydraComplete: conversion completion with counts
- Update TinyUSDZLoader.js with callback options:
  - onTydraProgress, onTydraStage, onTydraComplete
  - setTydraProgressCallback/setTydraStageCallback/setTydraCompleteCallback methods
- Integrate callbacks in progress-demo.js for real-time UI updates
- Add design document for JS/WASM synchronous event update patterns

This enables real-time progress updates during Tydra scene conversion
without requiring ASYNCIFY, using Emscripten's EM_JS for synchronous
JavaScript calls from C++.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-04 22:41:47 +09:00