Magnum::Trade::OpenGexImporter class

OpenGEX importer.

Imports the OpenDDL-based OpenGEX format.

Supports importing of scene, object, camera, mesh, texture and image data.

This plugin depends on the Trade library and the AnyImageImporter plugin. It is built if WITH_OPENGEXIMPORTER is enabled when building Magnum Plugins. To use as a dynamic plugin, you need to load the "OpenGexImporter" plugin from MAGNUM_PLUGINS_IMPORTER_DIR. To use as a static plugin or as a dependency of another plugin with CMake, you need to request the OpenGexImporter component of the MagnumPlugins package and link to the MagnumPlugins::OpenGexImporter target. See Downloading and building plugins, Plugin usage with CMake and Loading and using plugins for more information.

Behavior and limitations

The plugin supports Feature::OpenData and Feature::FileCallback features. The importer fully loads the top-level file during initial import, meaning there is at most one ImporterFileCallbackPolicy::LoadTemporary callback followed by ImporterFileCallbackPolicy::Close and the data can freed right after the openData() / openFile() function exits. In case of images, the files are loaded on-demand inside image2D() calls with ImporterFileCallbackPolicy::LoadTemporary and ImporterFileCallbackPolicy::Close is emitted right after the file is fully read.

  • Import of animation data is not supported at the moment.
  • half data type results in parsing error.
  • On OpenGL ES, usage of double type and on WebGL additionally also usage of 64bit integer types results in parsing error.

Scene hierarchy import

  • Object-only transformations are not supported.
  • Additional material references after the first one for given geometry node are ignored.
  • Geometry node visibility, shadow and motion blur properties are ignored.

Camera import

  • Camera type is always CameraType::Perspective3D
  • Default FoV for cameras that don't have it specified is 35.0_degf
  • Default near and far plane for cameras that don't have it specified is 0.01f and 100.0f
  • Aspect ratio is ignored and hardcoded to 1.0f

Light import

  • Light attenuation properties are not yet supported.
  • Light textures are not yet supported.

Mesh import

  • 64bit indices are not supported.
  • Quads are not supported.
  • Additional mesh LoDs after the first one are ignored.
  • w coordinate for vertex positions and normals is ignored if present.

Material import

  • Alpha mode is always MaterialAlphaMode::Opaque and alpha mask always 0.5f
  • Two-sided property is ignored, always set to false
  • All materials are imported as Trade::PhongMaterialData with ambient color always set to 0x000000ff_rgbaf.
  • emission, opacity and transparency attributes are not supported.
  • normal textures are not supported.

Texture import

Access to internal importer state

Generic importer for OpenDDL files is implemented in the OpenDdl::Document class available as part of this plugin and access to it is provided through importer-specific data accessors:

Base classes

class AbstractImporter
Base for importer plugins.

Constructors, destructors, conversion operators

OpenGexImporter() explicit
Default constructor.
OpenGexImporter(PluginManager::Manager<AbstractImporter>& manager) explicit
OpenGexImporter(PluginManager::AbstractManager& manager, const std::string& plugin) explicit
Plugin manager constructor.

Public functions

auto importerState() const -> const OpenDdl::Document*
Importer state.

Function documentation

Magnum::Trade::OpenGexImporter::OpenGexImporter() explicit

Default constructor.

In case you want to open images, use OpenGexImporter(PluginManager::Manager<AbstractImporter>&) instead.

Magnum::Trade::OpenGexImporter::OpenGexImporter(PluginManager::Manager<AbstractImporter>& manager) explicit


The plugin needs access to plugin manager for importing images.

const OpenDdl::Document* Magnum::Trade::OpenGexImporter::importerState() const

Importer state.

Provides access to the parsed OpenDDL document. See class documentation for more information.