CodeFizz
ToolsDemoDocsRoadmapChangelogPricingFAQ
Get the plugin

Getting Started

  • Introduction
  • Quick Start
  • Requirements
  • Installing the CLI
  • License & Machines

Guides

  • Installing the Plugin
  • The AI Skill
  • CLI vs MCP
  • Multiple Editors
  • How It Works
  • Discovering Commands

Walkthroughs

  • Build a Blueprint with AI
  • Author a Material Graph
  • Create a Niagara System

Reference

  • Reference
  • Niagara
  • PCG
  • Materials
  • StateTree
  • Sequencer
  • Level Actors
  • Project Settings
  • Blueprints
  • Blueprint Structs
  • Enhanced Input
  • Asset Management
  • Bulk Asset Ops
  • Data Assets
  • Object Properties
  • UMG Widgets
  • Data Tables
  • Curves
  • Console Commands
  • Profiling
  • Core
  • Debug

Help

  • FAQ
  • Troubleshooting
  • For AI Agents
DocsReferenceMaterials

Materials

Every Materials command in CodeFizz Editor Agent, with parameters and examples.

Loading…
PreviousPCGNextStateTree
CodeFizz

A drop-in Unreal Engine 5 plugin that exposes the entire editor surface (Blueprints, Materials, Niagara, PCG, StateTree, Insights profiling, and more) over the Model Context Protocol. Connect Claude Code, Cursor, VS Code, or any MCP-compatible client and let your AI build inside the engine.

Product

  • Features
  • Docs
  • Tools
  • Demo
  • Roadmap
  • Changelog
  • Pricing
  • FAQ

Resources

  • Install guide
  • Discord
  • YouTube
  • Open-source edition
  • Manage subscription

Legal

  • Refund Policy
  • Privacy Policy
  • Terms of Service

© 2026 CodeFizz. All rights reserved.

CodeFizz Editor Agent is a CodeFizz product. Payments processed by Polar Software, Inc. (Polar), the Merchant of Record.

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_material

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

ParameterTypeRequiredDescription
namestringYesMaterial name
pathstringNoContent path
blend_modestringNoBlend mode
shading_modelstringNoShading model
domainstringNoMaterial Domain: surface (default), ui (UMG/Slate), deferred_decal, light_function, volume, post_process, rvt
two_sidedboolNoTwo-sided rendering
opacity_mask_clip_valuefloatNoOpacity mask clip value
forceboolNoDelete and recreate if exists
example
  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 true
create_material_instance

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

ParameterTypeRequiredDescription
parent_pathstringYesParent material path
namestringYesInstance name
pathstringNoContent path
scalar_paramsjsonNoJSON string of scalar parameters
vector_paramsjsonNoJSON string of vector parameters
texture_paramsjsonNoJSON string of texture parameters
forceboolNoDelete and recreate if exists
example
  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_graph

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

ParameterTypeRequiredDescription
material_pathstringYesMaterial asset path
nodesjsonYesJSON array of node definitions
connectionsjsonYesJSON array of connections
clear_existingboolNoClear existing expressions
example
  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_info

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

ParameterTypeRequiredDescription
material_pathstringYesMaterial asset path
includestringNoComma-sep: parameters,textures,statistics
example
  cfa get_material_info --material-path /Game/Materials/M_Test
  cfa get_material_info --material-path /Game/Materials/M_Test --include parameters,textures,statistics
set_material_properties

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

ParameterTypeRequiredDescription
material_pathstringYesMaterial asset path
blend_modestringNoBlend mode
shading_modelstringNoShading model
two_sidedboolNoTwo-sided
opacity_mask_clip_valuefloatNoClip value
dithered_lod_transitionboolNoDithered LOD transition
allow_negative_emissive_colorboolNoAllow negative emissive
translucency_lighting_modestringNoTranslucency lighting mode (surface, surface_per_pixel, volumetric_directional, volumetric_nondirectional, pervertex_directional, pervertex_nondirectional)
refraction_methodstringNoRefraction method (ior, pixel_normal_offset, 2doffset, none)
recompileboolNoRecompile after changes
example
  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 false
recompile_material

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

