feature proposal: Support for Restful uris
@hybridherbst đang làm issue này rồi.
Từ ngày 9/2/2024.
Đánh giá
Issue này chưa được đánh giá.
Mô tả
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.
- Ngôn ngữ chính
- C#
- Star
- 2.3k
- Fork
- 539
- Merge trung bình
- 3 ngày 15 giờ
- Pull request đã merge (30 ngày)
- 2
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của KhronosGroup/UnityGLTF
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
KhronosGroup/UnityGLTF#911 · 6 bình luận ·
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
KhronosGroup/UnityGLTF#894 ·
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 35/100
KhronosGroup/UnityGLTF#893 · 1 bình luận ·
-
Vertex reordering after importĐang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 38/100
KhronosGroup/UnityGLTF#890 · 3 bình luận ·
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
KhronosGroup/UnityGLTF#889 · 1 bình luận ·
Tất cả issue của KhronosGroup/UnityGLTF
Issue tương tự
-
launcher item missingĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
Realm667/WolfenDoom#1758 ·
-
SDK version compatibility issueĐang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 82/100
-
AI documentation good first issue help wanted
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 84/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
Keboo/SimplyBudget#334 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 77/100
Maintainer thường phản hồi trong vòng 1 ngày