Commit Graph

228 Commits

Author SHA1 Message Date
Luca Della Vedova
672594c230 Revert "Refactoring: use using types (#6266)" (#6324)
* Revert "Refactoring: use using types (#6266)"
2025-11-04 15:10:45 +01:00
sSsA01
8e35cb1a9f Fix out-of-range access cause of aiProcess_GenNormals : array size inconsistency of members of mesh after process (#6332)
* Fix aiProcess_GenNormals process: copy members of mesh corresponding with additional vertices

* Fix aiProcess_GenNormals process: Refoctoring

* refactoring: fix SonarQube Issue

* Update GenFaceNormalsProcess.cpp: fix small findings

---------

Co-authored-by: Kim Kulling <kimkulling@users.noreply.github.com>
2025-11-01 21:15:17 +01:00
Kim Kulling
f544f9c217 Bugfix/fix sonarcube findings (#6369)
* Fix sonarcube findings.
---------
Co-authored-by: Kim Kulling <kim.kulling@draeger.com>
2025-10-14 00:01:50 +02:00
Matt Penny
489c8d565b Restore merging of near-identical vertices for JoinIdenticalVertices (#6278)
* Restore merging of near-identical vertices for JoinIdenticalVertices

---------

Co-authored-by: Kim Kulling <kimkulling@users.noreply.github.com>
2025-09-21 10:57:17 +02:00
Dongge Liu
4c42db1805 Fixed a heap-use-after-free in SortByPTypeProcess. (#6326)
The process incorrectly deleted original meshes from the scene when cleaning up after an error if those meshes had been added to its output list (outMeshes). The fix ensures proper ownership transfer by nullifying the original mesh pointer in the scene (pScene->mMeshes[i] = nullptr;) when the mesh is moved to outMeshes. This prevents the scene destructor from attempting to delete the mesh again later, while allowing the error cleanup path in SortByPTypeProcess to correctly delete all meshes it owns (both newly created and transferred originals).

Co-authored-by: Kim Kulling <kimkulling@users.noreply.github.com>
2025-08-21 09:31:15 +02:00
Kyungjoon Ko
6d7ea78792 Fix SEGV write in Assimp::SortByPTypeProcess::Execute (#6318)
* Fix OOB Write in Assimp::SortByPTypeProcess::Execute
2025-08-10 11:45:30 +03:00
Kim Kulling
9f4e7c6d8d Refactoring: use using types (#6266)
* Refactoring: use using types

---------

Co-authored-by: Kim Kulling <kim.kulling@draeger.com>
2025-07-28 17:00:45 +02:00
HandsomeXi
4b6cc8c28a bugfix: Fixed the memory leak when texture transforming (#6236) (#6237)
* bugfix: Fixed the memory leak when texture transforming (#6236)

---------

Co-authored-by: Kim Kulling <kimkulling@users.noreply.github.com>
2025-06-26 10:53:08 +02:00
Kim Kulling
9d9a80739d Fix: Fix leak when sortbyp failes with exception (#6166)
Co-authored-by: Kim Kulling <kim.kulling@draeger.com>
2025-05-14 11:43:12 +02:00
krishty
88959b2be7 Fix Whitespace (#6063)
* Fix Whitespace

No functional changes. This commit removes trailing spaces, undesired line breaks, and formatting screwups.

* Remove more useless line breaks in license (500 out of 630 license copies do NOT use double line breaks here)

---------

Co-authored-by: Krishty <krishty@krishty.com>
Co-authored-by: Kim Kulling <kimkulling@users.noreply.github.com>
2025-03-26 00:12:55 +01:00
krishty
ac0b19a771 Remove Redundant virtual (#6064)
The `override` keyword only applies to virtual functions. Specifying `virtual` again is useless.

Co-authored-by: Krishty <krishty@krishty.com>
Co-authored-by: Kim Kulling <kimkulling@users.noreply.github.com>
2025-03-25 21:00:43 +01:00
Kim Kulling
45898eee55 Refactorings: glTF cleanups (#6028) 2025-03-05 21:37:47 +01:00
Stefan
7945359a5c Use ear-cutting library for triangulation (#5977)
* Use ear-cutting library for triangulation

Fixes #3609
Fixes #3019
Fixes #1136

* Fix typo

---------

Co-authored-by: Kim Kulling <kimkulling@users.noreply.github.com>
2025-02-13 11:24:59 +01:00
Gene Walters
2493deff37 USD Keyframe Animations (#5856)
USD Keyframe Animations

Signed-off-by: AMZN-Gene <genewalt@amazon.com>
Signed-off-by: Gene Walters <genewalt@amazon.com>
Co-authored-by: Kazuki Y <6259214+kazu0617@users.noreply.github.com>
Co-authored-by: kazu0617 <kazu0617@protonmail.com>
Co-authored-by: Kim Kulling <kim.kulling@googlemail.com>
Co-authored-by: Kim Kulling <kimkulling@users.noreply.github.com>
2024-11-28 21:29:58 +01:00
Julian Knodt
12f3309996 Simplify JoinVerticesProcess (#5895)
Previously JoinVertices had a lot of extra complexity, simplify it greatly.

Co-authored-by: Julian Knodt <julianknodt@Julians-Air-2.attlocal.net>
Co-authored-by: Kim Kulling <kimkulling@users.noreply.github.com>
2024-11-27 22:53:27 +01:00
David Campos Rodríguez
e7a6d33365 Try to resolve image paths by replacing backslashes or forward slashes in EmbedTexturesProcess (#5844)
* Try to resolve image paths by replacing backslashes.

* Some changes suggested by CI

* Removed usage of <filesystem>.

* Removing usage of C++20/C++23 features

---------

Co-authored-by: Kim Kulling <kimkulling@users.noreply.github.com>
2024-11-14 21:10:03 +01:00
Tobias Rittig, Ph.D.
e06b80f6b0 +Add vertex duplication during face normal generation (#5805)
* +Add vertex duplication during face normal generation
`aiProcess_GenNormals` PostProcess now duplicates vertices if they are referenced by more than one polygon which results in the correct faceted appearance.

* Update GenFaceNormalsProcess.cpp

- Fix old spellings
- Use static_cast instead of c-style casts

---------

Co-authored-by: Kim Kulling <kimkulling@users.noreply.github.com>
2024-11-02 09:03:59 +01:00
Kim Kulling
ecdf8d24b8 SplitLargeMeshes: Fix crash (#5799)
- Fix nullptr access when rootnode of the scene is a nullptr. This can happen even if the scene stores any kind of meshes. closes https://github.com/assimp/assimp/issues/5791
2024-10-07 10:30:45 +02:00
dataisland
d468e633b1 Fix invalid access (#5765)
* Fix invalid access

* Update SortByPTypeProcess.cpp

Some smaller refactorings.

* Update SortByPTypeProcess.cpp

Small refactorings.

---------

Co-authored-by: Kim Kulling <kimkulling@users.noreply.github.com>
2024-09-10 09:12:01 +02:00
RichardTea
c1ffbfec06 Zero-length mChildren arrays should be nullptr (#5749)
- Children: Don't allocate a zero-length array
- aiNode::mChildren should be left nullptr instead.
2024-09-03 10:26:27 +02:00
Kim Kulling
bb9db8409f Sparky kitty studios master (#5727)
* upload contains "windows" in GH Actions

* Update ccpp.yml

* Update ccpp.yml

* Update ccpp.yml

* Update ccpp.yml

* Update ccpp.yml

* Update ccpp.yml

* Update ccpp.yml

* buildする方についてwindows-msvcのついている方にした

この二つ、何の違いがあるかいまいち理解してない…
clでビルドするかhunterでビルドするかの違い?

* upload/release対象のartifactを修正

追加当時のIssueを参考に修正(当時はHunterなかったっぽい)
a9a0c30932

* fix ccpp.yml -- fix matrix.name check for artifact

* fix ccpp.yml - build both hunter or not

* Update ccpp.yml

* Update ccpp.yml

* Update ccpp.yml

* Update ccpp.yml

* Update ccpp.yml

* Update ccpp.yml

* Fix verbose string + refactorings

* Revert "Fix verbose string + refactorings"

This reverts commit 824db16a68.

* Fix verbose string + refactorings

---------

Co-authored-by: Kazuki Y <6259214+kazu0617@users.noreply.github.com>
Co-authored-by: kazu0617 <kazu0617@protonmail.com>
Co-authored-by: Kim Kulling <kim.kulling@draeger.com>
2024-08-22 11:09:14 +02:00
Matthias Möller
12cdbb712c Fixes possible out-of-bound read in findDegenerate (#5679)
This is possible, if the option "aiProcess_ValidateDataStructure" is deactivated as postprocessing step, but the option "aiProcess_FindDegenerates" is activated and the mesh contains invalid data structures

Co-authored-by: Kim Kulling <kimkulling@users.noreply.github.com>
2024-08-13 16:24:43 +02:00
Kim Kulling
104a70f845 Return false instead of crash (#5685)
- Return false instead of crash
- closes https://github.com/assimp/assimp/issues/5684
2024-07-23 16:32:11 +02:00
JensEhrhardt-eOPUS
c55158cd82 CalcTangents: zero vector is invalid for tangent/bitangent (#5432)
* CalcTangents: zero vector is invalid for tangent/bitangent
2024-07-23 13:13:12 +02:00
Stepan Hrbek
206839d4f2 Allow empty slots in mTextureCoords (#5636)
* Allow empty slots in aiMesh::mTextureCoords.
1.Explicitly say in documentation that empty slots are allowed (it was unclear).
2.Change GetNumUVChannels() implementation to allow empty slots.
3.Revert fraction of 2da2835b29 where empty slots are detected and error logged.

* Fix #5632 by reverting fraction of d6aacefa1e where Collada texcoords are renumbered to avoid empty slots.

---------

Co-authored-by: Kim Kulling <kimkulling@users.noreply.github.com>
2024-07-10 09:01:53 +02:00
Matthias Möller
35976a4eb4 fixes some uninit bool loads (#5644)
This commit fixes some bool loads which are not initialized. With ubsan and the "option -fsanitize=bool", this results in a runtime error during test execution.

Co-authored-by: Kim Kulling <kimkulling@users.noreply.github.com>
2024-07-02 21:54:18 +02:00
Kim Kulling
a51500ba2b Draft: Update init of aiString (#5623)
* Draft: Update init of aiString

- closes https://github.com/assimp/assimp/issues/5622

* Update types.h

* Fix typo

* Fix another typo

* Adapt usage of AI_MAXLEN

* Fix compare operator

* Add missing renames
2024-06-17 13:12:54 +02:00
Kim Kulling
43634b8b27 Postprocessing: Fix endless loop (#5605)
- closes https://github.com/assimp/assimp/issues/5603
2024-05-31 09:36:14 +02:00
Johannes Unterguggenberger
47ef79672e Reverts the changes introduced by commit ad766cb in February 2022. (#5542)
* Reverts the changes introduced by commit ad766cb in February 2022.
Explanation why the old code was just fine is given in Q&A #5512.

* Added that missing ;

---------

Co-authored-by: Kim Kulling <kimkulling@users.noreply.github.com>
2024-04-29 21:03:57 +02:00
Succ3s
7bda0f88ca SplitByBoneCount had a minor typo that prevented updates to nodes indices (#5550) 2024-04-23 21:40:06 +02:00
Kim Kulling
85f084a4ce Update ComputeUVMappingProcess.cpp (#5541)
* Update ComputeUVMappingProcess.cpp

- closes https://github.com/assimp/assimp/issues/5540

* Update ComputeUVMappingProcess.cpp

Add missing token.
2024-04-11 11:30:36 +01:00
Stephen Gold
08c1adc015 fix issue #5461 (segfault after removing redundant materials) (#5467)
* fix issue #5641 (segfault after removing redundant materials)

* Update RemoveRedundantMaterials.cpp

- Fix 2 possible memleaks.

---------

Co-authored-by: Kim Kulling <kimkulling@users.noreply.github.com>
2024-04-10 00:22:57 +02:00
Laura Hermanns
727774f181 Fix compilation for MSVC14. (#5490)
- std::min/max were not defined in StackAllocator.inl; Also added explicit template arguments to break macro expansion if Windows.h is included prior and NOMINMAX macro is not present.
- Made static_assert statements compatible with C++11 in ProcessHelper.cpp.
- Removed unused string_view include in ObjFileParser.cpp.
2024-03-11 09:09:23 +01:00
Kim Kulling
01231d0e60 Add 2024 to copyright infos (#5475) 2024-02-23 22:30:05 +01:00
Kim Kulling
3990ec80a1 Kimkulling/fix bahavior of remove redundat mats issue 5438 (#5451)
* Fix crash in viewer

* Fix bevavior when material was not referenced
2024-02-01 21:27:04 +01:00
Kim Kulling
c08e3b4abb Add bounds checks to the parsing utilities. (#5421)
* Add bounds checks to the parsing utilities.

* Fix merge conflicts in ACLoader.

* Fix loaders

* Fix unittest of AC-Loader.

* Remove dead code.

* Md5Parser fixes

* Fix md5-parsing

* Fix Merge conflict

* Fix merge conflicts.

* Md5: Fix warning: missing return statement.
2024-01-30 14:32:41 +01:00
Kim Kulling
25aee03f66 Fix: Add missing transformation for normalized normals. 2023-10-29 10:05:25 +01:00
Kim Kulling
2a347014f3 Update ImproveCacheLocality.cpp 2023-10-08 18:35:08 +00:00
Kim Kulling
a531c72f7f Update ImproveCacheLocality.cpp
- closes https://github.com/assimp/assimp/issues/5262
2023-10-08 18:35:08 +00:00
Kim Kulling
5b8cfa920b Replace an assert by a error log. 2023-10-02 11:31:18 +02:00
ockeymm
7b6bf139cf include memory.h to fix compile error 2023-10-01 16:11:20 +02:00
ockeymm
b2bfe6d253 Use unique_ptr to release old vertices data. 2023-10-01 16:11:20 +02:00
ockeymm
7a4d8ec412 Reduce memory consumption in JoinVerticesProcess::ProcessMesh() significantly 2023-10-01 16:11:20 +02:00
Kim Kulling
59b1234496 Update GenVertexNormalsProcess.cpp (#5228)
- closes https://github.com/assimp/assimp/issues/5074
2023-09-14 00:37:13 +02:00
Aaron
0bfc588c39 Update Triangulate Process [more another case] 2023-08-15 18:01:16 +08:00
Alex
5bb1c6debd Fix UNKNOWN READ crash in UpdateMeshReferences 2023-06-14 07:40:36 +02:00
Kristjan Skutta
cb86029153 Fixed missing config property lookup for removal of empty bones. 2023-06-06 14:30:35 +02:00
Kim Kulling
8cbfb44e9c Remove dead code 2023-05-04 21:10:51 +02:00
Kim Kulling
1243325f10 Merge branch 'master' into kimkulling/refactoring_geoutils 2023-05-04 21:10:00 +02:00
Kim Kulling
75d024c91b Reafctoring: Add GeoUtils usage 2023-05-04 20:57:20 +02:00