ParameterTypeRequiredDescription
material_pathstringYesMaterial asset path
example
  cfa recompile_material --material-path /Game/Materials/M_Test
apply_material

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

ParameterTypeRequiredDescription
material_pathstringYesMaterial asset path
example
  cfa apply_material --material-path /Game/Materials/M_Test
get_material_errors

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

ParameterTypeRequiredDescription
material_pathstringYesMaterial asset path
recompileboolNoRecompile first
example
  cfa get_material_errors --material-path /Game/Materials/M_Test
  cfa get_material_errors --material-path /Game/Materials/M_Test --recompile false
add_material_comments

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

ParameterTypeRequiredDescription
material_pathstringYesMaterial asset path
commentsjsonYesJSON array of comment definitions
example
  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_nodes

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

ParameterTypeRequiredDescription
material_pathstringYesMaterial asset path
type_filterstringNoFilter by node type
verbositystringNosummary, connections, or full
example
  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 TextureSample
get_material_expression_info

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

ParameterTypeRequiredDescription
material_pathstringYesMaterial asset path
node_indexintNoIndex of the expression node (from get_material_graph_nodes; or pass node_guid)
node_guidstringNoStable node GUID, survives add/delete/reorder
example
  cfa get_material_expression_info --material-path /Game/Materials/M_Test --node-index 3
get_material_property_connections

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

ParameterTypeRequiredDescription
material_pathstringYesMaterial asset path
example
  cfa get_material_property_connections --material-path /Game/Materials/M_Test
add_material_expression

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

ParameterTypeRequiredDescription
material_pathstringYesMaterial asset path
nodejsonYesJSON node definition
example
  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_expressions

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

ParameterTypeRequiredDescription
material_pathstringYesMaterial asset path
from_nodeintNoSource node index (or pass from_node_guid)
from_node_guidstringNoStable source node GUID
to_nodestringNoTarget node index, 'material', or pass to_node_guid
to_node_guidstringNoStable target node GUID
to_pinstringYesTarget pin name
from_pinstringNoSource pin name
example
  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 A
delete_material_expression

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

ParameterTypeRequiredDescription
material_pathstringYesMaterial asset path
node_indexintNoNode index (or pass node_guid)
node_guidstringNoStable node GUID (from get_material_graph_nodes), survives add/delete/reorder
example
  cfa delete_material_expression --material-path /Game/Materials/M_Test --node-index 3
set_material_expression_property

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

ParameterTypeRequiredDescription
material_pathstringYesMaterial asset path
node_indexintNoNode index (or pass node_guid)
node_guidstringNoStable node GUID (from get_material_graph_nodes), survives add/delete/reorder
property_namestringYesProperty name
property_valuestringYesProperty value
example
  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.5
move_material_expression

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

ParameterTypeRequiredDescription
material_pathstringYesMaterial asset path
node_indexintNoNode index (or pass node_guid)
node_guidstringNoStable node GUID (from get_material_graph_nodes), survives add/delete/reorder
pos_xintYesX position
pos_yintYesY position
example
  cfa move_material_expression --material-path /Game/Materials/M_Test --node-index 0 --pos-x -400 --pos-y 200
duplicate_material_expression

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

ParameterTypeRequiredDescription
material_pathstringYesMaterial asset path
node_indexintNoNode index to duplicate (or pass node_guid)
node_guidstringNoStable node GUID, survives add/delete/reorder
offset_xintNoX offset
offset_yintNoY offset
example
  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 200
layout_material_graph

Auto-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).

ParameterTypeRequiredDescription
material_pathstringYesMaterial asset path
example
  cfa layout_material_graph --material-path /Game/Materials/M_Test
layout_material_expressions

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

ParameterTypeRequiredDescription
material_pathstringYesMaterial asset path
example
  cfa layout_material_expressions --material-path /Game/Materials/M_Test
layout_material_function_graph

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

ParameterTypeRequiredDescription
function_pathstringYesMaterial function asset path
example
  cfa layout_material_function_graph --function-path /Game/Materials/Functions/MF_Test
get_material_instance_parameters

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

ParameterTypeRequiredDescription
material_pathstringYesMaterial instance path
example
  cfa get_material_instance_parameters --material-path /Game/Materials/MI_Red
