Magnum::Trade::StanfordSceneConverter class new in 2020.06

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 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 and Loading and using plugins for more information.

Behavior and limitations

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.

The data are by default exported in machine endian, use the endianness configuration option to perform an endian swap on the output data.

Plugin-specific config

It's possible to tune various import 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.

Base classes

class AbstractSceneConverter new in 2020.06
Base for scene converter plugins.

Constructors, destructors, conversion operators

StanfordSceneConverter(PluginManager::AbstractManager& manager, const std::string& plugin) explicit
Plugin manager constructor.