editor.material

Material creation, expressions, and connections

← API Reference

editor.material.create

Creates a new Material asset.

Parameters:

NameTypeRequiredDescription
pathstringYesContent directory (e.g. "/Game/Materials")
namestringYesMaterial name

Returns: success (bool), asset_path (string), name (string)

Example Request:

{ "jsonrpc": "2.0", "id": 1, "method": "editor.material.create", "params": { "path": "/Game/Materials", "name": "M_Gold" } }

editor.material.getExpressions

Lists all material expression nodes in a Material.

Parameters:

NameTypeRequiredDescription
asset_pathstringYesMaterial asset path

Returns: Array of {index, class, caption, position {x, y}, input_names, output_names}

Example Request:

{ "jsonrpc": "2.0", "id": 1, "method": "editor.material.getExpressions", "params": { "asset_path": "/Game/Materials/M_Gold" } }

editor.material.addExpression

Adds a new material expression node to a Material.

Parameters:

NameTypeRequiredDescription
asset_pathstringYesMaterial asset path
expression_classstringYesUMaterialExpression subclass (e.g. "MaterialExpressionConstant3Vector")
positionobjectNo{x, y} position (default 0,0)

Returns: success, index, class, caption, position, input_names, output_names

Example Request:

{ "jsonrpc": "2.0", "id": 1, "method": "editor.material.addExpression", "params": { "asset_path": "/Game/Materials/M_Gold", "expression_class": "MaterialExpressionConstant3Vector", "position": { "x": -300, "y": 0 } } }

editor.material.deleteExpression

Deletes a material expression by its index.

Parameters:

NameTypeRequiredDescription
asset_pathstringYesMaterial asset path
expression_indexnumberYesIndex of expression to delete

Returns: success (bool)

Example Request:

{ "jsonrpc": "2.0", "id": 1, "method": "editor.material.deleteExpression", "params": { "asset_path": "/Game/Materials/M_Gold", "expression_index": 0 } }

editor.material.connectExpressions

Connects the output of one expression to the input of another.

Parameters:

NameTypeRequiredDescription
asset_pathstringYesMaterial asset path
from_expression_indexnumberYesSource expression index
to_expression_indexnumberYesTarget expression index
to_input_namestringYesInput name on target expression
from_output_namestringNoOutput name on source (default: first output)

Returns: success (bool)

Example Request:

{ "jsonrpc": "2.0", "id": 1, "method": "editor.material.connectExpressions", "params": { "asset_path": "/Game/Materials/M_Gold", "from_expression_index": 0, "to_expression_index": 1, "to_input_name": "A" } }

editor.material.connectToProperty

Connects a material expression output to a material property input.

Parameters:

NameTypeRequiredDescription
asset_pathstringYesMaterial asset path
from_expression_indexnumberYesSource expression index
propertystringYesProperty: BaseColor, Metallic, Specular, Roughness, Normal, EmissiveColor, Opacity, OpacityMask, etc.
from_output_namestringNoOutput name on source (default: first output)

Returns: success (bool), property (string)

Example Request:

{ "jsonrpc": "2.0", "id": 1, "method": "editor.material.connectToProperty", "params": { "asset_path": "/Game/Materials/M_Gold", "from_expression_index": 0, "property": "BaseColor" } }

editor.material.getPropertyInput

Returns which expression is connected to a material property input.

Parameters:

NameTypeRequiredDescription
asset_pathstringYesMaterial asset path
propertystringYesProperty name

Returns: property, expression (object or null), output_name

Example Request:

{ "jsonrpc": "2.0", "id": 1, "method": "editor.material.getPropertyInput", "params": { "asset_path": "/Game/Materials/M_Gold", "property": "BaseColor" } }

editor.material.getParameters

Lists all parameter names grouped by type for a Material or MaterialInstance.

Parameters:

NameTypeRequiredDescription
asset_pathstringYesPath to Material or MaterialInstance

