From 01d25c6bf98dc5683d64ea9beea50d31eee5762f Mon Sep 17 00:00:00 2001 From: Libby Date: Tue, 10 Nov 2026 23:13:57 +0000 Subject: [PATCH] Blender createObject: pin whitespace meshType refusal, document meshType and null objectType Co-Authored-By: Claude Sonnet 5.5 --- surfaces/blender/docs/install.md | 5 +++-- surfaces/blender/tests/test_scene_actions.py | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/surfaces/blender/docs/install.md b/surfaces/blender/docs/install.md index 06ab1c9..f27093b 100644 --- a/surfaces/blender/docs/install.md +++ b/surfaces/blender/docs/install.md @@ -120,7 +120,8 @@ gets a `failed` receipt whose message names the rule): - `createObject`: optional `objectType` (`MESH`, `LIGHT`, `CAMERA`, `EMPTY`; default `EMPTY`), `name`, `location`. Any other `objectType` (for example `TEXT` or `CURVE`) is refused with the allowed set named. A `MESH` is a cube (`size`); a `meshType` other than `CUBE` - (case-insensitive) is refused rather than ignored. + (case-insensitive, no surrounding whitespace) is refused rather than ignored. + `meshType` is checked only when `objectType` is `MESH`; an explicit `objectType: null` is refused. - `importGltf`: `filepath`, `.gltf` or `.glb`, relative to the add-on preference `Import Directory` (absolute paths, `..` and symlinks that resolve outside it are refused). Empty `Import Directory` disables the action. Needs Blender's glTF add-on. @@ -159,7 +160,7 @@ gets a `failed` receipt whose message names the rule): camera, file path and format are restored after the render. The render blocks Blender's UI until it finishes. In a background (`-b`) Blender on Linux, the GL engines `BLENDER_WORKBENCH`, `BLENDER_EEVEE` and `BLENDER_EEVEE_NEXT` are refused - with a `failed` receipt when `libEGL.so.1` cannot be loaded (probed once), because + with a `failed` receipt when `libEGL.so.1` cannot be loaded (probed once and cached for the life of the process), because rendering would abort the whole process with no receipt; `CYCLES` renders on the CPU. The check applies to the scene's engine when `engine` is omitted. No such check runs on Windows or macOS. diff --git a/surfaces/blender/tests/test_scene_actions.py b/surfaces/blender/tests/test_scene_actions.py index 1235776..bb3a292 100644 --- a/surfaces/blender/tests/test_scene_actions.py +++ b/surfaces/blender/tests/test_scene_actions.py @@ -397,7 +397,7 @@ class ActionTests(unittest.TestCase): self.assertEqual(self.bpy.created, []) def test_create_object_refuses_a_mesh_type_other_than_cube(self): - for mesh_type in ("CYLINDER", "", 1): + for mesh_type in ("CYLINDER", "", 1, " CUBE", "CUBE "): receipt = self.run_action(action="createObject", objectType="MESH", meshType=mesh_type) self.assertEqual(receipt["status"], "failed", mesh_type) self.assertIn("CUBE", receipt["message"])