Commit Graph

262 Commits (1d6ed840fb9382c3234b719bbb97f72c836ac4d2)

Author SHA1 Message Date
Max Vollmer (Microsoft Havok) 72ea80b41f Revert last change (gltf2::Ref type is not a pointer and has a bool() operator) 2021-09-02 10:00:56 +01:00
Kim Kulling d710d0700f
Make nullptr test more explicit. 2021-09-02 10:10:42 +02:00
Max Vollmer (Microsoft Havok) 4c86772091 Added another nullptr safety check 2021-09-02 08:27:03 +01:00
Kim Kulling df739f00dd
Merge branch 'master' into issue_3398 2021-08-28 13:56:50 +02:00
Max Vollmer (Microsoft Havok) c1e830cf3b The GLTF2 specs aren't very specific about the restrictions of the number of keyframes in sampler input and output. It seems logical that they should be the same, but there is an official sample model from Khronos where output has more keyframes. I thus assume that the GLTF2 standard allows more keyframes in output, but not in input. Fixed the check accordingly. 2021-08-13 17:46:10 +01:00
Max Vollmer (Microsoft Havok) de2f5cf021 Crash fixes 2021-08-13 16:26:42 +01:00
Kim Kulling 4b1ff645e3 closes https://github.com/assimp/assimp/issues/3398: Add support for embedded textures 2021-08-12 21:13:07 +02:00
krishty 1ee2be8c5c
Merge branch 'master' into trim-trailing-whitespace 2021-07-31 18:01:48 +02:00
Krishty bb53961fa9 more range-based for
f6b4370f6a and 7c822f23bd introduced raw loops on data types with heavy nesting; range-based for suits better here
2021-07-29 14:57:25 +02:00
Krishty 758116b083 removed trailing spaces and tabs from source and text
This commit ignores the “contrib” folder in order to prevent merge conflicts in dependencies, should these be updated via git.
2021-07-29 13:28:51 +02:00
Kim Kulling 4e28a3072f
Merge branch 'master' into gltf_fixes 2021-07-23 20:37:25 +02:00
Adrian Perez 30d342534a Fix issues encountered during integration atempt 2021-07-16 14:29:28 -07:00
RichardTea 632b2db97c Ensure glTFv2 scene name is unique
Use the provided scene name if extant
Fixes issue #3978
2021-07-14 13:39:41 +01:00
Promit Roy 90c115cb3f
Merge branch 'master' into promit/gltf-extras 2021-07-02 00:38:00 -04:00
Kim Kulling 240eb36980
Merge branch 'master' into master 2021-07-01 19:23:52 +02:00
Kim Kulling 59ab791a47
Merge branch 'master' into clang-tidy-perf-fixes 2021-06-29 20:24:23 +02:00
Promit Roy 7c822f23bd Added support for custom properties ("extras") in glTF2 2021-06-27 00:53:40 -04:00
Jerome St-Louis e3d54860ec
Merge branch 'master' into master 2021-06-25 18:50:33 -04:00
Jerome St-Louis 0e41efb050 glTF2: Improved support for AI_MATKEY_OPACITY
- Exporter: Writing opacity to pbrMetallicRoughness.baseColorFactor[3] even when alphaMode is set
- Importer: Setting AI_MATKEY_OPACITY from pbrMetallicRoughness.baseColorFactor[3]
2021-06-24 13:27:29 -04:00
Aaron Gokaslan f435ce8c2c
Merge branch 'master' into clang-tidy-perf-fixes 2021-06-24 11:54:56 -04:00
Kim Kulling b38b65ff49
Add const 2021-06-24 17:03:00 +02:00
Kim Kulling 012ce30577
Merge branch 'master' into zero 2021-06-24 17:00:43 +02:00
Kim Kulling d18d838812
Fix formatting 2021-06-24 16:18:11 +02:00
Aaron Gokaslan 8e3a159141
Merge branch 'master' into clang-tidy-perf-fixes 2021-06-23 10:10:28 -04:00
Evangel63 e736538df3
Merge branch 'master' into master 2021-06-23 13:45:23 +10:00
Kim Kulling 760953c834
Merge branch 'master' into clean_gltf_pbr_brdf 2021-06-22 20:10:03 +02:00
Aaron Gokaslan 94c3abd841 Apply various performance fixes from clang-tidy 2021-06-22 12:27:15 -04:00
Hill Ma 148b8c66a8 glTF2: zero out extra space created by padding.
This makes resulting GLB deterministic.
2021-06-15 15:18:20 -07:00
RichardTea f412595887 Fix typo
Thank you clang!
2021-06-14 15:11:41 +01:00
RichardTea 985f3ee665 Fix glTFv2 texcoord/uv mapping
Use the standard property to indicate the UV map index
2021-06-14 15:11:41 +01:00
RichardTea fb039bb9eb Add glTFv2 Clearcoat import/export tests
Uses Clearcoat model from Khronos
2021-06-14 15:11:41 +01:00
RichardTea 4a66ec25d0 Standardise Clearcoat, Sheen and Transmission
Also cleanup glTFv2 defaults, don't import/export if disabled
2021-06-14 15:11:41 +01:00
RichardTea 4476352882 First pass at simplifying glTFv2 PBR
Removed 'core' set of GLTF-specific properties
2021-06-14 15:11:41 +01:00
Evangel 3de20af3cc Renamed glTF2::Object::extensions to customExtensions to avoid shadowing in other subclasses. 2021-06-12 13:16:53 +10:00
Evangel a7a30baf27 Renamed local variable to avoid shadowing member variable. 2021-06-12 13:08:14 +10:00
Evangel 7f0efa0866 Added ReadExtensions to glTF2::Object, so all objects now have their extensions read.
Importer is the only place that needs to be modified to make them available on the Assimp side now.
2021-06-12 12:50:44 +10:00
Evangel 5be2330fbb Added CustomExtension to glTF2::Object so that all subclasses have it instead of doing it piecemeal. 2021-06-12 12:20:40 +10:00
Evangel 6d413444b5 Merge branch 'master' of https://github.com/Evangel63/assimp 2021-06-12 11:46:20 +10:00
Evangel 36c8cdf3de Add scene metadata for glTF2 files as allowed by the glTF2 specification. 2021-06-12 11:44:28 +10:00
Hill Ma ef739c1703 glTF2: Make handling of embedded textures safer.
Previous code does not check whether the embedded texture exists.
2021-06-08 12:53:18 -07:00
Kim Kulling d33cf1dc0c
Merge branch 'master' into x3d_pugi_migration 2021-06-06 16:06:08 +02:00
Kim Kulling 70cc1630fa
Merge branch 'master' into fix-gcc4.9-compilation 2021-05-27 15:25:01 +02:00
Kim Kulling 6b8a00dfa1
Merge branch 'master' into wangyi_basisu 2021-05-25 17:17:07 +02:00
Kim Kulling b5e54e4d3b
Merge branch 'master' into wangyi_basisu 2021-05-25 16:17:29 +02:00
Kim Kulling faeae27923
Merge branch 'master' into importer_fixes_followup 2021-05-25 16:15:09 +02:00
Jean-François Verdon b7b3c6db7e Fixing GCC 4.9 compilation issues 2021-05-22 16:57:07 +02:00
Malcolm Tyrrell 4ec01cfdcd Improve use of logging 2021-05-13 12:05:31 +01:00
Malcolm Tyrrell 5cd3bdd5c2 No need to distinguish formatting log functions. 2021-05-13 10:25:27 +01:00
ywang a19b708144 support both ktx and ktx2 2021-05-07 16:27:23 -07:00
ywang 2b9d88c943 support basis universal 2021-05-06 15:10:06 -07:00
Kim Kulling 350f2ea1d3 Fix build and merged master. 2021-05-06 21:36:25 +02:00
Kim Kulling 52228a93f8 Fix X3DGeohelper. 2021-05-06 21:07:38 +02:00
Max Vollmer (Microsoft Havok) 153b890b02 Prevent accessing nullpointers 2021-05-05 14:09:43 +01:00
Krishty b79b84d34e Merge branch 'master' into new-file-detection 2021-05-05 00:09:42 +02:00
Kim Kulling 0b92abe9b4
Merge branch 'master' into empty-string-style 2021-04-30 00:54:57 +02:00
Max Vollmer (Microsoft Havok) e1d6e1f377
Merge branch 'master' into ms-maxvollmer/importer_fixes 2021-04-26 14:53:32 +01:00
Krishty b00de10eb3 Simplified importer search and fixed a few bugs
The search for a matching importer had a few issues, see #3791. There were two different mechanisms to determine whether an importer accepts a specific file extension:
1. `aiImporterDesc::mFileExtensions`, which was forwarded to the UI via `BaseImporter::GetExtensionList()`.
2. `BaseImporter::CanRead()` when called with `checkSig == false`, which determines whether to actually use that importer.
Both were redundant and got out of sync repeatedly. I removed 2. completely and replaced it with 1., thereby syncing UI/import and shortening all `BaseImporter::CanRead()` implementations.

