feature proposal: Support for Restful uris
@hybridherbst ya está trabajando en esto.
Desde el 9/2/2024.
Evaluación
Este issue todavía no se ha evaluado.
Descripción
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.
- Lenguaje dominante
- C#
- Estrellas
- 2.3k
- Forks
- 539
- Merge medio
- 3 d 15 h
- PR fusionados (30 d)
- 2
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de KhronosGroup/UnityGLTF
-
Dificultad 4/5 3-5 días Aptitud para principiantes 48/100
KhronosGroup/UnityGLTF#911 · 6 comentarios ·
-
Dificultad 5/5 Más de una semana Aptitud para principiantes 25/100
KhronosGroup/UnityGLTF#894 ·
-
Dificultad 3/5 1-2 días Aptitud para principiantes 35/100
KhronosGroup/UnityGLTF#893 · 1 comentario ·
-
Vertex reordering after importAbierto
Dificultad 4/5 3-5 días Aptitud para principiantes 38/100
KhronosGroup/UnityGLTF#890 · 3 comentarios ·
-
Dificultad 5/5 Más de una semana Aptitud para principiantes 25/100
KhronosGroup/UnityGLTF#889 · 1 comentario ·
Todos los issues de KhronosGroup/UnityGLTF
Issues similares
-
launcher item missingAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
Realm667/WolfenDoom#1758 ·
-
SDK version compatibility issueAbierto
Dificultad 1/5 Menos de una hora Aptitud para principiantes 82/100
-
AI documentation good first issue help wanted
Dificultad 1/5 1-3 horas Aptitud para principiantes 84/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
Keboo/SimplyBudget#334 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 77/100
Los mantenedores suelen responder en 1 día