Skip to content

(Assimp) Syncing fork.#1

Open
innerviewer wants to merge 893 commits intoSpaRcle-Studio:masterfrom
assimp:master
Open

(Assimp) Syncing fork.#1
innerviewer wants to merge 893 commits intoSpaRcle-Studio:masterfrom
assimp:master

Conversation

@innerviewer
Copy link
Copy Markdown
Member

@innerviewer innerviewer commented Jun 26, 2024

Summary by CodeRabbit

  • New Features

    • Prebuilt multi‑platform binaries, automated release publishing and a Windows installer; new CMake presets; opt‑in importers (USD, M3D, VRML); Draco and ccache build options; 3MF per‑vertex color‑group support.
  • Bug Fixes

    • Improved importer robustness, bounds‑aware parsing, safer memory handling and many format‑specific stability fixes; expanded DXF color support.
  • Documentation

    • Revised README, build/install guidance and security docs; changelog removed/streamlined.
  • Chores

    • CI/workflow overhaul for releases/caching; Docker, packaging and whitespace/format tidy.

✏️ Tip: You can customize this high-level summary in your review settings.

@innerviewer
Copy link
Copy Markdown
Member Author

Currently there's an issue with Tsumugi model. Other models load fine. Before merging, we should check if the issue persists with other models.
image

tyler92 and others added 29 commits December 25, 2024 20:19
Co-authored-by: Kim Kulling <kimkulling@users.noreply.github.com>
The docs talked about the importer, but no importer exists in the
context of calling this function. It seems like the docs may have been
accidentally copied from somewhere else.
I copied the docs from another import function within the same file.
This seems reasonable because the implementations of both functions
suggest they work the same way: the function creates the importer and
sets it into the scene private data so that the later release call can
release the importer.

Co-authored-by: Kim Kulling <kimkulling@users.noreply.github.com>
Co-authored-by: Kim Kulling <kimkulling@users.noreply.github.com>
- Introduce VRML format (.wrl and .x3dv) 3D model support
- Add samples
---------

Co-authored-by: Steve M <praktique-tellypresence@yahoo.com>
Co-authored-by: Kim Kulling <kimkulling@users.noreply.github.com>
Co-authored-by: Kim Kulling <kimkulling@users.noreply.github.com>
While one of the throws in the function did indeed close the open stream,
several didn't.

Co-authored-by: Kim Kulling <kimkulling@users.noreply.github.com>
Co-authored-by: Kim Kulling <kim.kulling@draeger.com>
* Refactorings: Code cleanups

* More cosmetic changes

---------

Co-authored-by: Kim Kulling <kim.kulling@draeger.com>
Co-authored-by: Dwayne Coussement <dwayne.coussement@showpad.com>
Co-authored-by: Kim Kulling <kimkulling@users.noreply.github.com>
* Fix texture mapping

---------

Co-authored-by: Steve M <praktique-tellypresence@yahoo.com>
Co-authored-by: Kim Kulling <kimkulling@users.noreply.github.com>
* [FBX] Allow export multi materials per node

Previously it was assumed that each node would export a single material. This removes that
assumption, and also allows for exporting multiple meshes with a single node. Previously they
would each be seprated into their own node.

* Support for animations with multiple meshes too

---------

Co-authored-by: Kim Kulling <kimkulling@users.noreply.github.com>
* Fix unknown pragma error on msys2 mingw

* Fix missing assignment operator on msys2 mingw

Default is omitted by compiler because custom copy constructor

* Fix redefinition of _1 and _2 error on msys2 mingw

fix is converting it to lambda as clang is claiming that is
preferred

* Fix strncpy warnings about truncation

* Fix missing assignment operator error on clang

* Update glTFImporter.cpp

* Update glTF2Importer.cpp

---------

Co-authored-by: Kim Kulling <kimkulling@users.noreply.github.com>
* Prefix MTL textures with the MTL directory path.

Path to textures defined in MTL files are relative to the MTL
file rather than to the OBJ, so we need to prefix them with the
MTL file directory path.

* Adding test issue 2355

* Trying to fix for Windows when file has Linux path

---------

Co-authored-by: Kim Kulling <kimkulling@users.noreply.github.com>
Co-authored-by: Kim Kulling <kimkulling@users.noreply.github.com>
* added gltf extension KHR_materials_anisotropy

* Update glTF2Importer.cpp

---------

Co-authored-by: lutz.hoeren <lutz.hoeren@redplant.de>
Co-authored-by: Kim Kulling <kimkulling@users.noreply.github.com>
This commit fixes a set of warnings from the latest version of CMake:

(ADD_CUSTOM_COMMAND):
  Exactly one of PRE_BUILD, PRE_LINK, or POST_BUILD must be given.  Assuming
  POST_BUILD to preserve backward compatibility.

  Policy CMP0175 is not set: add_custom_command() rejects invalid arguments.
  Run "cmake --help-policy CMP0175" for policy details.  Use the cmake_policy
  command to set the policy and suppress this warning.
