Import progress doesn't count downloaded bytes

Đang mở
#845 4 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
35/100
Loại issue
Lỗi
Độ rõ ràng
Cần làm rõ
Mức độ hoạt động
Đình trệ
Công nghệ
csharp, unity
Lĩnh vực
game-dev

Hướng nghiên cứu

Bắt đầu tại GLTFSceneImporter.LoadSceneAsync và các điểm vào ImportProgress và UnityWebRequestLoader, sau đó lần theo cách các lượt tải xuống qua web báo cáo tiến trình trước khi quá trình import buffer, node và texture bắt đầu. Hoàn thành khi ImportProgress phản ánh số byte đã tải xuống trong lúc tải model qua web, để thanh tải có thể tiến triển trong suốt thao tác; issue không nêu tên file hoặc test nào.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

Describe the bug 💬

The implementation ImportProgress.Progress doesn't take into consideration the download bytes when importing models from the web.

This means that when importing a web model, the Progress value stays at 0 during all the download phase (which is generally the longest one), then it rapidly goes to 1 when importing buffers, nodes and textures.

In this way it is impossible to create a loading bar. The only alternative I found is to download the file separately and then import it as usual.

Steps to reproduce 🔢

Import a .glb from web url with LoadSceneAsync() like this

private CancellationTokenSource tokenSource;
string directory = Path.GetDirectoryName(someWebUrl);
string fileName  = Path.GetFileName(someWebUrl);

...

ImportOptions importOpt = new ImportOptions
{
    DataLoader   = new UnityWebRequestLoader(directory),
    CameraImport = CameraImportOption.None
};

GLTFSceneImporter importer = new GLTFSceneImporter(fileName, importOpt);
Progress<ImportProgress> progressReporter = new Progress<ImportProgress>();
progressReporter.ProgressChanged += OnImportProgress;
importCancellationTokenSource = new CancellationTokenSource();
await importer.LoadSceneAsync(-1, true, OnImportComplete, tokenSource.Token, progressReporter);

...

private void OnImportProgress(object sender, ImportProgress prog)
{
    Debug.Log(Time.realTimeSinceStartup + " - " prog.ToString());
}

Notice how the logs show almost no progress while downloading, and then abruptly increase when the GLB import phase begins.

Files to reproduce the issue ♻

No response

Editor Version 🎲

6000.0.37

Render Pipeline and version

Any

Operating System 👩‍💻

Windows

When does this problem happen?
  • Editor Import
  • Runtime Import
  • Editor Export
  • Runtime Export
Additional Info 📜

No response

Validations 🩹
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

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. 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.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của KhronosGroup/UnityGLTF

Tất cả issue của KhronosGroup/UnityGLTF

Issue tương tự

Thêm issue về C#

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.