set_material_instance_parameter

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

ParameterTypeRequiredDescription
material_pathstringYesMaterial instance path
param_namestringYesParameter name
param_typestringYesscalar|vector|texture|static_switch|component_mask|rvt|sparse_volume_texture
valuestringYesParameter value
example
  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_Height
set_material_instance_parent

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

ParameterTypeRequiredDescription
material_pathstringYesMaterial instance path
parent_pathstringYesNew parent material/instance path
example
  cfa set_material_instance_parent --material-path /Game/Materials/MI_Red --parent-path /Game/Materials/M_NewBase
clear_material_instance_parameter

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

ParameterTypeRequiredDescription
material_pathstringYesMaterial instance path
param_namestringYesParameter name to revert
example
  cfa clear_material_instance_parameter --material-path /Game/Materials/MI_Red --param-name Roughness
list_material_expression_types

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

ParameterTypeRequiredDescription
filterstringNoFilter by type name
max_resultsintNoMax results (0 = all)
include_detailsboolNoInclude type details
example
  cfa list_material_expression_types --filter Texture --max-results 20
  cfa list_material_expression_types --include-details false
get_expression_type_info

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

ParameterTypeRequiredDescription
type_namestringYesExpression type (e.g. Multiply, Custom, SubstrateSlabBSDF)
function_pathstringNoFor MaterialFunctionCall: path to function asset to inspect
example
  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 SubstrateSlabBSDF
get_available_material_pins

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

ParameterTypeRequiredDescription
material_pathstringYesMaterial asset path
example
  cfa get_available_material_pins --material-path /Game/Materials/M_Test
disconnect_material_expression

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

ParameterTypeRequiredDescription
material_pathstringYesMaterial asset path
node_indexintNoNode index (or pass node_guid)
node_guidstringNoStable node GUID (from get_material_graph_nodes), survives add/delete/reorder
input_pinstringYesInput pin name
example
  cfa disconnect_material_expression --material-path /Game/Materials/M_Test --node-index 2 --input-pin A
search_material_functions

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

ParameterTypeRequiredDescription
filterstringNoName filter
pathstringNoSearch path
max_resultsintNoMax results
include_engineboolNoInclude engine functions
example
  cfa search_material_functions --filter Fresnel
  cfa search_material_functions --filter Blend --include-engine true --max-results 10
validate_material_graph

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

ParameterTypeRequiredDescription
material_pathstringYesMaterial asset path
example
  cfa validate_material_graph --material-path /Game/Materials/M_Test
trace_material_connection

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

ParameterTypeRequiredDescription
material_pathstringYesMaterial asset path
node_indexintNoNode index (or pass node_guid)
node_guidstringNoStable node GUID (from get_material_graph_nodes), survives add/delete/reorder
directionstringNoupstream, downstream, or both
max_depthintNoMax trace depth
example
  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 both
cleanup_material_graph

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

ParameterTypeRequiredDescription
material_pathstringYesMaterial asset path
modestringNoorphaned, dead_ends, or all
dry_runboolNoPreview without deleting
example
  cfa cleanup_material_graph --material-path /Game/Materials/M_Test --dry-run true
  cfa cleanup_material_graph --material-path /Game/Materials/M_Test --mode all
create_material_function

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

ParameterTypeRequiredDescription
namestringYesFunction name
pathstringNoContent path
descriptionstringNoDescription
expose_to_libraryboolNoExpose to material library
function_typestringNofunction | layer | blend (Material Attribute Layer/Blend functions)
forceboolNoDelete and recreate if exists
example
  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 false
create_material_function_instance

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

ParameterTypeRequiredDescription
namestringYesInstance asset name
parent_pathstringYesParent material function path
pathstringNoContent path
forceboolNoReuse if exists
example
  cfa create_material_function_instance --name MFI_RedTint --parent-path /Game/Materials/Functions/MF_Tint --path /Game/Materials/Functions
set_material_function_instance_parameter

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

ParameterTypeRequiredDescription
instance_pathstringYesFunction instance path
param_namestringYesParameter name
param_typestringYesscalar | vector | static_switch
valuestringYesOverride value
example
  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.7
