Materials
Every Materials command in CodeFizz Editor Agent, with parameters and examples.
Every Materials command in CodeFizz Editor Agent, with parameters and examples.
51 commands. Each shows its parameters and an example, and has a copyable deep link, so you (or an AI agent) can jump straight to one.
create_materialCreate a new Material
Creates a new empty Material asset at the specified path. You can set blend_mode, shading_model, and two_sided during creation. Call save_asset after to persist changes to disk.
| Parameter | Type | Required | Description |
|---|---|---|---|
| name | string | Yes | Material name |
| path | string | No | Content path |
| blend_mode | string | No | Blend mode |
| shading_model | string | No | Shading model |
| domain | string | No | Material Domain: surface (default), ui (UMG/Slate), deferred_decal, light_function, volume, post_process, rvt |
| two_sided | bool | No | Two-sided rendering |
| opacity_mask_clip_value | float | No | Opacity mask clip value |
| force | bool | No | Delete and recreate if exists |
cfa create_material --name M_MyMaterial --path /Game/Materials --blend-mode opaque --shading-model default_lit
cfa create_material --name M_Glass --path /Game/Materials --blend-mode translucent --two-sided truecreate_material_instanceCreate a Material Instance
Creates a Material Instance from a parent material, optionally setting scalar, vector, and texture parameter overrides. Returns error if asset already exists (pass force=true to overwrite). Call save_asset after.
| Parameter | Type | Required | Description |
|---|---|---|---|
| parent_path | string | Yes | Parent material path |
| name | string | Yes | Instance name |
| path | string | No | Content path |
| scalar_params | json | No | JSON string of scalar parameters |
| vector_params | json | No | JSON string of vector parameters |
| texture_params | json | No | JSON string of texture parameters |
| force | bool | No | Delete and recreate if exists |
cfa create_material_instance --parent-path /Game/Materials/M_Base --name MI_Red --path /Game/Materials
cfa create_material_instance --parent-path /Game/Materials/M_Base --name MI_Custom --scalar-params '{"Roughness": 0.8}' --vector-params '{"BaseColor": {"R":1,"G":0,"B":0,"A":1}}'build_material_graphBuild complete node graph in one atomic call
Builds an entire material node graph atomically: creates expression nodes and wires them together in a single call. All node types are validated BEFORE the existing graph is touched, so a typo'd type aborts with the graph intact. By default clears existing expressions first (safe rebuild -- external references stay intact). Failed connections report the target node's valid input pin names. Preferred over adding nodes one at a time. Call save_asset after.
| Parameter | Type | Required | Description |
|---|---|---|---|
| material_path | string | Yes | Material asset path |
| nodes | json | Yes | JSON array of node definitions |
| connections | json | Yes | JSON array of connections |
| clear_existing | bool | No | Clear existing expressions |
cfa build_material_graph --material-path /Game/Materials/M_Test --nodes '[{"type":"Constant3Vector","pos_x":-400,"pos_y":0,"properties":{"Constant":"(R=1,G=0,B=0)"}}]' --connections '[{"from_node":0,"to_node":"material","to_pin":"BaseColor"}]'
cfa build_material_graph --material-path /Game/Materials/M_Existing --clear-existing false --nodes '[{"type":"Multiply","pos_x":-200,"pos_y":100}]' --connections '[]'get_material_infoInspect material properties, parameters, textures
Returns material metadata including blend mode, shading model, and optionally parameters, textures, and shader statistics. Use the include flag to control which sections are returned.
| Parameter | Type | Required | Description |
|---|---|---|---|
| material_path | string | Yes | Material asset path |
| include | string | No | Comma-sep: parameters,textures,statistics |
cfa get_material_info --material-path /Game/Materials/M_Test
cfa get_material_info --material-path /Game/Materials/M_Test --include parameters,textures,statisticsset_material_propertiesBulk-set material properties
Sets one or more material-level properties such as blend mode, shading model, or two-sided in a single call. Recompiles the material by default after changes. Call save_asset after.
| Parameter | Type | Required | Description |
|---|---|---|---|
| material_path | string | Yes | Material asset path |
| blend_mode | string | No | Blend mode |
| shading_model | string | No | Shading model |
| two_sided | bool | No | Two-sided |
| opacity_mask_clip_value | float | No | Clip value |
| dithered_lod_transition | bool | No | Dithered LOD transition |
| allow_negative_emissive_color | bool | No | Allow negative emissive |
| translucency_lighting_mode | string | No | Translucency lighting mode (surface, surface_per_pixel, volumetric_directional, volumetric_nondirectional, pervertex_directional, pervertex_nondirectional) |
| refraction_method | string | No | Refraction method (ior, pixel_normal_offset, 2doffset, none) |
| recompile | bool | No | Recompile after changes |
cfa set_material_properties --material-path /Game/Materials/M_Test --blend-mode masked --two-sided true
cfa set_material_properties --material-path /Game/Materials/M_Test --shading-model unlit --recompile falserecompile_materialForce recompile and save
Forces a recompilation of the material shader and saves the asset. Use after making manual changes to the graph or when the material appears out of date.
| Parameter | Type | Required | Description |
|---|---|---|---|
| material_path | string | Yes | Material asset path |
cfa recompile_material --material-path /Game/Materials/M_Testapply_materialApply edits to the asset (clicks the editor's Apply button)
Commits a material's pending edits to the original asset, the exact code path of clicking the Material Editor's Apply button. When the editor is open the edits live on a transient preview copy; this runs the real Apply command so the preview is copied back onto the asset, shaders recompile, and the Apply button disables itself. When the editor is closed it recompiles the asset directly. Apply is expensive, so call it ONCE when the material is complete (after building, validating and recompiling), not after every edit. Returns editor_was_open plus the post-apply compile errors in place: has_errors, error_count, errors[] (each with message, quality_level, platforms) and error_nodes[] when specific nodes can be blamed. If the editor is open and the material has compile errors, the real Apply would pop a blocking Continue/Abort modal, so the commit is skipped (applied=false, blocked_by_compile_errors=true) and the errors are returned instead; fix them and apply again. A clean material or a closed editor commits normally (applied=true). The standalone get_material_errors command returns the same error fields on demand.
| Parameter | Type | Required | Description |
|---|---|---|---|
| material_path | string | Yes | Material asset path |
cfa apply_material --material-path /Game/Materials/M_Testget_material_errorsGet material compilation errors
Returns any compilation errors for the material. By default recompiles first to get fresh errors. Use this to diagnose broken material graphs before fixing them.
| Parameter | Type | Required | Description |
|---|---|---|---|
| material_path | string | Yes | Material asset path |
| recompile | bool | No | Recompile first |
cfa get_material_errors --material-path /Game/Materials/M_Test
cfa get_material_errors --material-path /Game/Materials/M_Test --recompile falseadd_material_commentsAdd comment boxes to material graph
Adds one or more comment boxes to a material graph for visual organization. Each comment has a position, size, text, and optional color. Call save_asset after.
| Parameter | Type | Required | Description |
|---|---|---|---|
| material_path | string | Yes | Material asset path |
| comments | json | Yes | JSON array of comment definitions |
cfa add_material_comments --material-path /Game/Materials/M_Test --comments '[{"text":"Base Color Setup","pos_x":-500,"pos_y":-200,"size_x":400,"size_y":300}]'get_material_graph_nodesRead graph nodes with verbosity control
Returns all expression nodes in a material graph. Use verbosity to control detail: 'summary' for node list, 'connections' for wiring info, 'full' for all properties. Use type_filter to narrow results to specific node types.
| Parameter | Type | Required | Description |
|---|---|---|---|
| material_path | string | Yes | Material asset path |
| type_filter | string | No | Filter by node type |
| verbosity | string | No | summary, connections, or full |
cfa get_material_graph_nodes --material-path /Game/Materials/M_Test
cfa get_material_graph_nodes --material-path /Game/Materials/M_Test --verbosity full --type-filter TextureSampleget_material_expression_infoInspect one material expression node with its available pins
Returns full detail for a single material expression node identified by node_index: its type, properties, and every available input/output pin. Use get_material_graph_nodes first to find the node_index. This is the per-node companion to get_material_graph_nodes.
| Parameter | Type | Required | Description |
|---|---|---|---|
| material_path | string | Yes | Material asset path |
| node_index | int | No | Index of the expression node (from get_material_graph_nodes; or pass node_guid) |
| node_guid | string | No | Stable node GUID, survives add/delete/reorder |
cfa get_material_expression_info --material-path /Game/Materials/M_Test --node-index 3get_material_property_connectionsShow which material outputs (BaseColor, etc.) are connected
Returns the connection status of each top-level material output property (Base Color, Metallic, Roughness, Emissive, Normal, and more), reporting which expression node feeds each one. Use this to see how a material graph wires into the final material outputs.
| Parameter | Type | Required | Description |
|---|---|---|---|
| material_path | string | Yes | Material asset path |
cfa get_material_property_connections --material-path /Game/Materials/M_Testadd_material_expressionAdd a material expression node
Adds a single expression node to a material graph. The node definition is a JSON object with type, position, and optional properties. Use build_material_graph instead when creating multiple nodes at once. Call save_asset after.
| Parameter | Type | Required | Description |
|---|---|---|---|
| material_path | string | Yes | Material asset path |
| node | json | Yes | JSON node definition |
cfa add_material_expression --material-path /Game/Materials/M_Test --node '{"type":"Constant3Vector","pos_x":-400,"pos_y":0,"properties":{"Constant":"(R=0.5,G=0.5,B=1.0)"}}'
cfa add_material_expression --material-path /Game/Materials/M_Test --node '{"type":"TextureSample","pos_x":-600,"pos_y":0}'connect_material_expressionsConnect two material expression nodes
Wires an output pin of one node to an input pin of another node or the material output. Use to_node 'material' to connect to material-level pins (BaseColor, Normal, etc.). Call save_asset after.
| Parameter | Type | Required | Description |
|---|---|---|---|
| material_path | string | Yes | Material asset path |
| from_node | int | No | Source node index (or pass from_node_guid) |
| from_node_guid | string | No | Stable source node GUID |
| to_node | string | No | Target node index, 'material', or pass to_node_guid |
| to_node_guid | string | No | Stable target node GUID |
| to_pin | string | Yes | Target pin name |
| from_pin | string | No | Source pin name |
cfa connect_material_expressions --material-path /Game/Materials/M_Test --from-node 0 --to-node material --to-pin BaseColor
cfa connect_material_expressions --material-path /Game/Materials/M_Test --from-node 0 --from-pin RGB --to-node 1 --to-pin Adelete_material_expressionDelete a material expression by index
Removes a single expression node from the material graph by its index. Note that deleting a node shifts indices of subsequent nodes. Call save_asset after.
| Parameter | Type | Required | Description |
|---|---|---|---|
| material_path | string | Yes | Material asset path |
| node_index | int | No | Node index (or pass node_guid) |
| node_guid | string | No | Stable node GUID (from get_material_graph_nodes), survives add/delete/reorder |
cfa delete_material_expression --material-path /Game/Materials/M_Test --node-index 3set_material_expression_propertySet a property on a material expression
Sets a single property on a material expression node identified by index. Use get_expression_type_info to discover available properties for a node type. Call save_asset after.
| Parameter | Type | Required | Description |
|---|---|---|---|
| material_path | string | Yes | Material asset path |
| node_index | int | No | Node index (or pass node_guid) |
| node_guid | string | No | Stable node GUID (from get_material_graph_nodes), survives add/delete/reorder |
| property_name | string | Yes | Property name |
| property_value | string | Yes | Property value |
cfa set_material_expression_property --material-path /Game/Materials/M_Test --node-index 0 --property-name Constant --property-value "(R=1,G=0,B=0)"
cfa set_material_expression_property --material-path /Game/Materials/M_Test --node-index 2 --property-name R --property-value 0.5move_material_expressionMove a material expression node
Repositions a material expression node in the graph editor to the specified X/Y coordinates. Use this to organize graph layout. Call save_asset after.
| Parameter | Type | Required | Description |
|---|---|---|---|
| material_path | string | Yes | Material asset path |
| node_index | int | No | Node index (or pass node_guid) |
| node_guid | string | No | Stable node GUID (from get_material_graph_nodes), survives add/delete/reorder |
| pos_x | int | Yes | X position |
| pos_y | int | Yes | Y position |
cfa move_material_expression --material-path /Game/Materials/M_Test --node-index 0 --pos-x -400 --pos-y 200duplicate_material_expressionDuplicate a material expression
Creates a copy of an existing material expression node at an offset position. The new node has the same type and properties but no connections. Call save_asset after.
| Parameter | Type | Required | Description |
|---|---|---|---|
| material_path | string | Yes | Material asset path |
| node_index | int | No | Node index to duplicate (or pass node_guid) |
| node_guid | string | No | Stable node GUID, survives add/delete/reorder |
| offset_x | int | No | X offset |
| offset_y | int | No | Y offset |
cfa duplicate_material_expression --material-path /Game/Materials/M_Test --node-index 0
cfa duplicate_material_expression --material-path /Game/Materials/M_Test --node-index 0 --offset-x 200 --offset-y 200layout_material_graphAuto-layout the material graph (data-flow, right-to-left)
Repositions every expression node into clean right-to-left data-flow columns: nodes are measured from their real Slate widgets, layered by longest path to the output sink, pin-aligned to the consumers they feed, and stacked to avoid overlap. The root output node, comments and reroutes keep their positions. Works with the material editor open or closed. Call save_asset after (or apply_material when the editor is open).
| Parameter | Type | Required | Description |
|---|---|---|---|
| material_path | string | Yes | Material asset path |
cfa layout_material_graph --material-path /Game/Materials/M_Testlayout_material_expressionsAuto-layout all material expressions (alias of layout_material_graph)
Alias of layout_material_graph: repositions all expression nodes into clean right-to-left data-flow columns (Slate-measured sizes, pin alignment, collision-free). Call save_asset after.
| Parameter | Type | Required | Description |
|---|---|---|---|
| material_path | string | Yes | Material asset path |
cfa layout_material_expressions --material-path /Game/Materials/M_Testlayout_material_function_graphAuto-layout a Material Function graph (data-flow, right-to-left)
Same right-to-left data-flow auto-layout as layout_material_graph, but for a Material Function (or layer/blend function) graph: nodes are Slate-measured, layered by longest path to the FunctionOutput sinks, pin-aligned and collision-free. Works open or closed. Call save_asset after.
| Parameter | Type | Required | Description |
|---|---|---|---|
| function_path | string | Yes | Material function asset path |
cfa layout_material_function_graph --function-path /Game/Materials/Functions/MF_Testget_material_instance_parametersGet all parameters of a material instance
Returns all scalar, vector, and texture parameters of a material instance, including both overridden values and inherited defaults from the parent material.
| Parameter | Type | Required | Description |
|---|---|---|---|
| material_path | string | Yes | Material instance path |
cfa get_material_instance_parameters --material-path /Game/Materials/MI_Redset_material_instance_parameterSet a parameter on a material instance
Sets a single parameter override on a material instance. param_type: scalar, vector, texture, static_switch, component_mask, rvt (runtime virtual texture), or sparse_volume_texture. For component_mask, value is a channel mask: [r,g,b,a] bool array, "1,1,0,0", or letters like "rgb". For rvt/sparse_volume_texture, value is the texture asset path. Call save_asset after.
| Parameter | Type | Required | Description |
|---|---|---|---|
| material_path | string | Yes | Material instance path |
| param_name | string | Yes | Parameter name |
| param_type | string | Yes | scalar|vector|texture|static_switch|component_mask|rvt|sparse_volume_texture |
| value | string | Yes | Parameter value |
cfa set_material_instance_parameter --material-path /Game/Materials/MI_Red --param-name Roughness --param-type scalar --value 0.8
cfa set_material_instance_parameter --material-path /Game/Materials/MI_Red --param-name BaseColor --param-type vector --value "(R=1,G=0,B=0,A=1)"
cfa set_material_instance_parameter --material-path /Game/Materials/MI_Red --param-name MaskRGB --param-type component_mask --value rgb
cfa set_material_instance_parameter --material-path /Game/Materials/MI_Red --param-name RVT --param-type rvt --value /Game/VT/RVT_Heightset_material_instance_parentReparent a material instance
Changes the parent Material (or Material Instance) of a Material Instance Constant. Overrides for parameters that do not exist on the new parent are dropped by the engine. Rejects self-parenting and cycles. Call save_asset after.
| Parameter | Type | Required | Description |
|---|---|---|---|
| material_path | string | Yes | Material instance path |
| parent_path | string | Yes | New parent material/instance path |
cfa set_material_instance_parent --material-path /Game/Materials/MI_Red --parent-path /Game/Materials/M_NewBaseclear_material_instance_parameterClear a parameter override (revert to parent)
Removes a dynamic parameter override (scalar, vector, texture, rvt, sparse volume texture, font) from a Material Instance Constant so it reverts to the parent's value. Returns overrides_removed. Static switch / component-mask overrides are not reverted by this command. Call save_asset after.
| Parameter | Type | Required | Description |
|---|---|---|---|
| material_path | string | Yes | Material instance path |
| param_name | string | Yes | Parameter name to revert |
cfa clear_material_instance_parameter --material-path /Game/Materials/MI_Red --param-name Roughnesslist_material_expression_typesList available material expression types
Lists all available material expression node types that can be used in material graphs. Use filter to narrow results by name. Returns type names and optionally details about each type.
| Parameter | Type | Required | Description |
|---|---|---|---|
| filter | string | No | Filter by type name |
| max_results | int | No | Max results (0 = all) |
| include_details | bool | No | Include type details |
cfa list_material_expression_types --filter Texture --max-results 20
cfa list_material_expression_types --include-details falseget_expression_type_infoLook up pins & properties for a node type
Returns the input/output pins and configurable properties for a material expression type without creating a node. For Custom HLSL nodes, returns the custom_hlsl_schema with code/inputs/outputs documentation. For MaterialFunctionCall, pass function_path to see the function's actual pins.
| Parameter | Type | Required | Description |
|---|---|---|---|
| type_name | string | Yes | Expression type (e.g. Multiply, Custom, SubstrateSlabBSDF) |
| function_path | string | No | For MaterialFunctionCall: path to function asset to inspect |
cfa get_expression_type_info --type-name Multiply
cfa get_expression_type_info --type-name Custom
cfa get_expression_type_info --type-name MaterialFunctionCall --function-path /Engine/Functions/Engine_MaterialFunctions03/Blends/Blend_Overlay
cfa get_expression_type_info --type-name SubstrateSlabBSDFget_available_material_pinsQuery available material output pins
Returns all available material output pins for a specific material, based on its current settings (blend mode, shading model, Substrate). Reports each pin's name, expected type, connection status, and Substrate state. Use this to discover valid to_pin values for connect_material_expressions with to_node=material.
| Parameter | Type | Required | Description |
|---|---|---|---|
| material_path | string | Yes | Material asset path |
cfa get_available_material_pins --material-path /Game/Materials/M_Testdisconnect_material_expressionDisconnect a specific input pin
Breaks the connection to a specific input pin on a material expression node. The node and its other connections remain intact. Call save_asset after.
| Parameter | Type | Required | Description |
|---|---|---|---|
| material_path | string | Yes | Material asset path |
| node_index | int | No | Node index (or pass node_guid) |
| node_guid | string | No | Stable node GUID (from get_material_graph_nodes), survives add/delete/reorder |
| input_pin | string | Yes | Input pin name |
cfa disconnect_material_expression --material-path /Game/Materials/M_Test --node-index 2 --input-pin Asearch_material_functionsFind Material Functions by name
Searches for Material Function assets by name. Use include_engine to also search engine-provided functions. Returns asset paths that can be used as MaterialFunctionCall nodes in material graphs.
| Parameter | Type | Required | Description |
|---|---|---|---|
| filter | string | No | Name filter |
| path | string | No | Search path |
| max_results | int | No | Max results |
| include_engine | bool | No | Include engine functions |
cfa search_material_functions --filter Fresnel
cfa search_material_functions --filter Blend --include-engine true --max-results 10validate_material_graphDiagnose orphaned, dead-end, and unconnected nodes
Analyzes a material graph and reports orphaned nodes (no connections), dead-end nodes (output not connected to anything), and other structural issues. Use before cleanup_material_graph to preview problems.
| Parameter | Type | Required | Description |
|---|---|---|---|
| material_path | string | Yes | Material asset path |
cfa validate_material_graph --material-path /Game/Materials/M_Testtrace_material_connectionTrace upstream/downstream from a node
Recursively traces connections from a node upstream (toward inputs), downstream (toward material output), or both. Use max_depth to control how far to trace. Helpful for understanding data flow in complex graphs.
| Parameter | Type | Required | Description |
|---|---|---|---|
| material_path | string | Yes | Material asset path |
| node_index | int | No | Node index (or pass node_guid) |
| node_guid | string | No | Stable node GUID (from get_material_graph_nodes), survives add/delete/reorder |
| direction | string | No | upstream, downstream, or both |
| max_depth | int | No | Max trace depth |
cfa trace_material_connection --material-path /Game/Materials/M_Test --node-index 3 --direction upstream --max-depth 5
cfa trace_material_connection --material-path /Game/Materials/M_Test --node-index 0 --direction bothcleanup_material_graphDelete orphaned/dead-end nodes
Removes orphaned or dead-end nodes from a material graph. Use dry_run to preview what would be deleted without making changes. Mode controls which nodes to target: orphaned (no connections), dead_ends (output unused), or all. Call save_asset after.
| Parameter | Type | Required | Description |
|---|---|---|---|
| material_path | string | Yes | Material asset path |
| mode | string | No | orphaned, dead_ends, or all |
| dry_run | bool | No | Preview without deleting |
cfa cleanup_material_graph --material-path /Game/Materials/M_Test --dry-run true
cfa cleanup_material_graph --material-path /Game/Materials/M_Test --mode allcreate_material_functionCreate a new Material Function asset
Creates a new Material Function asset that can be reused across multiple materials via MaterialFunctionCall nodes. The function is created with one default output node (reported as default_output {node_index,node_guid,name}) so it is always compilable and deterministic, the same node the Unreal editor would inject on first open. Set expose_to_library to make it appear in the material editor function list. Call save_asset after.
| Parameter | Type | Required | Description |
|---|---|---|---|
| name | string | Yes | Function name |
| path | string | No | Content path |
| description | string | No | Description |
| expose_to_library | bool | No | Expose to material library |
| function_type | string | No | function | layer | blend (Material Attribute Layer/Blend functions) |
| force | bool | No | Delete and recreate if exists |
cfa create_material_function --name MF_CustomBlend --path /Game/Materials/Functions --description "Custom blend utility"
cfa create_material_function --name MF_Helper --expose-to-library falsecreate_material_function_instanceCreate a Material Function Instance
Creates a UMaterialFunctionInstance asset from a parent Material Function, letting you reuse a function with overridden parameters. Set overrides with set_material_function_instance_parameter. Returns error if it exists (pass force=true to reuse). Call save_asset after.
| Parameter | Type | Required | Description |
|---|---|---|---|
| name | string | Yes | Instance asset name |
| parent_path | string | Yes | Parent material function path |
| path | string | No | Content path |
| force | bool | No | Reuse if exists |
cfa create_material_function_instance --name MFI_RedTint --parent-path /Game/Materials/Functions/MF_Tint --path /Game/Materials/Functionsset_material_function_instance_parameterOverride a parameter on a Material Function Instance
Sets a scalar, vector, or static_switch override on a Material Function Instance. The override is keyed to the parent parameter's ExpressionGUID so it actually applies at compile; a name the parent function does not expose is rejected. Call save_asset after.
| Parameter | Type | Required | Description |
|---|---|---|---|
| instance_path | string | Yes | Function instance path |
| param_name | string | Yes | Parameter name |
| param_type | string | Yes | scalar | vector | static_switch |
| value | string | Yes | Override value |
cfa set_material_function_instance_parameter --instance-path /Game/Materials/Functions/MFI_RedTint --param-name TintColor --param-type vector --value "(R=1,G=0,B=0,A=1)"
cfa set_material_function_instance_parameter --instance-path /Game/Materials/Functions/MFI_RedTint --param-name Strength --param-type scalar --value 0.7get_material_function_instance_parametersRead overrides on a Material Function Instance
Returns the parent/base function and the scalar, vector, and static_switch parameter overrides currently set on a Material Function Instance.
| Parameter | Type | Required | Description |
|---|---|---|---|
| instance_path | string | Yes | Function instance path |
cfa get_material_function_instance_parameters --instance-path /Game/Materials/Functions/MFI_RedTintset_material_layersSet the material attribute layer stack (base or instance)
Sets a Material Attribute Layers stack. On a base Material it makes the material layered (enables bUseMaterialAttributes, adds a MaterialAttributeLayers node wired to the attributes output) and stores the stack as the node default. On a Material Instance it overrides the inherited stack. layers[] are Material Layer function paths (layers[0] is the background); blends[] are Material Layer Blend function paths, one fewer than layers (blends[i] mixes layers[i+1]). For the material to compile, the functions must have usage MaterialLayer / MaterialLayerBlend (create them with create_material_function function_type=layer|blend). An empty string or "none" leaves a slot empty. Call save_asset after.
| Parameter | Type | Required | Description |
|---|---|---|---|
| material_path | string | Yes | Base material or material instance path |
| layers | json | Yes | JSON array of layer function paths (layers[0]=background; ""/"none" = empty slot) |
| blends | json | No | JSON array of blend function paths (one fewer than layers) |
cfa set_material_layers --material-path /Game/Materials/M_Layered --layers '["/Game/ML/ML_Rock","/Game/ML/ML_Moss"]' --blends '["/Game/ML/MatLayerBlend_Height"]'get_material_layersRead the material attribute layer stack
Returns the layer stack of a base Material (the MaterialAttributeLayers node default) or a Material Instance (the effective/overridden stack): each entry's layer function, blend function, enabled flag, and name.
| Parameter | Type | Required | Description |
|---|---|---|---|
| material_path | string | Yes | Base material or material instance path |
cfa get_material_layers --material-path /Game/Materials/MI_Layeredget_material_function_infoInspect a Material Function
Returns the inputs, outputs, and (per verbosity) internal expression nodes of a Material Function. verbosity=interface returns only the pin interface, usually all you need before calling the function from a material graph; summary adds node counts by type; full (default) adds the other_nodes list, optionally narrowed with type_filter.
| Parameter | Type | Required | Description |
|---|---|---|---|
| function_path | string | Yes | Function asset path |
| verbosity | string | No | interface | summary | full |
| type_filter | string | No | Substring filter on other_nodes type names (full only) |
cfa get_material_function_info --function-path /Game/Materials/Functions/MF_CustomBlend --verbosity interface
cfa get_material_function_info --function-path /Game/MF/MF_Noise --verbosity full --type-filter Texturebuild_material_function_graphBuild complete MF node graph in one call
Builds an entire Material Function node graph, similar to build_material_graph but for functions. All node types are validated BEFORE the existing graph is touched, so a typo can never destroy the function. With the MF editor closed (the normal case) the build runs synchronously and returns nodes_created / connections_made / errors; with the editor open it defers across ~5 engine ticks (deferred=true, errors logged) to avoid crashing on stale preview state. Connections resolve to_node/from_node as node indices OR the aliases "output" / "output:Name" (a FunctionOutput) and "input:Name" (a FunctionInput). If the nodes array contains no FunctionOutput, a default output is auto-created and reported as auto_created_output, wire it with to_node="output". Clears existing expressions by default.
| Parameter | Type | Required | Description |
|---|---|---|---|
| function_path | string | Yes | Function asset path |
| nodes | json | Yes | JSON array of node definitions |
| connections | json | Yes | JSON array of connections |
| clear_existing | bool | No | Clear existing expressions |
cfa build_material_function_graph --function-path /Game/MF/MF_Fade --nodes '[{"type":"FunctionInput","input_name":"Alpha","input_type":"Scalar"},{"type":"OneMinus"}]' --connections '[{"from_node":0,"to_node":1},{"from_node":1,"to_node":"output"}]'add_material_function_inputAdd a FunctionInput pin
Adds an input pin to a Material Function. The input type can be Scalar, Vector2, Vector3, Vector4, Texture2D, TextureCube, StaticBool, Bool, or MaterialAttributes. Set sort_priority to control pin ordering. Call save_asset after.
| Parameter | Type | Required | Description |
|---|---|---|---|
| function_path | string | Yes | Function asset path |
| input_name | string | Yes | Input name |
| input_type | string | No | Input type |
| description | string | No | Description |
| sort_priority | int | No | Sort priority |
| use_preview_as_default | bool | No | Use preview as default |
| preview_value | string | No | Preview value |
| pos_x | int | No | X position |
| pos_y | int | No | Y position |
cfa add_material_function_input --function-path /Game/Materials/Functions/MF_Blend --input-name BaseColor --input-type Vector3
cfa add_material_function_input --function-path /Game/Materials/Functions/MF_Blend --input-name Strength --input-type Scalar --preview-value 1.0 --use-preview-as-default trueadd_material_function_outputAdd a FunctionOutput pin
Adds an output pin to a Material Function. The output receives its type from whatever expression is connected to it. Set sort_priority to control pin ordering when the function has multiple outputs. Call save_asset after.
| Parameter | Type | Required | Description |
|---|---|---|---|
| function_path | string | Yes | Function asset path |
| output_name | string | Yes | Output name |
| description | string | No | Description |
| sort_priority | int | No | Sort priority |
| pos_x | int | No | X position |
| pos_y | int | No | Y position |
cfa add_material_function_output --function-path /Game/Materials/Functions/MF_Blend --output-name Result
cfa add_material_function_output --function-path /Game/Materials/Functions/MF_Blend --output-name Alpha --sort-priority 1 --pos-y 200set_material_function_inputModify an existing FunctionInput
Modifies properties of an existing FunctionInput node in a Material Function, identified by node_index. You can change the name, type, description, preview value, and sort priority. Call save_asset after.
| Parameter | Type | Required | Description |
|---|---|---|---|
| function_path | string | Yes | Function asset path |
| node_index | int | No | Node index (or pass node_guid) |
| node_guid | string | No | Stable node GUID (from get_material_graph_nodes), survives add/delete/reorder |
| input_name | string | No | Input name |
| input_type | string | No | Input type |
| description | string | No | Description |
| sort_priority | int | No | Sort priority |
| use_preview_as_default | bool | No | Use preview as default |
| preview_value | string | No | Preview value |
cfa set_material_function_input --function-path /Game/Materials/Functions/MF_Blend --node-index 0 --input-name Opacity --input-type Scalar
cfa set_material_function_input --function-path /Game/Materials/Functions/MF_Blend --node-index 1 --preview-value 0.5 --use-preview-as-default trueset_material_function_outputModify an existing FunctionOutput
Modifies properties of an existing FunctionOutput node in a Material Function, identified by node_index. You can change the name, description, and sort priority. Call save_asset after.
| Parameter | Type | Required | Description |
|---|---|---|---|
| function_path | string | Yes | Function asset path |
| node_index | int | No | Node index (or pass node_guid) |
| node_guid | string | No | Stable node GUID (from get_material_graph_nodes), survives add/delete/reorder |
| output_name | string | No | Output name |
| description | string | No | Description |
| sort_priority | int | No | Sort priority |
cfa set_material_function_output --function-path /Game/Materials/Functions/MF_Blend --node-index 2 --output-name BlendedColor
cfa set_material_function_output --function-path /Game/Materials/Functions/MF_Blend --node-index 2 --description "Final blended output" --sort-priority 0validate_material_functionValidate a Material Function
Checks a Material Function for structural issues such as missing inputs/outputs, orphaned nodes, and broken connections. Use this to verify a function is well-formed before using it in materials.
| Parameter | Type | Required | Description |
|---|---|---|---|
| function_path | string | Yes | Function asset path |
cfa validate_material_function --function-path /Game/Materials/Functions/MF_Blendcleanup_material_functionCleanup orphaned nodes in a Material Function
Removes orphaned nodes from a Material Function graph. Use dry_run to preview which nodes would be deleted without making changes. Call save_asset after.
| Parameter | Type | Required | Description |
|---|---|---|---|
| function_path | string | Yes | Function asset path |
| dry_run | bool | No | Preview without deleting |
cfa cleanup_material_function --function-path /Game/Materials/Functions/MF_Blend --dry-run true
cfa cleanup_material_function --function-path /Game/Materials/Functions/MF_Blendcreate_material_parameter_collectionCreate a Material Parameter Collection
Creates a new UMaterialParameterCollection asset, a global table of scalar/vector parameters that any material can reference via a CollectionParameter node. Returns error if it exists (pass force=true to clear and reuse). Add entries with set_material_parameter_collection_parameter. Call save_asset after.
| Parameter | Type | Required | Description |
|---|---|---|---|
| name | string | Yes | Collection asset name |
| path | string | No | Content path |
| force | bool | No | Clear entries and reuse if exists |
cfa create_material_parameter_collection --name MPC_Global --path /Game/Materialsset_material_parameter_collection_parameterAdd or update an MPC scalar/vector entry
Adds a new parameter to a Material Parameter Collection, or updates its default value if it already exists. param_type is scalar or vector. New entries get a unique Id automatically. Returns created=true when a new entry was added. Call save_asset after.
| Parameter | Type | Required | Description |
|---|---|---|---|
| collection_path | string | Yes | MPC asset path |
| param_name | string | Yes | Parameter name |
| param_type | string | Yes | scalar | vector |
| value | string | Yes | Default value (number, or [r,g,b,a]/(R=..) for vector) |
cfa set_material_parameter_collection_parameter --collection-path /Game/Materials/MPC_Global --param-name TimeScale --param-type scalar --value 1.5
cfa set_material_parameter_collection_parameter --collection-path /Game/Materials/MPC_Global --param-name WindColor --param-type vector --value "(R=0.2,G=0.4,B=1,A=1)"get_material_parameter_collectionList all entries of a Material Parameter Collection
Returns all scalar and vector parameters in a Material Parameter Collection, each with its name, default value, and stable Id.
| Parameter | Type | Required | Description |
|---|---|---|---|
| collection_path | string | Yes | MPC asset path |
cfa get_material_parameter_collection --collection-path /Game/Materials/MPC_Globaldelete_material_parameter_collection_parameterRemove an entry from a Material Parameter Collection
Removes a scalar or vector parameter from a Material Parameter Collection by name. Returns removed count. Call save_asset after.
| Parameter | Type | Required | Description |
|---|---|---|---|
| collection_path | string | Yes | MPC asset path |
| param_name | string | Yes | Parameter name to remove |
cfa delete_material_parameter_collection_parameter --collection-path /Game/Materials/MPC_Global --param-name TimeScale