Further bugfixes:
- fixed glTF2 importer throwing exceptions when checking whether it can load a file
- removed `BaseImporter::SimpleExtensionCheck()` because it is no longer used and had a bug with case sensitivity

Since the `checkSig` parameter in `BaseImporter::CanRead()` is now useless, it can be removed completely. I’m not sure if this would break ABI compatiblity, so I’ll submit it with a later pull request.
2021-04-24 00:17:50 +02:00
Max Vollmer (Microsoft Havok) 746d5cf964 * Throw instead of assert on invalid file input
* Check JSON object type before accessing members
* Ensure samplers input and output references are set before accessing them
2021-04-21 16:17:03 +01:00
Krishty f761dc72f4 style fix - initializing and assigning empty std::string properly
std::string s(""); s = ""; calls the copy constructor, which in turn calls strlen(), … assigning a default-constructed string generates fewer instructions and is therefore preferred.

With C++11 uniform initialization, you’d simply write s = { } instead.
2021-04-16 23:43:56 +02:00
Krishty 6cbeca5518 fixed glTF export stuff being pulled into the EXE even if building with ASSIMP_BUILD_NO_EXPORT
“LazyDictBase::WriteObjects()” in the two glTF implementations is only used for export. Since it’s a virtual method, and many compilers have trouble removing unreferenced virtual methods, glTF export stuff is pulled into the binary even if compiling without exports.

