Advance N-023 through N-026 audited parity

This commit is contained in:
mes123456
2026-08-12 15:23:35 -04:00
parent b3cefaeec5
commit 86136139e2
30 changed files with 5573 additions and 66 deletions

View File

@@ -0,0 +1,32 @@
import pathlib
import sys
import bpy
SOURCES = {
"InternalSafe.py": "value = 7\nprint(value)\n",
"ModuleAutorun.py": "def register():\n return 'blocked'\n",
"ExternalProject.py": "message = 'project relative'\n",
}
def main(output_path):
bpy.ops.wm.read_factory_settings(use_empty=True)
for name, source in SOURCES.items():
text = bpy.data.texts.new(name)
text.write(source)
bpy.data.texts["ModuleAutorun.py"].use_module = True
bpy.data.texts["ExternalProject.py"].filepath = "//scripts/external_project.py"
path = pathlib.Path(output_path).resolve()
path.parent.mkdir(parents=True, exist_ok=True)
bpy.ops.wm.save_as_mainfile(filepath=str(path), compress=False)
print(f"script-fixture-generated path={path} sources={len(SOURCES)}")
if __name__ == "__main__":
arguments = sys.argv[sys.argv.index("--") + 1:]
if len(arguments) != 1:
raise SystemExit("usage: blender -b --python generate-script-fixture.py -- output.blend")
main(arguments[0])