uefn-create-use-remove-one-script
Create, use, read back and remove actors/assets in ONE execute_tool_script (or one Python process), with cleanup guaranteed by the caller.
Files1
View on GitHubSKILL.mduser-level-skills/uefn-create-use-remove-one-script/SKILL.md
GitHubuefn-create-use-remove-one-script
Rule
Create + use + read back + cleanup in ONE ProgrammaticToolset/execute_tool_script, because:
- the guard allows writes only to objects created by the same process;
- errors from internal tools cannot be caught in the script and there is no rollback: a script that aborts leaves what it created, so the CALLER cleans up after a failed script (
AssetTools/delete,SceneTools/remove_from_scene); existsright afterdeletemay return true (materials trap 12): verify withfind_assetsoexistsin.Nameform. Re-read every write:add_rows,set_rows,add_tagreturn null, not true.
Verified recipes
execute_tool_script#create_widget_chain(CreateWidgetBlueprint, AddWidget, ReplaceWidgetWithTemplate, set_properties, get_properties; cleanupAssetTools/deleteof the folder{lab_mount}/...).execute_tool_script#batch_reads(multiple reads in one call).execute_tool_script#verse_edit_build.- Script shape:
def ex(n,a): return execute_tool(n, json.dumps(a))["returnValue"]edef run():that returns a dict.
Paths
Always GUID: {lab_mount} = /<guid>/<project>. values of set_properties is a JSON STRING with camelCase names; delete takes the path without .Name.
Don't
Leaving an actor in the level (a leftover T008_Cube cost a whole task); placing actors that simulate physics; run() returning a non-dict; bypassing a guard refusal; improvising if it fails (exact error, caller cleanup, stop).
To try (not verified)
recipe/apply_material_instance_to_actor (ONE script): unverified.collision_set_and_revert: unverified (reset_propertiesgoes to the class default, not the original: explicitly restore the original values).recipe/animate_owner_actor_with_script_and_restore: unverified.