model/godot + data/tres + codecs/text/GodotVariant: Godot text scenes (.tscn / .escn) read + write against Godot 4's loader, .tres resources as data
docs/STYLE.md: the layout block lists codecs/text/GodotVariant (DOCS lint).
This commit is contained in:
1 parent
9c02ebdee5
commit
8f26e32a71
24 files changed
+3649
-5
No files matched your search
@@ -1,9 +1,43 @@
|
||||
# Docs inputs for the engine / level-editor sections of the scene, tile map, archive and data pages (tools/fixtures.py,
|
||||
# tools/docs_check.py): the hand-written ASE of tools/fixtures/ase.py, LDtk's AutoLayers_2_stamps sample (tools/fixtures/ldtk.py),
|
||||
# HaxeFlixel's TurnBasedRPG Ogmo project and level (tests/fixtures/ogmo).
|
||||
# HaxeFlixel's TurnBasedRPG Ogmo project and level (tests/fixtures/ogmo), a small Godot scene and resource.
|
||||
# tests/gen/docs_engines.luau { files = { [name] = bytes }, vars = { aseText = "hand.ase", ... } }
|
||||
import importlib.util, os
|
||||
|
||||
TSCN = """[gd_scene load_steps=3 format=3]
|
||||
|
||||
[sub_resource type="StandardMaterial3D" id="Mat_1"]
|
||||
albedo_color = Color(1, 0.5, 0, 1)
|
||||
metallic = 0.5
|
||||
|
||||
[sub_resource type="BoxMesh" id="Box_1"]
|
||||
material = SubResource("Mat_1")
|
||||
size = Vector3(1, 2, 1)
|
||||
|
||||
[node name="World" type="Node3D"]
|
||||
|
||||
[node name="Box" type="MeshInstance3D" parent="."]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 2, 0, 0)
|
||||
mesh = SubResource("Box_1")
|
||||
|
||||
[node name="Camera" type="Camera3D" parent="."]
|
||||
fov = 60.0
|
||||
|
||||
[node name="Hud" type="Node2D" parent="."]
|
||||
position = Vector2(10, 20)
|
||||
"""
|
||||
|
||||
TRES = """[gd_resource type="StandardMaterial3D" load_steps=2 format=3]
|
||||
|
||||
[ext_resource type="Texture2D" path="res://brick.png" id="1"]
|
||||
|
||||
[resource]
|
||||
albedo_color = Color(0.8, 0.4, 0.2, 1)
|
||||
albedo_texture = ExtResource("1")
|
||||
metallic = 0.25
|
||||
roughness = 1.0
|
||||
"""
|
||||
|
||||
INPUTS = ["tools/docs_check.py", "tools/fixtures/ase.py", "tools/fixtures/ldtk.py", "tests/fixtures/ogmo"]
|
||||
|
||||
|
||||
@@ -20,5 +54,7 @@ def generate(ctx):
|
||||
files["stamps.ldtk"] = open(os.path.join(mod(ctx, "ldtk").samples_dir(ctx), "AutoLayers_2_stamps.ldtk"), "rb").read()
|
||||
for f in ("turnBasedRPG.ogmo", "room-001.json"):
|
||||
files[f] = ctx.read("tests/fixtures/ogmo/" + f)
|
||||
vars = {"aseText": "hand.ase", "ldtkText": "stamps.ldtk", "ogmoProjectText": "turnBasedRPG.ogmo", "ogmoLevelText": "room-001.json"}
|
||||
files["world.tscn"] = TSCN.encode()
|
||||
files["brick.tres"] = TRES.encode()
|
||||
vars = {"tscnText": "world.tscn", "tresText": "brick.tres", "aseText": "hand.ase", "ldtkText": "stamps.ldtk", "ogmoProjectText": "turnBasedRPG.ogmo", "ogmoLevelText": "room-001.json"}
|
||||
check.emit_inputs(ctx, files, vars)
|
||||
Reference in new issue
Block a user