Returns: scalar (array), vector (array), texture (array), static_switch (array)

Example Request:

{ "jsonrpc": "2.0", "id": 1, "method": "editor.material.getParameters", "params": { "asset_path": "/Game/Materials/M_Gold" } }

editor.material.getParameterValue

Gets the default value of a parameter in a Material.

Parameters:

NameTypeRequiredDescription
asset_pathstringYesMaterial asset path
parameter_namestringYesParameter name
parameter_typestringYesscalar, vector, texture, or static_switch

Returns: parameter_name, parameter_type, value (varies by type)

Example Request:

{ "jsonrpc": "2.0", "id": 1, "method": "editor.material.getParameterValue", "params": { "asset_path": "/Game/Materials/M_Gold", "parameter_name": "Roughness", "parameter_type": "scalar" } }

editor.material.setInstanceParameterValue

Sets a parameter value on a MaterialInstanceConstant.

Parameters:

NameTypeRequiredDescription
asset_pathstringYesPath to MaterialInstanceConstant
parameter_namestringYesParameter name
parameter_typestringYesscalar, vector, texture, or static_switch
valuevariesYesscalar: number, vector: {r,g,b,a}, texture: string path, static_switch: bool

Returns: success (bool), parameter_name, parameter_type

Example Request:

{ "jsonrpc": "2.0", "id": 1, "method": "editor.material.setInstanceParameterValue", "params": { "asset_path": "/Game/Materials/MI_Gold_Inst", "parameter_name": "Roughness", "parameter_type": "scalar", "value": 0.3 } }

editor.material.compile

Recompiles a Material.

Parameters:

NameTypeRequiredDescription
asset_pathstringYesMaterial asset path

Returns: success (bool), asset_path (string)

Example Request:

{ "jsonrpc": "2.0", "id": 1, "method": "editor.material.compile", "params": { "asset_path": "/Game/Materials/M_Gold" } }

editor.material.getStatistics

Returns shader statistics (instruction counts, sampler counts) for a Material or MaterialInstance.

Parameters:

NameTypeRequiredDescription
asset_pathstringYesPath to Material or MaterialInstance

Returns: num_vertex_shader_instructions, num_pixel_shader_instructions, num_samplers, num_vertex_texture_samples, num_pixel_texture_samples, num_virtual_texture_samples, num_uv_scalars, num_interpolator_scalars

Example Request:

{ "jsonrpc": "2.0", "id": 1, "method": "editor.material.getStatistics", "params": { "asset_path": "/Game/Materials/M_Gold" } }

editor.material.layoutExpressions

Auto-layouts all material expression nodes for visual clarity.

Parameters:

NameTypeRequiredDescription
asset_pathstringYesMaterial asset path

Returns: success (bool), asset_path (string)

Example Request:

{ "jsonrpc": "2.0", "id": 1, "method": "editor.material.layoutExpressions", "params": { "asset_path": "/Game/Materials/M_Gold" } }

editor.material.setUsage

Enables a material usage flag (e.g. SkeletalMesh, Nanite).

Parameters:

NameTypeRequiredDescription
asset_pathstringYesMaterial asset path
usagestringYesSkeletalMesh, ParticleSprites, StaticLighting, Nanite, StaticMesh, etc.

Returns: success (bool), usage (string), needs_recompile (bool)

Example Request:

{ "jsonrpc": "2.0", "id": 1, "method": "editor.material.setUsage", "params": { "asset_path": "/Game/Materials/M_Gold", "usage": "Nanite" } }

editor.material.createFunction

Creates a new Material Function asset.

Parameters:

NameTypeRequiredDescription
pathstringYesContent directory
namestringYesMaterial function name
descriptionstringNoDescription displayed as tooltip
expose_to_libraryboolNoWhether to list in the material function library

Returns: success (bool), asset_path, name

Example Request:

{ "jsonrpc": "2.0", "id": 1, "method": "editor.material.createFunction", "params": { "path": "/Game/Materials", "name": "MF_Noise", "expose_to_library": true } }