This warning is for project developers.  Use -Wno-dev to suppress it.
Co-authored-by: Kim Kulling <kimkulling@users.noreply.github.com>
Co-authored-by: Kim Kulling <kimkulling@users.noreply.github.com>
* Introduce gltf metallic-roughness texture type

* Add to unit test, add doc citation

---------

Co-authored-by: Steve M <praktique-tellypresence@yahoo.com>
* fix: reduce gltf2 export time

* fix: use std::less<> in std::map

---------

Co-authored-by: huangxinchuang <huangxinchuang@pointcode.com>
Co-authored-by: Kim Kulling <kimkulling@users.noreply.github.com>
Co-authored-by: Kim Kulling <kimkulling@users.noreply.github.com>
Clean code

Co-authored-by: Kim Kulling <kimkulling@users.noreply.github.com>
ShikenNuggets and others added 30 commits February 23, 2026 21:26
…6541)

Co-authored-by: Kim Kulling <kimkulling@users.noreply.github.com>
* Update supported version in SECURITY.md

- Preparation for bugfix release v6.0.5

* Update CMakeLists.txt

* Update aiGetVersionPatch test to expect version 5
…imation keys (#6543)

fix(gltf2): preserve interpolation type and CubicSpline tangents

The glTF2 importer previously ignored the mInterpolation field and discarded
CubicSpline tangent data, leading to incorrect animation playback.

- Implement MapInterpolation() to map glTF2 interpolation types to Assimp.
- Set mInterpolation for all aiVectorKey and aiQuatKey instances.
- For CUBICSPLINE samplers, store [in-tangent, value, out-tangent] triplets
  (N x 3 keys) instead of discarding tangents.
- Fixes rendering consistency for InterpolationTest.glb where STEP, LINEAR,
  and CUBICSPLINE rows previously rendered identically.

Affected channels: mPositionKeys, mRotationKeys, mScalingKeys.

Co-authored-by: Kim Kulling <kimkulling@users.noreply.github.com>
Bumps [actions/download-artifact](https://github.com/actions/download-artifact) from 7 to 8.
- [Release notes](https://github.com/actions/download-artifact/releases)
- [Commits](actions/download-artifact@v7...v8)

---
updated-dependencies:
- dependency-name: actions/download-artifact
  dependency-version: '8'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: tellypresence <info@tellypresence.com>
Added a comprehensive AI Tool Use Policy outlining guidelines for contributors on using AI tools, ensuring human oversight and accountability in contributions.
- closes #6538
* Refactor material system

* Fix sonarqube finding
The `GetVertexColorsForType` function previously used `input->count`
(the total number of elements in the accessor) to allocate the output
array and bound the conversion loop. However, when a
`vertexRemappingTable` is provided, `ExtractData` extracts a subset of
elements matching the size of the remapping table rather than the full
accessor count.

In cases where the remapping table was smaller than the accessor count
(including empty tables), the subsequent loop would perform
out-of-bounds reads on the `colors` buffer allocated by `ExtractData`.

This fix captures the actual number of elements extracted by
`ExtractData` and uses this value for the output allocation and loop
iteration, ensuring memory safety when vertex remapping is active.

Verified with ASan and existing unit tests.
Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 6 to 7.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](actions/upload-artifact@v6...v7)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-version: '7'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Kim Kulling <kimkulling@users.noreply.github.com>
* initial commit

* remove unused function
Fixes bug introduced in d1b73df, where min was always set to DBL_MIN

Co-authored-by: Kim Kulling <kimkulling@users.noreply.github.com>
Co-authored-by: Kim Kulling <kimkulling@users.noreply.github.com>
Co-authored-by: Kim Kulling <kimkulling@users.noreply.github.com>
* Fix conditional check in SkipSpaces function to prevent out-of-bound access.

The `SkipSpaces` function's condition was updated to ensure that the pointer check `in != end` is evaluated before dereferencing the pointer. This change prevents potential out-of-bound access when the input pointer reaches the end.

* Avoid input is wrong

* Fix all in != end

* Fix some minor bugs

* Change size to capacity

* Obj: Fix unittest
* Add inline to ai_epsilon to avoid ODR violations
---------

Co-authored-by: Kim Kulling <kimkulling@users.noreply.github.com>
When compiling with -march=znver4 (or any arch with FMA), GCC's default
-ffp-contract=fast contracts a*b+c into FMA opportunistically. The same
inline math function compiled in the shared library and in the test
binary can get different FMA contraction decisions due to different
optimization contexts, producing bit-different FP results.

Three API tests compare C++ direct calls (inlined into test TU) against
C API wrapper calls (through libassimp.so) using EXPECT_EQ (bit-exact),
which fails when the compiler contracts differently across TUs.

Verified via disassembly: the library uses vfnmadd FMA instructions
(3 roundings) while the test binary uses separate vmulss+vsubss
(6 roundings) for the same computation.

Replace EXPECT_EQ with Equal(epsilon) for the three affected tests:
- aiMatrix3FromToTest: use machine epsilon (~1.19e-7)
- aiMatrix4FromToTest: use machine epsilon (~1.19e-7)
- aiQuaternionFromNormalizedQuaternionTest: use 1e-4 because FMA
  differences in 1.0-x*x-y*y-z*z can flip a near-zero residual's sign,
  causing w=0 vs w=sqrt(tiny)≈1e-4

Fixes #6246

Co-authored-by: Chris de Claverie <declaverie@gmail.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: Kim Kulling <kimkulling@users.noreply.github.com>
* Add files for assimp rust wrapper

* Fix bindgen usage.

* Add missing includes for the rust bindings.

* Apply suggestion from @coderabbitai[bot]

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* Update build.rs

* Fix formatting in Cargo.toml

* Remove generated file

---------

Co-authored-by: Kim Kulling <kullingk@LDED5178.corp.draeger.global>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
…uildMeshesForNode` (#6575)

The root cause was an unchecked access to the `newMats` vector using `matIdx`.
When a material name (`meshMaterial`) is not found in `mMaterialIndexByName`,
`matIdx` defaults to 0.  If `newMats` is empty (which happens if the material
library is empty or failed to load), accessing `newMats[0]` results in a
container-overflow.

The fix involves adding a bounds check `matIdx < newMats.size()` to the
condition guarding the access to `newMats`. Additionally, based on maintainer
feedback, I added a warning log `ASSIMP_LOG_WARN` when the index is out of
bounds, to inform the user about the missing material definition or broken
reference.

I verified the fix using the provided reproduction command. The
container-overflow is no longer triggered. I also built and ran the unit tests.
Since `bin/unit` was missing, I manually built the unit tests using
`cmake.real` and `ninja` in `/src/assimp/build_tests` with
`ASSIMP_BUILD_TESTS=ON`, `ASSIMP_BUILD_ZLIB=ON`, and
`ASSIMP_WARNINGS_AS_ERRORS=OFF` (to bypass a gtest compilation warning), and
updated `run_tests.sh` to point to the built binary. All 584 tests passed.

Fixes: https://issues.oss-fuzz.com/issues/483102958

Signed-off-by: Bill Wendling <morbo@google.com>
Co-authored-by: CodeMender <codemender-patching@google.com>
Co-authored-by: Kim Kulling <kimkulling@users.noreply.github.com>
* Fixed CanRead function for FBXImporter, which is important when reading from memory

* Update FBXImporter.cpp

---------

Co-authored-by: Kim Kulling <kimkulling@users.noreply.github.com>
Bumps [softprops/action-gh-release](https://github.com/softprops/action-gh-release) from 2 to 3.
- [Release notes](https://github.com/softprops/action-gh-release/releases)
- [Changelog](https://github.com/softprops/action-gh-release/blob/master/CHANGELOG.md)
- [Commits](softprops/action-gh-release@v2...v3)

---
updated-dependencies:
- dependency-name: softprops/action-gh-release
  dependency-version: '3'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* Fix extracting interleaved buffers

* Fix some issues noted by coderabbit:
- Remove narrowing cast from size_t to unsigned int
- Validate accessor count is <= space in buffer (maxCount)
- Ensure remapped indices only access data valid for this accessor by checking count and not maxCount
…6602)

Co-authored-by: Kim Kulling <kimkulling@users.noreply.github.com>
* M3D: fix overflow

---------

Co-authored-by: Kazuki Y <6259214+kazu0617@users.noreply.github.com>
Co-authored-by: kazu0617 <kazu0617@protonmail.com>
#6606)

* Hardening aiString deserialization in AssbinLoader to prevent stack buffer overflow

* Simplify string read error handling in AssbinLoader

---------

Co-authored-by: Kim Kulling <kimkulling@users.noreply.github.com>
* Fix integer truncation in StreamReader size calculations
* improves type clarity and avoids implicit conversions by replacing C-style casts with static_cast

---------

Co-authored-by: Kim Kulling <kimkulling@users.noreply.github.com>
Co-authored-by: Kim Kulling <kimkulling@users.noreply.github.com>
* Fixed regression that scrambled FBX blendshape order.

* Merge master to this branch

---------

Co-authored-by: Lux <lxw404@gmail.com>
Co-authored-by: Lux <52231149+lxw404@users.noreply.github.com>
Co-authored-by: Kim Kulling <kim.kulling@draeger.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.