Assorted ~10kLOC update containing mainly various prerequisites for the batch renderer, and additions to Python bindings.
More efficient packing of GL::Buffer and GL::Mesh internals -- it used to take 48 bytes per mesh attribute, now it's just 24. It also no longer does nasty voodoo with in-place construction of a std::vector.
New MaterialTools::removeDuplicates() utility for reducing the amount of redundant materials in a (batch composite) file. There's a corresponding magnum-sceneconverter --remove-duplicate-materials option as well, and it's in the materialtools Python bindings too. In practice it will need a material canonicalization utility (such as removing empty layers, redundant default attributes and such) to truly remove all duplicates, that's coming next.
New SceneTools::mapIndexField() family of tools for remapping mesh, material, camera, ... references in a scene, such as for example after duplicate material removal.
Python bindings:
Implemented pickling support for all Math types. Could help with https://github.com/facebookresearch/habitat-sim/issues/2213, unfortunately I didn't get a confirmation from anybody that the proposed changes actually work, so it's just a "best intentions" fix, I can't claim it actually resolves the problem.
Exposed the trade.MaterialData class, the materialtools library and corresponding APIs in importers and scene converters, which was one of the last missing pieces for full Python-side support for arbitrary asset processing and conversion.
The math module now raises exceptions in all cases where the C++ code fires an assertion. Those used to be assertions that were left even in release builds (and thus causing the Python interpreter to abort, which is bad), but got changed to debug-only asserts in https://github.com/facebookresearch/habitat-sim/pull/2100 (thus causing the Python bindings to silently give wrong results, which is perhaps even worse). Invalid usage now raises Python exceptions as it should. Reported by @xavierpuigf.
Motivation and Context
Assorted ~10kLOC update containing mainly various prerequisites for the batch renderer, and additions to Python bindings.
GL::Buffer
andGL::Mesh
internals -- it used to take 48 bytes per mesh attribute, now it's just 24. It also no longer does nasty voodoo with in-place construction of astd::vector
.magnum-sceneconverter --remove-duplicate-materials
option as well, and it's in the materialtools Python bindings too. In practice it will need a material canonicalization utility (such as removing empty layers, redundant default attributes and such) to truly remove all duplicates, that's coming next.Oh, and I made Utility::String::lowercase() >10x faster while being idle on the weekly call, and then 2x more using AVX2, so ~25x faster. See mosra/corrade@808520106e93fcfe158375b7658e0121c439ea27 and https://github.com/mosra/corrade/compare/8010c5cc39d5b17c868c180e34c146c38eac6105...d40ff9dde28bc72a398b1b402bb5ca6844549c2d for details, the "naive" case below is the previous implementation.
How Has This Been Tested
:green_heart: