Commit Graph

370 Commits

Author SHA1 Message Date
Orleonn
ab28db52f0 Added missing scene extras properties for glTF2Importer (#6397) 2025-11-18 15:58:41 +01:00
Kim Kulling
19108dff6a Fix linkage (#6388)
* Fix linkage when all importers aren't part of the build.
2025-11-16 20:05:50 +01:00
Jerome St-Louis
0be7cdd6db glTF2: Avoid lookups for generating IDs (#6120)
* glTF2: Reduce lookups for generating IDs
- closes https://github.com/assimp/assimp/issues/5661
2025-11-13 10:50:26 +01:00
Luca Della Vedova
0581ed5f11 Added tangent handedness to glTF export (#6322)
* Added tangent handedness to glTF export
2025-09-18 14:10:41 +02:00
copycd
536cd59807 + Only up to recognizing the KTX2 compressed image as a texture object is handled. (#6139) 2025-05-08 21:28:30 +02:00
Kim Kulling
d1b73dffec Replace exception by error in log (#6133)
* Replace exception by error in log

* Separate tests for new behaviour

---------

Co-authored-by: Kim Kulling <kim.kulling@draeger.com>
2025-05-05 14:07:52 +02: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
Kim Kulling
45898eee55 Refactorings: glTF cleanups (#6028) 2025-03-05 21:37:47 +01:00
Kim Kulling
9bb6f2e1b8 Use correct data type for animation key (#5998) 2025-02-12 00:26:01 +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
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
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
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
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
HandsomeXi
164a5ae8cf bugfix: Fixed the issue that draco compressed gltf files cannot be loaded normally (#5882) (#5883)
Co-authored-by: Kim Kulling <kimkulling@users.noreply.github.com>
2024-12-04 22:03:57 +01:00
Julian Knodt
ca17cdc1f9 Do not create GLTF Mesh if no faces (#5878)
Previously GLTF meshes were created even if there were no faces, which lead to GLTFs which were not technically valid.

I believe this fixes the problem I was encountering, but I've not been able to test it because of some Mac compile errors. Will test on a windows machine at some point.

Fixes #5868

Co-authored-by: Kim Kulling <kimkulling@users.noreply.github.com>
2024-12-01 21:21:08 +01:00
Kim Kulling
41cc2f66a4 Remove strcpy. (#5802)
* Remove strcpy.

* Sonarcube: Add more strcpy replacements

* BlenderLoader: Replace strncpy by memcpy
2024-11-18 16:54:58 +01:00
Fav
5e912e68da Update glTF2AssetWriter.inl (#5647)
The total length is incorrect when exporting gltf2

Co-authored-by: Kim Kulling <kimkulling@users.noreply.github.com>
2024-08-29 23:55:18 +02:00
Florian Born
76de7cedf4 A fuzzed stride could cause the max count to become negative and hence wrap around uint (#5414)
Co-authored-by: Kim Kulling <kimkulling@users.noreply.github.com>
2024-07-23 16:17:54 +02:00
Kim Kulling
193f2c5d87 Fix compile warning (#5657) 2024-07-08 17:09:17 +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
Julian Uy
b6d53a0047 glTF2Importer: Support .vrm extension (#5569)
Co-authored-by: Kim Kulling <kimkulling@users.noreply.github.com>
2024-05-13 13:24:41 +02:00
Kim Kulling
01231d0e60 Add 2024 to copyright infos (#5475) 2024-02-23 22:30:05 +01:00
fvbj
2d98f6a880 Fix identity matrix check (#5445)
* Fix identity matrix check

Adds an extra epsilon value to check the matrix4x4 identity. The method is also used to export to GLTF/GLTF2 format to check node transformation matrices. The epsilon value can be set using AI_CONFIG_CHECK_IDENTITY_MATRIX_EPSILON with the default value set to 10e-3f for backward compatibility of legacy code.

* Fix type of float values in the unit test

* Update matrix4x4.inl

Fix typo

* Update matrix4x4.inl

Remove dead code.

* Add isIdentity-Test

* Update AssimpAPITest_aiMatrix4x4.cpp

---------

Co-authored-by: Kim Kulling <kimkulling@users.noreply.github.com>
2024-02-06 21:24:41 +01:00
Florian Born
f59a5fab1a More GLTF loading hardening (#5415)
Co-authored-by: Kim Kulling <kimkulling@users.noreply.github.com>
2024-02-04 21:23:31 +01:00
tangxin
9776d47cca fix: KHR_materials_pbrSpecularGlossiness/diffuseFactor convert to pbrMetallicRoughness/baseColorFactor 2024-01-05 21:49:21 +01:00
Alexey Medvedev
762ad8e9b7 glTF KHR_materials_specular fixes 2023-12-11 11:09:18 +01:00
Alexey Medvedev
dc399f7343 glTF KHR_materials_specular fixes 2023-12-11 11:09:18 +01:00
Alexey Medvedev
a72289b327 glTF KHR_materials_specular fixes 2023-12-11 11:09:18 +01:00
Futuremappermydud
a0b3df6dbd Fix target names not being imported on some gLTF2 models 2023-12-04 21:11:55 +01:00
julianknodt
9efbbe0a69 Read int from uvwsrc
Previously was reading a uint, which always failed. Since the output was never checked, this
seemed to work, and works fine for most models since they only use UV channel 0.
2023-11-14 16:31:56 +01:00
Kim Kulling
8cf2d6e588 Refactoring: Some cleanups 2023-11-12 21:09:33 +01:00
fvbj
8fcc65a8af Extension of data export to GLB/GLTF format
Allows to export unlimited (more than 4) bones per vertex
Use JOINTS_1,2,.. and WEIGHTS_1,2,...
Added AI_CONFIG_EXPORT_GLTF_UNLIMITED_SKINNING_BONES_PER_VERTEX flag
2023-10-08 14:43:53 +00:00
Kim Kulling
e79d105957 Merge branch 'master' into vulcano/export_gltf2_with_roughness_texture 2023-08-29 15:13:43 +02:00
tangxin
4389c3d80c The texture strength attribute in aiMaterial set when importing and exporting gltf files is inconsistent 2023-08-23 14:54:40 +08:00
zhucan
d07934bf25 adjust comment 2023-08-18 01:03:49 +08:00
zhucan
554fa8f5e2 code format 2023-08-18 01:03:49 +08:00
zhucan
2b4606c082 add fallback strategy for metallicRoughnessTexture 2023-08-18 01:03:49 +08:00
朱灿
3a03fe31b1 gltf2 export diffuse roughness 2023-08-18 01:03:49 +08:00
zhucan
32716002ac Add DIFFUSE_ROUGHNESS_TEXTURE for gltf2 exporter 2023-08-18 01:03:49 +08:00
Marco Feuerstein
37a1366fb7 Add missing rapidjson headers. 2023-07-21 11:33:06 +02:00
Marco Feuerstein
bf38d67935 Fix detection of KHR_materials_specular. 2023-07-13 11:51:56 +02:00
Marco Feuerstein
2875de132f Fix compilation on windows. 2023-06-29 08:20:51 +02:00
Marco Feuerstein
17fac97b04 Fix magic token usage. 2023-06-29 08:20:51 +02:00
Marco Feuerstein
1c0f3c5f87 Fix string length calculation. 2023-06-29 08:20:50 +02:00
Marco Feuerstein
a2bdfdd05a Improve binary check for gltf and gltf2.
By checking the magic token we don't depend on the extension any more
and follow the official way to detect a gltf file as binary, see also
https://github.com/KhronosGroup/glTF/blob/main/extensions/1.0/Khronos/KHR_binary_glTF/README.md#header
and https://registry.khronos.org/glTF/specs/2.0/glTF-2.0.html#binary-header.
2023-06-29 08:20:50 +02:00
Kim Kulling
bef66deeda Update glTF2Importer.h 2023-06-08 20:56:14 +02:00
Kim Kulling
1ab4161cd7 Update glTF2Importer.cpp 2023-06-08 20:55:48 +02:00