class
AnySceneImporterAny 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 provides3dsImporter
- 3D Manufacturing Format (
*.3mf
), loaded with any plugin that provides3mfImporter
- AC3D (
*.ac
), loaded with any plugin that providesAc3dImporter
- Blender 3D (
*.blend
), loaded with any plugin that providesBlenderImporter
- Biovision BVH (
*.bvh
), loaded with any plugin that providesBvhImporter
- CharacterStudio Motion (
*.csm
), loaded with any plugin that providesCsmImporter
- COLLADA (
*.dae
), loaded with any plugin that providesColladaImporter
- DirectX X (
*.x
), loaded with any plugin that providesDirectXImporter
- AutoCAD DXF (
*.dxf
), loaded with any plugin that providesDxfImporter
- Autodesk FBX (
*.fbx
), loaded with any plugin that providesFbxImporter
- glTF (
*.gltf
,*.glb
), loaded with GltfImporter or any other plugin that provides it - Industry Foundation Classes (IFC/Step) (
*.ifc
), loaded with any plugin that providesIfcImporter
- Irrlicht Mesh and Scene (
*.irrmesh
,*.irr
), loaded with any plugin that providesIrrlichtImporter
- LightWave, LightWave Scene (
*.lwo
,*.lws
), loaded with any plugin that providesLightWaveImporter
- Modo (
*.lxo
), loaded with any plugin that providesModoImporter
- Milkshape 3D (
*.ms3d
), loaded with any plugin that providesMilkshapeImporter
- Wavefront OBJ (
*.obj
), loaded with ObjImporter or any other plugin that provides it - Ogre XML (
*.xml
), loaded with any plugin that providesOgreImporter
- 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 providesStlImporter
- TrueSpace (
*.cob
,*.scn
), loaded with any plugin that providesTrueSpaceImporter
- Unreal (
*.3d
), loaded with any plugin that providesUnrealImporter
- Valve Model (
*.smd
,*.vta
), loaded with any plugin that providesValveImporter
- XGL (
*.xgl
,*.zgl
), loaded with any plugin that providesXglImporter
Only loading from files is supported as the filename is used to detect the format, however ImporterFeature::
Usage
This plugin depends on the Trade library and is built if MAGNUM_WITH_ANYSCENEIMPORTER
is enabled when building Magnum. To use as a dynamic plugin, load "AnySceneImporter"
via Corrade::
Additionally, if you're using Magnum as a CMake subproject, do the following:
set(MAGNUM_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(), file callbacks set via setFileCallback() and options set through configuration() are propagated to the concrete implementation. A warning is emitted in case an option set is not present in the default configuration of the target plugin.
Calls to the animation(), scene(), light(), camera(), 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.
While the meshAttributeName(), meshAttributeForName(), sceneFieldName() and sceneFieldForName() APIs can be called without a file opened, they return an empty string or an invalid attribute in that case.
Besides delegating the flags, the AnySceneImporter itself recognizes ImporterFlag::
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 Containers:: StringView& plugin) explicit - Plugin manager constructor.