get_material_function_instance_parameters

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

ParameterTypeRequiredDescription
instance_pathstringYesFunction instance path
example
  cfa get_material_function_instance_parameters --instance-path /Game/Materials/Functions/MFI_RedTint
set_material_layers

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

ParameterTypeRequiredDescription
material_pathstringYesBase material or material instance path
layersjsonYesJSON array of layer function paths (layers[0]=background; ""/"none" = empty slot)
blendsjsonNoJSON array of blend function paths (one fewer than layers)
example
  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_layers

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

ParameterTypeRequiredDescription
material_pathstringYesBase material or material instance path
example
  cfa get_material_layers --material-path /Game/Materials/MI_Layered
get_material_function_info

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

ParameterTypeRequiredDescription
function_pathstringYesFunction asset path
verbositystringNointerface | summary | full
type_filterstringNoSubstring filter on other_nodes type names (full only)
example
  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 Texture
build_material_function_graph

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

ParameterTypeRequiredDescription
function_pathstringYesFunction asset path
nodesjsonYesJSON array of node definitions
connectionsjsonYesJSON array of connections
clear_existingboolNoClear existing expressions
example
  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_input

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

ParameterTypeRequiredDescription
function_pathstringYesFunction asset path
input_namestringYesInput name
input_typestringNoInput type
descriptionstringNoDescription
sort_priorityintNoSort priority
use_preview_as_defaultboolNoUse preview as default
preview_valuestringNoPreview value
pos_xintNoX position
pos_yintNoY position
example
  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 true
add_material_function_output

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

ParameterTypeRequiredDescription
function_pathstringYesFunction asset path
output_namestringYesOutput name
descriptionstringNoDescription
sort_priorityintNoSort priority
pos_xintNoX position
pos_yintNoY position
example
  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 200
set_material_function_input

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

ParameterTypeRequiredDescription
function_pathstringYesFunction asset path
node_indexintNoNode index (or pass node_guid)
node_guidstringNoStable node GUID (from get_material_graph_nodes), survives add/delete/reorder
input_namestringNoInput name
input_typestringNoInput type
descriptionstringNoDescription
sort_priorityintNoSort priority
use_preview_as_defaultboolNoUse preview as default
preview_valuestringNoPreview value
example
  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 true
set_material_function_output

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

ParameterTypeRequiredDescription
function_pathstringYesFunction asset path
node_indexintNoNode index (or pass node_guid)
node_guidstringNoStable node GUID (from get_material_graph_nodes), survives add/delete/reorder
output_namestringNoOutput name
descriptionstringNoDescription
sort_priorityintNoSort priority
example
  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 0
validate_material_function

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

ParameterTypeRequiredDescription
function_pathstringYesFunction asset path
example
  cfa validate_material_function --function-path /Game/Materials/Functions/MF_Blend
cleanup_material_function

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

ParameterTypeRequiredDescription
function_pathstringYesFunction asset path
dry_runboolNoPreview without deleting
example
  cfa cleanup_material_function --function-path /Game/Materials/Functions/MF_Blend --dry-run true
  cfa cleanup_material_function --function-path /Game/Materials/Functions/MF_Blend
create_material_parameter_collection

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

ParameterTypeRequiredDescription
namestringYesCollection asset name
pathstringNoContent path
forceboolNoClear entries and reuse if exists
example
  cfa create_material_parameter_collection --name MPC_Global --path /Game/Materials
set_material_parameter_collection_parameter

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

ParameterTypeRequiredDescription
collection_pathstringYesMPC asset path
param_namestringYesParameter name
param_typestringYesscalar | vector
valuestringYesDefault value (number, or [r,g,b,a]/(R=..) for vector)
example
  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_collection

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

ParameterTypeRequiredDescription
collection_pathstringYesMPC asset path
example
  cfa get_material_parameter_collection --collection-path /Game/Materials/MPC_Global
delete_material_parameter_collection_parameter

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

ParameterTypeRequiredDescription
collection_pathstringYesMPC asset path
param_namestringYesParameter name to remove
example
  cfa delete_material_parameter_collection_parameter --collection-path /Game/Materials/MPC_Global --param-name TimeScale