Browse Source

AnySceneImporter: recognize the *.vrm extension.

It's a glTF with some extra additions. Not sure why they cannot just
keep the file extension and expose their stuff via glTF extensions, but
whatever.
pull/674/head
Vladimír Vondruš 1 year ago
parent
commit
c390437b76
  1. 2
      doc/changelog.dox
  2. 4
      src/MagnumPlugins/AnySceneImporter/AnySceneImporter.cpp
  3. 4
      src/MagnumPlugins/AnySceneImporter/AnySceneImporter.h
  4. 1
      src/MagnumPlugins/AnySceneImporter/Test/AnySceneImporterTest.cpp

2
doc/changelog.dox

@ -967,7 +967,7 @@ See also:
in @relativeref{Trade,AnyImageConverter}
- Recognizing WebP files in @relativeref{Trade,AnyImageConverter}
- Recognizing glTF files in @relativeref{Trade,AnySceneConverter}
- Recognizing 3MF files in @relativeref{Trade,AnySceneImporter}
- Recognizing 3MF and VRM files in @relativeref{Trade,AnySceneImporter}
- Recognizing OpenVBD files in @relativeref{Trade,AnyImageImporter} and
@relativeref{Trade,AnyImageConverter}
- @ref Audio::AnyImporter "AnyAudioImporter",

4
src/MagnumPlugins/AnySceneImporter/AnySceneImporter.cpp

@ -106,7 +106,9 @@ void AnySceneImporter::doOpenFile(const Containers::StringView filename) {
else if(normalizedExtension == ".fbx"_s)
plugin = "FbxImporter"_s;
else if(normalizedExtension == ".gltf"_s ||
normalizedExtension == ".glb"_s)
normalizedExtension == ".glb"_s ||
/* https://github.com/vrm-c/vrm-specification/blob/master/specification/0.0/README.md#file-extension */
normalizedExtension == ".vrm"_s)
plugin = "GltfImporter"_s;
else if(normalizedExtension == ".ifc"_s)
plugin = "IfcImporter"_s;

4
src/MagnumPlugins/AnySceneImporter/AnySceneImporter.h

@ -71,8 +71,8 @@ tries to open the file with it. Supported formats:
- 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 @ref GltfImporter or any other plugin
that provides it
- glTF (`*.gltf`, `*.glb`) and [VRM](https://vrm.dev/en/) (`*.vrm`), loaded
with @ref GltfImporter or any other plugin that provides it
- Industry Foundation Classes (IFC/Step) (`*.ifc`), loaded with any plugin
that provides `IfcImporter`
- Irrlicht Mesh and Scene (`*.irrmesh`, `*.irr`), loaded with any plugin that

1
src/MagnumPlugins/AnySceneImporter/Test/AnySceneImporterTest.cpp

@ -128,6 +128,7 @@ constexpr struct {
{"FBX", "autodesk.fbx", "FbxImporter"},
{"glTF", "khronos.gltf", "GltfImporter"},
{"glTF binary", "khronos.glb", "GltfImporter"},
{"VRM", "humanoid.vrm", "GltfImporter"},
{"OpenGEX", "eric.ogex", "OpenGexImporter"},
{"Stanford PLY", "bunny.ply", "StanfordImporter"},
{"Stanford PLY uppercase", "ARMADI~1.PLY", "StanfordImporter"},

Loading…
Cancel
Save