Official Codebase of 3DCodeVerse
Python
scene prompts: an env or zone prompt that carries the texture pack no longer forbids textures
gaoypeng530127fe12aa
diff --git a/harness/codeverse3d/prompts/tracks/scene_env.j2 b/harness/codeverse3d/prompts/tracks/scene_env.j2index 45f4398b..0f0b1aea 100644--- a/harness/codeverse3d/prompts/tracks/scene_env.j2+++ b/harness/codeverse3d/prompts/tracks/scene_env.j2@@ -92,7 +92,7 @@ The chapters behind these rules are printed in full at the end of this brief5. **Shadows must not be jagged.** Shadow texel = `2 x shadowSpan / mapSize` <= 0.05 m: fit theshadow camera to the BOUNDS (not the whole ground), then pick mapSize 2048 (span <= 30 m) /3072 (<= 60 m) / 4096 (larger). `bias = -0.0004`, `normalBias = 0.02`.-6. No textures, no DOM, no fetch, no Math.random.+6. No {% if not (textures is defined and textures) %}textures, no {% endif %}DOM, no fetch, no Math.random.## DON'T- No assets/zones here (they come from other modules). No cameras. No `scene.background` image loads.diff --git a/harness/codeverse3d/prompts/tracks/scene_zone.j2 b/harness/codeverse3d/prompts/tracks/scene_zone.j2index 5b4af8b3..b493f253 100644--- a/harness/codeverse3d/prompts/tracks/scene_zone.j2+++ b/harness/codeverse3d/prompts/tracks/scene_zone.j2@@ -87,7 +87,7 @@ The recipes for all five points below are printed in full at the end of this bri## DON'T- No lights except small point lights for lanterns; no cameras; no sky/ground here.-- No DOM, no textures, no fetch, no Math.random (hash `rand(i)` with an explicit seed).+- No DOM, {% if not (textures is defined and textures) %}no textures, {% endif %}no fetch, no Math.random (hash `rand(i)` with an explicit seed).- Do not import assets marked NOT AVAILABLE; do not edit other files.{% if tool_cards and not single_shot %}diff --git a/harness/tests/scene_gates/test_scene_textures_stage.py b/harness/tests/scene_gates/test_scene_textures_stage.pyindex 54ef1786..fecf4f65 100644--- a/harness/tests/scene_gates/test_scene_textures_stage.py+++ b/harness/tests/scene_gates/test_scene_textures_stage.py@@ -32,3 +32,10 @@ def test_the_pack_has_the_last_word_over_the_recipes(template: str):"""The cookbook's ground chapter is long and specific; whichever comes last wins."""out = _render(template, textures="TEXTURE_BLOCK_MARKER", recipes="RECIPE_MARKER")assert out.index("RECIPE_MARKER") < out.index("TEXTURE_BLOCK_MARKER")++[email protected]("template", ["scene_env.j2", "scene_zone.j2"])+def test_a_prompt_with_the_pack_does_not_forbid_textures(template: str):+ """The rules said "no textures" and the pack below them said "use them"."""+ assert "no textures" not in _render(template, textures="TEXTURE_BLOCK_MARKER").lower()+ assert "no textures" in _render(template).lower()