-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_scene_to_3d_set.py
More file actions
73 lines (61 loc) · 2.17 KB
/
test_scene_to_3d_set.py
File metadata and controls
73 lines (61 loc) · 2.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
import json
import os
import sys
from pathlib import Path
# Add src to path
sys.path.append(os.getcwd())
from src.three_d.set_builder import SetBuilderEngine
def run_set_builder_test():
print("🏙️ STORYCORE 3D SET BUILDER TEST - Scene Layout 🏙️")
print("=" * 60)
# 1. Create Dummy Scene Breakdown
breakdown_data = {
"detailed_scenes": [
{
"scene_id": "ANYA_INTRO_01",
"environment": {
"type": "interior",
"atmosphere": "peaceful"
},
"characters": [
{
"character_id": "ANYA_V2",
"name": "Anya",
"role_in_scene": "primary_focus",
"positioning": {"world_position": (0.0, 0.0, 0.0)}
}
],
"lighting": {
"primary": "warm_morning",
"intensity": "medium"
},
"composition": {
"style": "cinematic_portrait",
"focal_length": 50
}
}
]
}
breakdown_file = "exports/test_scene_breakdown.json"
os.makedirs("exports", exist_ok=True)
with open(breakdown_file, "w") as f:
json.dump(breakdown_data, f, indent=2)
print(f"✓ Analysis file created: {breakdown_file}")
# 2. Run Set Builder Engine
engine = SetBuilderEngine()
scene = breakdown_data["detailed_scenes"][0]
print("\nDrafting 3D Layout (Primitives)...")
layout = engine.generate_layout_from_breakdown(scene)
print(f"✓ Env Template: {layout.environment_type}")
print(f"✓ Primitives Placed: {[p.name for p in layout.primitives]}")
print(f"✓ Puppets Assigned: {[p['name'] for p in layout.puppets]}")
# 3. Export for ComfyUI (PrimitiveAnything)
manifest_path = engine.export_comfy_manifest(layout)
print(f"\n✓ ComfyUI Manifest generated: {manifest_path}")
print(f"✓ Ready for Node: 'PrimitiveAnything_Loader' / 'Playbook_Scenario'")
# 4. Preview Sync Logic
sync_cmd = engine.sync_to_blender(layout)
print(f"\n[Blender-Link]: {sync_cmd}")
print("🏆 SET PRODUCTION TEST SUCCESSFUL.")
if __name__ == "__main__":
run_set_builder_test()