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>
* 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>
* 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>
* +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>
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>
* 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>
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>
* 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>
- 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.