This commit removes said virtual function if only compiling for import.

This removes 75 KiB of useless code when compiled with Visual Studio for x64.
2021-04-16 20:44:40 +02:00
Hill Ma 4aa52b3af8 Flip the check on _MSC_VER for using TR1 containers. 2021-04-13 11:15:52 -07:00
Clement JACOB e66232d8c3
Merge branch 'master' into feature/gltf_fb_ngon_encoding 2021-04-07 13:54:31 +02:00
Clement Jacob 596001c89c Refactoring the extension 2021-03-30 09:10:50 +02:00
Clement Jacob 8e589221d7 [gltf2-exporter] Adding FB_ngon_encoding support 2021-03-30 09:10:50 +02:00
Malcolm Tyrrell d94ddd32b1 Extra check. Better logging. 2021-03-24 11:04:39 +00:00
Malcolm Tyrrell add165c4a1 Check target sizes to avoid reading beyond allocation 2021-03-24 10:55:40 +00:00
Kim Kulling 5f652feb75
Merge branch 'master' into MalcolmTyrrell/gltfCrashes 2021-03-19 13:35:13 +01:00
Hill Ma 3e99385f44 Fix a memory leak in glTF2.
The destructor of LazyDict uses `delete` but `delete` was not used for objects removed by LazyDict::Remove.
2021-03-17 15:12:54 -07:00
Malcolm Tyrrell 3503252e12 Strict check for accessor "count" 2021-03-16 11:47:19 +00:00
Malcolm Tyrrell e4983aa16e Fix code issue 2021-03-15 16:46:41 +00:00
Malcolm Tyrrell 57652a9084 Version is strictly a string 2021-03-15 16:27:50 +00:00
Malcolm Tyrrell 053c0f5e0a Catch type errors in gltf and try to print out useful context. 2021-03-15 13:06:11 +00:00
Kim Kulling 806b12dc8b
Merge branch 'master' into issue_3678 2021-03-10 19:51:04 +01:00
Kim Kulling 6c89631581 closes https://github.com/assimp/assimp/issues/3678: ensure lowercase 2021-03-09 21:08:28 +01:00
Kim Kulling 75210576cf
Merge branch 'master' into sparse_minmax 2021-03-01 21:34:24 +01:00
Kim Kulling c669c8f1eb
Merge branch 'master' into update_copyrights 2021-02-28 12:18:41 +01:00
Kim Kulling 9e8dbd0ca5 Update copyrights to 2021. 2021-02-28 12:17:54 +01:00
Max Vollmer (Microsoft Havok) eef03c1f17 Improved warnings 2021-02-24 14:28:18 +00:00
Max Vollmer (Microsoft Havok) facb7da701 Check that normal count and tangent count matches vertex count. Ignore data and warn if counts don't match. 2021-02-24 14:19:29 +00:00
thomasbiang 5429475339
Merge branch 'master' into sparse_minmax 2021-02-23 12:30:53 -08:00
Kim Kulling 247fd0ce17
Merge branch 'master' into FixAnimName 2021-02-22 20:38:16 +01:00
Kim Kulling 6094da3493
Update glTF2Asset.inl 2021-02-18 09:32:37 +01:00
Minmin Gong d57b78bc98 Export the animation name to gltf2 2021-02-16 20:22:08 -08:00
Kim Kulling 888415246e
Merge branch 'master' into issue_2195_draco 2021-02-08 11:52:54 +01:00
ywang 9bab475302 export min max for sparse accessor 2021-02-03 15:05:58 -08:00
ywang 793bd44cee fix issue: 3482: invalid gltf2 properties 2021-02-02 13:19:57 -08:00
Kim Kulling 5fbbba2fac
Merge branch 'master' into issue_2195_draco 2021-01-31 16:02:57 +01:00
RichardTea 48bcbbefdd use nullptr and float constants 2021-01-27 10:56:57 +00:00
RichardTea 150514fc8b Move draco warning suppression
Should be around the include for portability, not template instantiation
Fix clang pragma typos
2021-01-27 10:42:28 +00:00
RichardTea 6ec32b6b78 Apply clangformat 2021-01-27 09:55:03 +00:00
RichardTea c6fd1ce996 glTF2 Minor cleanup 2021-01-27 09:42:49 +00:00
RichardTea 5b9d06c2fc Disable draco clang/gcc warnings via pragma
draco templated functions also throw warnings
2021-01-27 09:19:35 +00:00
RichardTea d79e0c0ba9 Avoid std::make_unique
Assimp is still C++11
2021-01-26 17:33:10 +00:00
RichardTea c917e6513f
Merge branch 'master' into issue_2195_draco 2021-01-26 16:43:46 +00:00
RichardTea f39ba8ddb2 Add compile error for bad error draco config
KHR_draco_mesh_compression requires
DRACO_MESH_COMPRESSION_SUPPORTED
2021-01-26 16:24:18 +00:00
RichardTea dde7605158 Implement draco decoding 2021-01-26 16:08:12 +00:00
thomasbiang 91dc904ed1
Merge branch 'master' into master 2021-01-22 13:25:31 -08:00
Kim Kulling 2bcf08370d
Merge branch 'master' into fix-gltf-vertex-colors 2021-01-21 11:54:02 +01:00
thomasbiang d7cf7847ba
Merge branch 'master' into master 2021-01-20 18:47:39 -08:00
ywang 01e61c8b9f customized node transformation format 2021-01-20 18:42:56 -08:00