editor.material.getFunctions

Lists all material function calls in a Material.

Parameters:

NameTypeRequiredDescription
asset_pathstringYesMaterial asset path

Returns: Array of {expression_index, function_path, function_name, inputs, outputs}

Example Request:

{ "jsonrpc": "2.0", "id": 1, "method": "editor.material.getFunctions", "params": { "asset_path": "/Game/Materials/M_Gold" } }

editor.material.createParameterCollection

Creates a new Material Parameter Collection asset.

Parameters:

NameTypeRequiredDescription
pathstringYesContent directory
namestringYesCollection name

Returns: success (bool), asset_path, name

Example Request:

{ "jsonrpc": "2.0", "id": 1, "method": "editor.material.createParameterCollection", "params": { "path": "/Game/Materials", "name": "MPC_Global" } }

editor.material.getParameterCollections

Lists material parameter collections. If asset_path is provided, returns detailed info. Otherwise lists all registered MPCs.

Parameters:

NameTypeRequiredDescription
asset_pathstringNoPath to a specific MPC (omit to list all)

Returns (single): asset_path, name, scalar_parameters (array), vector_parameters (array)

Returns (all): Array of {asset_path, name}

Example Request:

{ "jsonrpc": "2.0", "id": 1, "method": "editor.material.getParameterCollections", "params": { "asset_path": "/Game/Materials/MPC_Global" } }

editor.material.setParameterCollectionValue

Sets a default parameter value in a Material Parameter Collection.

Parameters:

NameTypeRequiredDescription
asset_pathstringYesPath to MaterialParameterCollection
parameter_namestringYesParameter name
parameter_typestringYesscalar or vector
valuevariesYesscalar: number, vector: {r,g,b,a}

Returns: success (bool), parameter_name, parameter_type

Example Request:

{ "jsonrpc": "2.0", "id": 1, "method": "editor.material.setParameterCollectionValue", "params": { "asset_path": "/Game/Materials/MPC_Global", "parameter_name": "WindStrength", "parameter_type": "scalar", "value": 1.5 } }

editor.material.autoLayout

Arranges material expression nodes using a Sugiyama-style layered layout with cycle removal, layer assignment, crossing reduction, size-aware coordinate assignment, overlap removal, and grid snap. Expression connections are traced via FExpressionInput to build the edge graph.

Parameters:

NameTypeRequiredDescription
asset_pathstringYesMaterial asset path
x_spacingnumberNoHorizontal spacing between layers (default: 250)
y_spacingnumberNoVertical spacing between nodes (default: 100)
min_gapnumberNoMinimum gap between expression bounding boxes (default: 20)
max_nodes_per_layernumberNoMax nodes per layer before sublayering (default: 8)
snap_to_gridnumberNoGrid snap size (default: 16, set 0 to disable)

Returns: success (bool), node_count (number), layer_count (number), positions (array of {index, class, x, y, layer})

Example Request:

{ "jsonrpc": "2.0", "id": 1, "method": "editor.material.autoLayout", "params": { "asset_path": "/Game/Materials/M_Gold" } }

editor.material.autoGroup

Groups connected material expressions into logical clusters using BFS connected-component analysis. Each group is classified by dominant expression type (Texture, Math, Constants, Parameters, Input, Function, Utility). Colors are loaded from the Material section of Config/LayoutColors.json.

Parameters:

NameTypeRequiredDescription
asset_pathstringYesMaterial asset path
paddingnumberNoBounding box padding in pixels (default: 50)
min_group_sizenumberNoMinimum expressions to form a group (default: 2)

Returns: success (bool), group_count (number), groups (array of {label, node_count, expression_indices, color: {r,g,b,a}, bounds: {x,y,width,height}})

Example Request:

{ "jsonrpc": "2.0", "id": 1, "method": "editor.material.autoGroup", "params": { "asset_path": "/Game/Materials/M_Gold" } }