feature proposal: Support for Restful uris
@hybridherbst ci sta già lavorando.
Dal 9/2/2024.
Valutazione
Questa issue non è ancora stata valutata.
Descrizione
I'd like to suggest the following addition to the GLTFComponent script to support Restful resource fetching.
Currently, the WebRequestLoader is used to download gltf models with a filename, such as: http://localhost/some/path/Avocado.gltf
This assumes the client knows the name of the entity beforehand and that the resource is available by its name. If a rest API exposes a dynamic model on a URI such as api/v1/scene/ the following problem occurs:
GLTF passes the baseURI ("http://localhost/api/v1/scene/") to the WebRequestLoader:
string directoryPath = URIHelper.GetDirectoryName(GLTFUri);
loader = new WebRequestLoader(directoryPath);
and passes the folder name ("scene") to the SceneImporter object:
sceneImporter = new GLTFSceneImporter(
URIHelper.GetFileFromUri(new Uri(GLTFUri)),
loader,
asyncCoroutineHelper
);
Leading to a concatenated URL that causes a 404 on the webserver: http://localhost/api/v1/scene/scene
Proposal: Add a new boolean flag to GLTF called "UseRest" to denote that URIs have trailing slashes but no filename. The default behaviour will continue to work as expected, only if the checkbox is ticked in the inspector, the specialized behaviour will come into action.
// Do not attach file name to URI for rest interfaces
string uri = "";
if(!UseRest)
{
uri = URIHelper.GetFileFromUri(new Uri(GLTFUri));
}
sceneImporter = Factory.CreateSceneImporter(
uri,
loader,
asyncCoroutineHelper
);
Stay tuned for the link to the pull request. Am glad to hear thoughts on this.
- Lingua principale
- C#
- Stelle
- 2.3k
- Fork
- 539
- Merge medio
- 3g 15h
- PR unite (30g)
- 2
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di KhronosGroup/UnityGLTF
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 48/100
KhronosGroup/UnityGLTF#911 · 6 commenti ·
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 25/100
KhronosGroup/UnityGLTF#894 ·
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 35/100
KhronosGroup/UnityGLTF#893 · 1 commento ·
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 38/100
KhronosGroup/UnityGLTF#890 · 3 commenti ·
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 25/100
KhronosGroup/UnityGLTF#889 · 1 commento ·
Tutte le issue di KhronosGroup/UnityGLTF
Issue simili
-
launcher item missingAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
Realm667/WolfenDoom#1758 ·
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 82/100
-
AI documentation good first issue help wanted
Difficoltà 1/5 1-3 ore Idoneità per principianti 84/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
Keboo/SimplyBudget#334 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 77/100
I maintainer di solito rispondono entro 1 giorno