Magnum::Trade::StanfordSceneConverter class new in 2020.06

Stanford PLY converter plugin.

Exports meshes to either Little- or Big-Endian binary *.ply files with triangle faces. You can use StanfordImporter to import files in this format.


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::PluginManager::Manager.

Additionally, if you're using Magnum as a CMake subproject, bundle the magnum-plugins repository and do the following:

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 MagnumPlugins::StanfordSceneConverter target:

find_package(MagnumPlugins REQUIRED StanfordSceneConverter)

# ...
target_link_libraries(your-app PRIVATE MagnumPlugins::StanfordSceneConverter)

See Downloading and building plugins, Plugin usage with CMake, Loading and using plugins and File format support for more information.

Behavior and limitations

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:

Supported component formats — attributes of other formats and implementation-specific formats are skipped with a warning:

Index type of the input mesh is preserved, written as uchar / ushort / uint. Face size is always 3, written as uchar. if the mesh is not indexed, a trivial index buffer of type MeshIndexType::UnsignedInt is generated. The faces are always triangles, MeshPrimitive::TriangleStrip and MeshPrimitive::TriangleFan meshes are converted to indexed MeshPrimitive::Triangles first; points, lines and other primitives are not supported.

Plugin-specific configuration

It's possible to tune various output options through configuration(). See below for all options and their default values:

# Endianness of the output. Valid values are little, big and native (which
# will choose either big or little depending on the platform)

# The non-standard MeshAttribute::ObjectId is by default written under this
# name. Change if you want to use a different identifier.

See Editing plugin-specific configuration for more information and an example showing how to edit the configuration values.

Base classes

class AbstractSceneConverter new in 2020.06
Base for scene converter plugins.

Constructors, destructors, conversion operators

StanfordSceneConverter(PluginManager::AbstractManager& manager, const Containers::StringView& plugin) explicit
Plugin manager constructor.