mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-06 22:47:29 -06:00
Add support for reading glTF files
Contributes to issue CURA-6739.
This commit is contained in:
parent
3a3ba6d590
commit
e761b2c2a7
2 changed files with 23 additions and 1 deletions
|
@ -27,7 +27,7 @@ class TrimeshReader(MeshReader):
|
||||||
def __init__(self) -> None:
|
def __init__(self) -> None:
|
||||||
super().__init__()
|
super().__init__()
|
||||||
|
|
||||||
self._supported_extensions = [".dae", ".ply"]
|
self._supported_extensions = [".dae", ".gltf", ".glb", ".ply"]
|
||||||
MimeTypeDatabase.addMimeType(
|
MimeTypeDatabase.addMimeType(
|
||||||
MimeType(
|
MimeType(
|
||||||
name = "model/vnd.collada+xml",
|
name = "model/vnd.collada+xml",
|
||||||
|
@ -35,6 +35,20 @@ class TrimeshReader(MeshReader):
|
||||||
suffixes = ["dae"]
|
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(
|
MimeTypeDatabase.addMimeType(
|
||||||
MimeType(
|
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.
|
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",
|
"extension": "dae",
|
||||||
"description": i18n_catalog.i18nc("@item:inlistbox", "COLLADA Digital Asset Exchange")
|
"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",
|
"extension": "ply",
|
||||||
"description": i18n_catalog.i18nc("@item:inlistbox", "Stanford Triangle Format")
|
"description": i18n_catalog.i18nc("@item:inlistbox", "Stanford Triangle Format")
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue