Add brush authoring schema
CI / Format, lint, test, build (push) Waiting to run

This commit is contained in:
Rbanh committed 2026-06-06 05:42:19 -04:00
1 parent cc6acb188d
commit 9f95ba3082
24 files changed
+891 -78

No files matched your search

+27
View File
@@ -92,6 +92,9 @@ fn infer_kind_from_block(block: &str) -> &'static str {
if block.contains("\"shared::components::ModelRef\"") {
return actor_kind_ron(ActorKind::ImportedModel);
}
if block.contains("\"shared::components::BrushDesc\"") {
return actor_kind_ron(ActorKind::Brush);
}
if block.contains("\"shared::components::Primitive\"")
|| block.contains("\"shared::components::StaticMeshRenderer\"")
{
@@ -108,6 +111,7 @@ fn infer_kind_from_block(block: &str) -> &'static str {
fn actor_kind_ron(kind: ActorKind) -> &'static str {
match kind {
ActorKind::Empty => "Empty",
ActorKind::Brush => "Brush",
ActorKind::StaticMesh => "StaticMesh",
ActorKind::ImportedModel => "ImportedModel",
ActorKind::Light => "Light",
@@ -208,6 +212,29 @@ mod tests {
assert!(migrated.contains("StaticMesh"));
}
#[test]
fn backfills_actor_kind_for_brush_entity() {
let body = r#"(
resources: {},
entities: {
1: (
components: {
"shared::components::LevelObject": (),
"shared::components::BrushDesc": (
kind: Additive,
faces: [],
cast_shadows: true,
receive_shadows: true,
),
},
),
},
)"#;
let migrated = migrate_v1_to_v2(body);
assert!(migrated.contains("ActorKind"));
assert!(migrated.contains("Brush"));
}
#[test]
fn fixes_low_directional_lux() {
let body = r#"(