Update Magnum with new scene tools, bindings and plugin additions #2114
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivation and Context
Continuation of #2100, with another ~10 days and >10 thousand lines of changes on the Magnum side. A large batch of features got finished and merged to
master
this time, and some breaking changes were needed to keep the API organized -- see below.What's new:
reshape()
doesPixelFormat
simplifyFailEmpty
option in MeshOptimizerSceneConverter that'll make it fail in case simplification produces an empty mesh. By default it produces an emptyMeshData
, which can't be used to produce a valid glTF file. Related is also a minor fix to a bug that caused the plugin to trigger an assertion in presence of an empty mesh.forceBitDepth
option for StbImageImporter and PngImporter that allows opening 16-bit images as 8-bit and vice versa. Added to work around a limitation of the Basis library which can only deal with 8-bit-per-pixel images.New tools, especially of interest to @jturner65:
SceneData
out of loose data arrays.combineFields()
, all of the above are also exposed to Python in the scenetools and meshtools modules, together with an ability to export scenes through trade.AbstractSceneConverter.Additions to the magnum-sceneconverter utility, which you however usually use via the prebuilt tools instead of through Habitat:
--passthrough-on-mesh-converter-failure
and--passthrough-on-image-converter-failure
options, making it possible to fall back to the original data for a particular failed-M
or-P
conversion--prefer
option, adding an ability to choose an alternative plugin implementation, such as SpngImporter instead of the default PngImporter that may be as much as 2x faster--set
option, allowing to set global plugin options like overriding bit depth of imported images, quality of exported JPEGs or Basis compression options. This used to be only partially possible before, done in a hacky way with[imageConverter]
options in GltfSceneConverter, and--set
is now the preferred way.--object-hierarchy
option for--info-objects
that'll visualize the object hierarchy by indenting the output. Useful for discovering object groupings or redundant nodes in a scene.Trade::LightData::Type
is now Trade::LightType so it's no longer needed to include the whole class for an enum declarationSceneTools::flattenTransformationHierarchy3D()
is renamed to SceneTools::absoluteFieldTransformations3D(), same change is done for thescenetools.flatten_transformation_hierarchy3d()
Python binding that's now scenetools.absolute_field_transformations3d()MeshTools::owned()
is now MeshTools::copy()The old C++ APIs are still present but marked as deprecated and thus causing compiler warnings. For the Python bindings however it's a hard change with no fallback. I updated the affected code here, some changes are needed in habitat-lab as well, but there I unfortunately have no easy way to verify the changes. @aclegg3 can you handle the updates on the habitat-lab side? Thank you.
How Has This Been Tested
🍏