mat_add_expression
Add a material expression node to an Unreal Engine Material asset, specifying type and optional parameters for texture, constants, or parameters.
Instructions
Add a material expression (node) to a Material asset.
Common expression_type values: Texture — TextureSample (provide texture_path in params) Multiply — Multiply two inputs Add — Add two inputs Lerp — Linear interpolation Constant — Single float constant (provide value in params) Constant3 — RGB vector constant (provide r,g,b in params) Constant4 — RGBA vector constant (provide r,g,b,a in params) Param_Scalar — Scalar parameter (provide param_name in params) Param_Vector — Vector parameter (provide param_name in params) Param_Texture — Texture parameter (provide param_name in params) Fresnel — Fresnel effect CheapContrast — Cheap contrast adjustment Desaturation — Desaturation OneMinus — 1 - input VertexColor — Vertex color input WorldPosition — World position
expression_params (JSON object): texture_path: str — For TextureSample/Param_Texture param_name: str — For Param_* expressions value: float — For Constant r,g,b,a: float — For Constant3/Constant4
Args: material_path: Full asset path (e.g. '/Game/Materials/M_Rock') expression_type: Expression class short name (see above) position_x: Canvas X position. Default 0. position_y: Canvas Y position. Default 0. expression_params: JSON object of expression-specific params.
Returns: JSON StructuredResult. outputs.expression_index — Index for use in mat_connect_expressions outputs.expression_name — Object name of the created expression
KB: see knowledge_base/01_BLUEPRINT_FUNDAMENTALS.md#overview Example: mat_add_expression(material_path="/Game/MCP_Test/M_Example", expression_type="Example")
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| position_x | No | ||
| position_y | No | ||
| material_path | Yes | ||
| expression_type | Yes | ||
| expression_params | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |