Blender createObject: pin whitespace meshType refusal, document meshType and null objectType

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
Libby 2026-11-10 23:13:57 +00:00
commit 01d25c6bf9
2 changed files with 4 additions and 3 deletions

View file

@ -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.

View file

@ -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"])