class new in 2020.06StanfordSceneConverter
Stanford PLY converter plugin.
Exports to either Little- or Big-Endian binary files with triangle faces.
This plugin depends on the Trade library and is built if
MAGNUM_WITH_STANFORDSCENECONVERTER is enabled when building Magnum Plugins. To use as a dynamic plugin, load
"StanfordSceneConverter" via Corrade::
Additionally, if you're using Magnum as a CMake subproject, bundle the magnum-plugins repository and do the following:
set(MAGNUM_WITH_STANFORDSCENECONVERTER ON CACHE BOOL "" FORCE) add_subdirectory(magnum-plugins EXCLUDE_FROM_ALL) # So the dynamically loaded plugin gets built implicitly add_dependencies(your-app MagnumPlugins::StanfordSceneConverter)
To use as a static plugin or as a dependency of another plugin with CMake, put FindMagnumPlugins.cmake into your
modules/ directory, request the
StanfordSceneConverter component of the
MagnumPlugins package and link to the
find_package(MagnumPlugins REQUIRED StanfordSceneConverter) # ... target_link_libraries(your-app PRIVATE MagnumPlugins::StanfordSceneConverter)
Produces binary files, ASCII export is not implemented. The data are by default exported in machine endian, use the
endianness configuration option to perform an endian swap on the output data.
Exports the following attributes, custom attributes and attributes not listed below are skipped with a warning:
Position, written as
z. The position attribute has to be always present, 2D positions are not supported.
nz, if present
v, if present
blue, if present, and optional
alpha, if the input is four-channel
ObjectId by default as
object_id, if present, use the
objectIdAttributeconfiguration option to change the identifier that's being written.
Supported component formats — attributes of other formats and implementation-specific formats are skipped with a warning:
Float, written as
UnsignedByte / VertexFormat:: UnsignedByteNormalized as
Byte / VertexFormat:: ByteNormalized as
UnsignedShort / VertexFormat:: UnsignedShortNormalized as
Short / VertexFormat:: ShortNormalized as
Index type of the input mesh is preserved, written as
uint. Face size is always
3, written as
uchar. if the mesh is not indexed, a trivial index buffer of type MeshIndexType::
It's possible to tune various output options through configuration(). See below for all options and their default values:
[configuration] # Endianness of the output. Valid values are little, big and native (which will # choose either big or little depending on the platform) endianness=native # The non-standard MeshAttribute::ObjectId is by default written under this # name. Change if you want to use a different identifier. objectIdAttribute=object_id
See Editing plugin-specific configuration for more information and an example showing how to edit the configuration values.