mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-11 01:19:01 +08:00
Add support for reading glTF files
Contributes to issue CURA-6739.
This commit is contained in:
parent
3a3ba6d590
commit
e761b2c2a7
@ -27,7 +27,7 @@ class TrimeshReader(MeshReader):
|
||||
def __init__(self) -> None:
|
||||
super().__init__()
|
||||
|
||||
self._supported_extensions = [".dae", ".ply"]
|
||||
self._supported_extensions = [".dae", ".gltf", ".glb", ".ply"]
|
||||
MimeTypeDatabase.addMimeType(
|
||||
MimeType(
|
||||
name = "model/vnd.collada+xml",
|
||||
@ -35,6 +35,20 @@ class TrimeshReader(MeshReader):
|
||||
suffixes = ["dae"]
|
||||
)
|
||||
)
|
||||
MimeTypeDatabase.addMimeType(
|
||||
MimeType(
|
||||
name = "model/gltf-binary",
|
||||
comment = "glTF Binary",
|
||||
suffixes = ["glb"]
|
||||
)
|
||||
)
|
||||
MimeTypeDatabase.addMimeType(
|
||||
MimeType(
|
||||
name = "model/gltf+json",
|
||||
comment = "glTF Embedded JSON",
|
||||
suffixes = ["gltf"]
|
||||
)
|
||||
)
|
||||
MimeTypeDatabase.addMimeType(
|
||||
MimeType(
|
||||
name = "application/x-ply", # Wikipedia lists the MIME type as "text/plain" but that won't do as it's not unique to PLY files.
|
||||
|
@ -14,6 +14,14 @@ def getMetaData():
|
||||
"extension": "dae",
|
||||
"description": i18n_catalog.i18nc("@item:inlistbox", "COLLADA Digital Asset Exchange")
|
||||
},
|
||||
{
|
||||
"extension": "glb",
|
||||
"description": i18n_catalog.i18nc("@item:inlistbox", "glTF Binary")
|
||||
},
|
||||
{
|
||||
"extension": "gltf",
|
||||
"description": i18n_catalog.i18nc("@item:inlistbox", "glTF Embedded JSON")
|
||||
},
|
||||
{
|
||||
"extension": "ply",
|
||||
"description": i18n_catalog.i18nc("@item:inlistbox", "Stanford Triangle Format")
|
||||
|
Loading…
x
Reference in New Issue
Block a user