Commit Graph

6800 Commits

Author SHA1 Message Date
Kim Kulling
2f3e72413f Bugfix/ensure collada parsing works issue 1488 (#6087)
* Add text to ensure that float parsing in colladata works right
2025-04-10 15:30:12 +02:00
krishty
55e6359436 More constexpr (#6066)
Co-authored-by: Krishty <krishty@krishty.com>
Co-authored-by: Kim Kulling <kimkulling@users.noreply.github.com>
2025-03-27 15:08:21 +01:00
krishty
b57f7d367c Harmonize Importer #includes (#6065)
* Harmonize Importer #includes

Some importers referred to their headers via `#include "AssetLib/[format]/[header.h"`, others via `#include "[header].h"`, others mixed both (e.g. IRR). This is a matter of taste, but it should at least be done the same way everywhere.

Most importers seem to prefer `#include "[header].h"`, so this commit enforces it.

Cross-referencing files from other importers is still done through `AssetLib/[format]`.

Assimp headers are not affected and I would advise against changing them, as this could lead to subtle collisions with user includes.

* went one too far

---------

Co-authored-by: Krishty <krishty@krishty.com>
Co-authored-by: Kim Kulling <kimkulling@users.noreply.github.com>
2025-03-27 11:13:44 +01: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
leliel
79cba055b9 feat: created the aiGetStringC_Str() function. (#6059)
* feat: created the aiGetStringC_Str() function.

The C++ Interface's function C_Str() from the aiString struct was missing an equivalent function for the C Interface.

* changed the first parameter of the aiGetStringC_Str function to be const.

---------

Co-authored-by: Kim Kulling <kimkulling@users.noreply.github.com>
2025-03-25 22:03:52 +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
krishty
cbf279d522 Fix Cinema4D Import (#6062)
#5623 broke the Cinema4D import by forgetting to rename a constant. This commit fixes the invalid name.

Co-authored-by: Krishty <krishty@krishty.com>
Co-authored-by: Kim Kulling <kimkulling@users.noreply.github.com>
2025-03-24 21:32:10 +01:00
Zhang Yuntong
d307c9f1d7 NDO: Fix possible overflow access (#6055)
* NDO: Fix possible overflow access
- closes https://issues.oss-fuzz.com/issues/372765427

---------

Co-authored-by: Kim Kulling <kimkulling@users.noreply.github.com>
2025-03-24 21:21:32 +01:00
Steve M
5a1cc9ec60 Update tinyusdz git hash (fix USD animation) (#6034)
* Update tinyusdz

* Improve reference screenshots

* Add .csm reference screenshot

* Bump version

---------

Co-authored-by: tellypresence <praktique-tellypresence@yahoo.com>
2025-03-17 20:47:28 +01:00
Steve M
a93b9f8c80 [OpenGEX] disable partial implementation of light import (causes model load failure) (#6044)
* Disable OpenGEX lights and cameras which are suspected of causing model load failure

* Revert changes to camera import

---------

Co-authored-by: tellypresence <praktique-tellypresence@yahoo.com>
Co-authored-by: Kim Kulling <kimkulling@users.noreply.github.com>
2025-03-16 13:32:17 +01:00
Kim Kulling
2690e354da CMS: Fix possible overflow access (#6052)
- closes https://github.com/assimp/assimp/issues/6010
2025-03-13 21:10:49 +01:00
Kim Kulling
e8a6286542 ASE: Use correct vertex container (#6051)
- closes https://github.com/assimp/assimp/issues/6024
2025-03-13 16:23:36 +01:00
Kim Kulling
2194944a25 Potential fix for code scanning alert no. 63: Potential use after free (#6050)
- Ensure that code scanner will identify pointer as already released.

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
2025-03-13 11:26:18 +01:00
Kim Kulling
4b8f55cc00 Bugfix: Fix possible nullptr dereferencing (#6049)
* Bugfix: Fix possible nullptr dereferencing
2025-03-13 11:04:25 +01:00
Kim Kulling
bcf11c252a MDL: Fix overflow check (#6047) 2025-03-13 00:07:41 +01:00
Kim Kulling
7f2c9d7b88 MDL: Limit max texture sizes (#6046)
- closes https://github.com/assimp/assimp/issues/6022
2025-03-12 21:37:25 +01:00
Kim Kulling
7c705fde41 ASE: Fix possible out of bound access. (#6045) 2025-03-12 21:12:02 +01:00
Kim Kulling
c1eedbba8e Fix: Let OpenGEX accept color3 types (#6040)
- will set alpha channel to 1.0f, if no alpha channel was found.
- closes https://github.com/assimp/assimp/issues/6039
2025-03-12 11:05:37 +01:00
T.Yamada
f398a70163 Use std::copy to copy array and remove user destructor to make sure is_trivially_copyable in order to avoid -Wno-error=nontrivial-memcall (#6029)
Use std::copy to copy array and remove user destructor to make sure is_trivially_copyable in order to avoid -Wno-error=nontrivial-memcall (#6029)
2025-03-11 15:09:10 +01:00
UnionTech-Software
70459b4d1f Fix memory leak in OpenGEXImporter (#6036) 2025-03-10 16:24:26 +01:00
Kim Kulling
45898eee55 Refactorings: glTF cleanups (#6028) 2025-03-05 21:37:47 +01:00
Kim Kulling
f52fcb6052 Obj: remove smooth-normals postprocessing (#6031)
- closes https://github.com/assimp/assimp/issues/5514
2025-03-03 09:44:35 +01:00
Kim Kulling
2bce77f909 IFC: Remove redundand check (#6006)
- closes https://github.com/assimp/assimp/issues/5798
2025-02-22 21:34:51 +01:00
Kim Kulling
5d716b8fe0 Bugfix/fix mingw issue 5975 (#6005)
* MDL: Ensure alignment of bool vector
2025-02-20 21:20:11 +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
Kim Kulling
9bb6f2e1b8 Use correct data type for animation key (#5998) 2025-02-12 00:26:01 +01:00
mosfet80
d41511bf8a Update STEPFileReader.cpp (#5973)
Clean code

Co-authored-by: Kim Kulling <kimkulling@users.noreply.github.com>
2025-02-03 11:27:31 +01:00
1323236654
bc47836a8f fix: reduce gltf2 export time (#5972)
* 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>
2025-01-25 21:50:33 +01:00
Pichas
31f0dcb4d1 add EXCLUDE_FROM_ALL (#5959)
Co-authored-by: Kim Kulling <kimkulling@users.noreply.github.com>
2025-01-22 16:28:43 +01:00
Lutz Hören
ba4455c9c0 Added GLTF Extension KHR_materials_anisotropy (#5950)
* 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>
2025-01-21 00:02:46 +01:00
Kim Kulling
79d451bf4b Avoid exporting all primitives, which are not triangles. (#5964) 2025-01-17 19:28:12 +01:00
BurntRanch
2a0969d4d9 Add customExtension support to the scene (#5954)
Co-authored-by: Kim Kulling <kimkulling@users.noreply.github.com>
2025-01-17 16:09:23 +01:00
David Campos Rodríguez
1e44036c36 Prefix MTL textures with the MTL directory path (#5928)
* 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>
2025-01-15 10:03:32 +01:00
Engin Manap
2f6dcdfd72 Assimp master head fixes for failure to compile (#5899)
* 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>
2025-01-14 14:23:02 +01:00
Julian Knodt
e722420907 [FBX] Allow export multi materials per node (#5888)
* [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>
2025-01-14 11:37:16 +01:00
Steve M
8e44b40df4 [AMF] Fix texture mapping (#5949)
* Fix texture mapping

---------

Co-authored-by: Steve M <praktique-tellypresence@yahoo.com>
Co-authored-by: Kim Kulling <kimkulling@users.noreply.github.com>
2025-01-12 23:04:10 +01:00
Kim Kulling
5fa7b8ceb9 Bugfix/cosmetic code cleanup (#5947)
* Refactorings: Code cleanups

* More cosmetic changes

---------

Co-authored-by: Kim Kulling <kim.kulling@draeger.com>
2025-01-07 23:32:50 +01:00
Jackson Levitt
2f40a77ae1 Updated Material.cpp to add missing cases (#5945) 2025-01-06 13:02:55 +01:00
David Campos Rodríguez
a4d8a5fec3 AssbinImporter::ReadInternFile now closes stream before throwing (#5927)
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>
2025-01-03 21:38:27 +01:00
tyler92
437b484070 Fix heap buffer overflow in HMP loader (#5939) 2025-01-01 17:40:18 +01:00
tyler92
d70606bfb6 Verify negative values in Quake1 MDL header (#5940)
Co-authored-by: Kim Kulling <kimkulling@users.noreply.github.com>
2025-01-01 01:55:05 +01:00
Steve M
69558d8889 Introduce VRML format (.wrl and .x3dv) 3D model support (#5857)
- 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>
2024-12-30 11:56:18 +01:00
tyler92
5e091572d5 Fix stack overflow in LWS loader (#5941)
Co-authored-by: Kim Kulling <kimkulling@users.noreply.github.com>
2024-12-30 11:15:50 +01:00
Julian Knodt
258cdfd2bc Export tangents in GLTF (#5900)
Previously tangents were not being exported. If they are present, they should also be properly
exported.

Co-authored-by: Kim Kulling <kimkulling@users.noreply.github.com>
2024-12-23 21:57:13 +01:00
David Campos Rodríguez
016be03c3d glTF importers: Avoid strncpy truncating away the ' \0' character (#5931)
* Fixing building errors from job https://github.com/assimp/assimp/actions/runs/12403918024/job/34628244451?pr=5928

* Adding some asserts for future mantainability, although a bit paranoic maybe

---------

Co-authored-by: Kim Kulling <kimkulling@users.noreply.github.com>
2024-12-23 16:55:17 +01:00
Kim Kulling
1ce3164bc2 Bug/evaluate matrix4x4 access (#5936)
* Add test for 3x3 matrices and 4x4 matrix access
2024-12-23 16:33:37 +01:00
Kim Kulling
9f3a7e95ab Fix: Fix name collision (#5937)
* Fix: Fix name collision

* Fix: Fix possible override

* Fix: Use reentrant providing time function

* Fix: Fix override

* Update AssbinFileWriter.cpp

Revert, not portable.

* Update AssxmlFileWriter.cpp

Revert asctime_r, not portable.
2024-12-23 12:23:42 +01:00
tyler92
ecc8a1c869 Fix buffer overflow in MD5Parser::SkipSpacesAndLineEnd (#5921)
Co-authored-by: Kim Kulling <kimkulling@users.noreply.github.com>
2024-12-17 18:57:54 +01:00
Sebastian Schäfer
2090508c34 Fix parsing of comments at the end of lines for tokens with variable number of elements. (#5890) (#5891)
* Fix parsing of comments at the end of lines for tokens with variable number of elements. (#5890)

* Fixed Quality Gate issues.

Reduced nesting of the break statements.

---------

Co-authored-by: Kim Kulling <kimkulling@users.noreply.github.com>
2024-12-17 18:17:02 +01:00
sacereda
862abe410b Fixed warnings (#5903)
* Fixed conversion warning when compiling without ASSIMP_DOUBLE_PRECISION. Fixed size() <> unsigned warnings

* Fix: Review finding

---------

Co-authored-by: Kim Kulling <kimkulling@users.noreply.github.com>
2024-12-12 20:58:08 +01:00