Magnum::Trade::AnySceneImporter class

Any scene importer plugin.

Detects file type based on file extension, loads corresponding plugin and then tries to open the file with it. Supported formats:

  • 3ds Max 3DS and ASE (*.3ds, *.ase), loaded with any plugin that provides 3dsImporter
  • AC3D (*.ac), loaded with any plugin that provides Ac3dImporter
  • Blender 3D (*.blend), loaded with any plugin that provides BlenderImporter
  • Biovision BVH (*.bvh), loaded with any plugin that provides BvhImporter
  • CharacterStudio Motion (*.csm), loaded with any plugin that provides CsmImporter
  • COLLADA (*.dae), loaded with any plugin that provides ColladaImporter
  • DirectX X (*.x), loaded with any plugin that provides DirectXImporter
  • AutoCAD DXF (*.dxf), loaded with any plugin that provides DxfImporter
  • Autodesk FBX (*.fbx), loaded with any plugin that provides FbxImporter
  • glTF (*.gltf, *.glb), loaded with any plugin that provides GltfImporter
  • Industry Foundation Classes (IFC/Step) (*.ifc), loaded with any plugin that provides IfcImporter
  • Irrlicht Mesh and Scene (*.irrmesh, *.irr), loaded with any plugin that provides IrrlichtImporter
  • LightWave, LightWave Scene (*.lwo, *.lws), loaded with any plugin that provides LightWaveImporter
  • Modo (*.lxo), loaded with any plugin that provides ModoImporter
  • Milkshape 3D (*.ms3d), loaded with any plugin that provides MilkshapeImporter
  • Wavefront OBJ (*.obj), loaded with ObjImporter or any other plugin that provides it
  • Ogre XML (*.xml), loaded with any plugin that provides OgreImporter
  • OpenGEX (*.ogex), loaded with OpenGexImporter or any other plugin that provides it
  • Stanford (*.ply), loaded with StanfordImporter or any other plugin that provides it
  • Stereolitography (*.stl), loaded with any plugin that provides StlImporter
  • TrueSpace (*.cob, *.scn), loaded with any plugin that provides TrueSpaceImporter
  • Unreal (*.3d), loaded with any plugin that provides UnrealImporter
  • Valve Model (*.smd, *.vta), loaded with any plugin that provides ValveImporter
  • XGL (*.xgl, *.zgl), loaded with any plugin that provides XglImporter

Only loading from files is supported.

Usage

This plugin depends on the Trade library and is built if WITH_ANYSCENEIMPORTER is enabled when building Magnum. To use as a dynamic plugin, load "AnySceneImporter" via Corrade::PluginManager::Manager.

Additionally, if you're using Magnum as a CMake subproject, do the following:

set(WITH_ANYSCENEIMPORTER ON CACHE BOOL "" FORCE)
add_subdirectory(magnum EXCLUDE_FROM_ALL)

# So the dynamically loaded plugin gets built implicitly
add_dependencies(your-app Magnum::AnySceneImporter)

To use as a static plugin or as a dependency of another plugin with CMake, you need to request the AnySceneImporter component of the Magnum package in CMake and link to the Magnum::AnySceneImporter target:

find_package(Magnum REQUIRED AnySceneImporter)

# ...
target_link_libraries(your-app PRIVATE Magnum::AnySceneImporter)

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

Interface proxying and option propagation

On a call to openFile(), a file format is detected from the extension and a corresponding plugin is loaded. After that, flags set via setFlags() and options set through configuration() are propagated to the concrete implementation, with a warning emitted in case given option is not present in the default configuration of the target plugin.

Calls to the animation(), scene(), light(), camera(), object2D(), object3D(), skin2D(), skin3D(), mesh(), material(), texture(), image1D(), image2D(), image3D() and corresponding count-/name-related functions are then proxied to the concrete implementation. The close() function closes and discards the internally instantiated plugin; isOpened() works as usual.

Base classes

class AbstractImporter
Base for importer plugins.

Constructors, destructors, conversion operators

AnySceneImporter(PluginManager::Manager<AbstractImporter>& manager) explicit
Constructor with access to plugin manager.
AnySceneImporter(PluginManager::AbstractManager& manager, const std::string& plugin) explicit
Plugin manager constructor.