Include SOG converter bootstrap chunk in cold project packages
This commit is contained in:
@@ -90,4 +90,26 @@ def test_project_package_supports_each_published_lod_without_cropping(monkeypatc
|
||||
package = worlds.package(dict(storage={"project_id":"sim-test"}, sha256="test",
|
||||
local_scene=dict(visual_url=prefix+paths[0], collision_url=prefix+paths[1])))
|
||||
assert [item["logical_path"] for item in package["artifacts"]] == paths[:-1]
|
||||
assert [item["logical_path"] for item in module.project_members(package, 1)] == paths[:3]+paths[4:6]
|
||||
assert [item["logical_path"] for item in module.project_members(package, 1)] == paths[:6]
|
||||
|
||||
|
||||
def test_cold_project_package_includes_converter_bootstrap_without_other_lod_payloads(monkeypatch):
|
||||
monkeypatch.syspath_prepend(str(Path(__file__).parents[1] / "simulation/ai-polygon"))
|
||||
module = importlib.import_module("project_assets")
|
||||
names = ["meta.json", "means_l.webp", "means_u.webp", "quats.webp", "scales.webp",
|
||||
"sh0.webp", "shN_centroids.webp", "shN_labels.webp"]
|
||||
paths = ["streamed/lod-meta.json", "collision.glb"] + [
|
||||
f"streamed/{chunk}/{name}"
|
||||
for chunk in ("0_0", "0_1", "0_01", "1_0", "1_1", "2_0", "env")
|
||||
for name in names
|
||||
]
|
||||
package = dict(visual_path=paths[0], collision_path=paths[1],
|
||||
artifacts=[dict(logical_path=name) for name in paths])
|
||||
selected = {item["logical_path"] for item in module.project_members(package, 1)}
|
||||
# The installed converter opens all eight assets of its first source
|
||||
# segment to establish SH/layout before selecting the requested LOD.
|
||||
assert {f"streamed/0_0/{name}" for name in names} <= selected
|
||||
assert {f"streamed/{chunk}/{name}" for chunk in ("1_0", "1_1", "env")
|
||||
for name in names} <= selected
|
||||
assert not any(name.startswith(("streamed/0_1/", "streamed/0_01/", "streamed/2_0/"))
|
||||
for name in selected)
|
||||
|
||||
Reference in New Issue
Block a user