Unity import: nested prefab instances crash the prefab and scene converter

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

Maintainer thường phản hồi trong vòng 1 ngày

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

Đánh giá

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

Hướng nghiên cứu

Start in Editor/Core/Unity/UnityPrefabConverter.cs, especially the transformOf construction around line 18, and trace how stripped Transform documents and m_Father references are handled. Find the Unity import tests and add a scene with two nested prefab instances. Done means the package imports without aborting, reports nested instances as skipped, preserves their children through attachment to a converted root or placeholder, and imports its textures and materials.

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

Mô tả

c:assets p:medium size:S t:bug

Current State

turian-cli import unitypackage fails on any .prefab or .unity that contains a nested prefab instance:

System.ArgumentException: An item with the same key has already been added. Key: 0
   at Turian.Editor.Core.UnityPrefabConverter.Convert(...) in Editor/Core/Unity/UnityPrefabConverter.cs:line 18

Nested instances serialize their overridden objects as stripped documents (--- !u!4 &431236325 stripped, --- !u!224 &173553075 stripped). A stripped Transform/RectTransform has m_CorrespondingSourceObject and m_PrefabInstance but no m_GameObject, so Reference(o.Body["m_GameObject"]) returns 0 for each of them and the transformOf dictionary throws on the second one. The whole import aborts, including the textures and materials in the same package. Any real-world scene with two or more nested prefabs hits this.

Tasks

  • Skip stripped objects when building transformOf (or key only objects with a non-zero m_GameObject).
  • Report nested prefab instances in the import summary as today, without aborting.
  • Children whose m_Father is a stripped transform attach to the converted root (or the instance placeholder) instead of being lost.
  • Regression test with a scene containing two nested prefab instances.

Acceptance Criteria

  • A package with nested prefab instances imports; the report lists them as skipped; textures and materials in the same package import.
  • The regression test fails without the fix.

Related

  • Unity conversion qualification (nested/variant prefabs).
Ngôn ngữ chính
C#
Star
1
Fork
1
Merge trung bình
2 giờ 7 phút
Pull request đã merge (30 ngày)
38

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 MASS4ORG/Turian

Tất cả issue của MASS4ORG/Turian

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.