Generate and re-run a file-backed farm material kit in a UE6 Linux commandlet
Section titled “Generate and re-run a file-backed farm material kit in a UE6 Linux commandlet”- Status: current
- Engine: ue6-main
61e2877e10, Linux x86_64, Epic Clang 23.1.5 (v27 SDK) - Context: Standalone UE6 with the PythonScript plugin, Interchange, and the Material Editor library
- Prerequisites: Prepared UE6 editor, source JPGs with hashes and dimensions, the project layout, Vulkan SM6 offscreen rendering
Symptom
Section titled “Symptom”Source dimensions can appear unexpected immediately after changing a texture’s compression setting. Rebuilding an existing material by calling DeleteAllMaterialExpressions in the warm kit also produced Assertion failed: !IsRooted() from MarkAsGarbage.
Smallest example / reproduction
Section titled “Smallest example / reproduction”Run the Python kit commandlet from the project. For the texture check, import a grayscale JPEG, change its compression to TC_MASKS, then immediately call blueprint_get_size_x and blueprint_get_size_y. For the warm graph crash, load the previously generated M_FarmFlat in the same editor setup and call delete_all_material_expressions.
Solution
Section titled “Solution”Check dimensions against the source manifest after import and before changing compression or sRGB. Save the texture after those edits. For masters whose shader graphs are fixed, create the expression graph only on the first build. On warm loads query get_num_material_expressions and reuse the graph. Reapply the texture and scalar overrides on its instances and save them. When authoring a graph topology change, move the ignored generated kit out of the content tree before rerunning the asset build.
Why it works
Section titled “Why it works”Changing texture build settings schedules new platform data. Checking the imported dimensions first avoids reading during that rebuild. The loaded starter material can contain rooted expressions, and the graph deletion API marks them as garbage. Reusing the complete master avoids that operation while keeping per-surface overrides data-driven.
Verified
Section titled “Verified”- Evidence level: runs in editor
- How: The Vulkan commandlet reported
FARM_SURFACE_MASTER asset=/Game/CoopZero/Placeholder/M_FarmSurface.M_FarmSurface sets=9 instances=21. The next commandlet reopenedSLICE_MAP actors=65 map=/Game/Maps/Slice unmanaged=0and logged both Styloo textures for all four birds. - Date / by: 2026-11-25, Coop Zero Step 14
Limits and assumptions
Section titled “Limits and assumptions”This recipe generates a fixed master and rebuilds textures and instance parameters. It covers the standalone Linux editor and the tested project texture settings. Scripted topology migration of a loaded master remains untested.