Materials, lighting and Niagara in Unreal Engine with AI
Look development in Unreal is many small settings across materials, lights and post process. That is a good fit for an AI that can read the current values and change them precisely. This guide covers what Unreal MCP Pro 1.0.3 does for materials, lighting and Niagara, including the places where you need editor Python.
Materials
create_material { "name": "M_Painted", "path": "/Game/Materials", "blend_mode": "opaque" }
get_material_info { "asset": "/Game/Materials/M_Painted" }
list_materials { "path_filter": "/Game/Materials" }
blend_mode is opaque, translucent, masked or additive. create_material_function makes reusable functions.
Material graphs
add_material_expression adds nodes by class name (VectorParameter, ScalarParameter, Constant3Vector, Multiply, TextureSample, ...). set_expression_value sets constants and parameter defaults (value for scalars, r/g/b/a for vectors, parameter_name for parameters). connect_material_nodes wires one node's output to another node's input, using the node names that get_material_graph returns.
add_material_expression { "material": "/Game/Materials/M_Painted", "expression_class": "VectorParameter" }
get_material_graph { "material": "/Game/Materials/M_Painted" } // node names, e.g. MaterialExpressionVectorParameter_0
set_expression_value { "material": "/Game/Materials/M_Painted", "expression": "MaterialExpressionVectorParameter_0",
"parameter_name": "Tint", "r": 0.8, "g": 0.25, "b": 0.1 }
Connecting to the material output
In 1.0.3, connect_material_nodes connects nodes to each other but not to the material's own output pins (Base Color, Roughness and so on). Use execute_python for that last step; the Python Editor Script Plugin must be enabled:
import unreal
mel = unreal.MaterialEditingLibrary
mat = unreal.load_asset('/Game/Materials/M_Painted')
tint = mel.create_material_expression(mat, unreal.MaterialExpressionVectorParameter, -400, 0)
tint.set_editor_property('parameter_name', 'Tint')
mel.connect_material_property(tint, '', unreal.MaterialProperty.MP_BASE_COLOR)
rough = mel.create_material_expression(mat, unreal.MaterialExpressionScalarParameter, -400, 200)
rough.set_editor_property('parameter_name', 'Roughness')
mel.connect_material_property(rough, '', unreal.MaterialProperty.MP_ROUGHNESS)
mel.recompile_material(mat)
unreal.EditorAssetLibrary.save_loaded_asset(mat)
The AI can write and run this itself; ask it to read get_output_log afterwards for any Python error.
Instances and assignment
create_material_instance { "name": "MI_Painted_Red", "path": "/Game/Materials", "parent": "/Game/Materials/M_Painted" }
set_material_parameter { "asset": "/Game/Materials/MI_Painted_Red", "name": "Roughness", "value": 0.35, "type": "scalar" }
assign_material { "label": "Wall_N", "material": "/Game/Materials/MI_Painted_Red", "slot": 0 }
In 1.0.3, set_material_parameter works for scalar and texture parameters, but vector (colour) values are not passed through to the editor and come out white. Set colours as the parameter default on the parent with set_expression_value, or on the instance with execute_python (MaterialEditingLibrary.set_material_instance_vector_parameter_value).
Lights
add_light creates point, spot, directional or rect lights with location, intensity and colour. set_light_property edits intensity, color ("r,g,b"), temperature, cast_shadows, attenuation_radius, inner_cone_angle and outer_cone_angle. Static lighting: build_lighting (only matters for static and stationary lights; Lumen is dynamic).
Lumen, sky and shadows
set_lumen_settings: Lumen GI and reflections on or off, quality 0-4.set_lumen_gi_settingsadds final gather quality, trace distance and hardware ray tracing.add_sky_atmosphereandset_skylight(intensity, colour as 0-1r/g/b, real-time capture).set_virtual_shadow_mapsandset_nanite_settingsfor the UE5 rendering features.
Post process
add_post_process_volume { "label": "PPV_Global", "unbound": true }
set_post_process_settings { "label": "PPV_Global", "auto_exposure_bias": 0.5, "bloom_intensity": 0.4,
"vignette_intensity": 0.3, "color_saturation": 1.1, "ambient_occlusion_intensity": 0.6 }
Depth of field (focal_distance, dof_fstop), contrast and motion blur are in the same call.
Niagara
What acts in 1.0.3: tuning and toggling Niagara components that are in the level.
get_niagara_infolists a system's details or a component's parameters.set_niagara_parametersets a float (value) or vector (r/g/b) user parameter on an actor's Niagara component.activate_niagarastarts or stops it.
To place an existing system, spawn a NiagaraActor, then set its component's Asset property to the system path with set_component_property (get the component name from list_components) and activate it. Creating systems and emitters (create_niagara_system, create_niagara_emitter, add_niagara_emitter) does not act in 1.0.3: make the system in the Niagara editor, or from a template with editor Python, and let the AI place and tune it.
Looking at the result
set_view_mode (lit, unlit, wireframe and others), set_show_flag, set_viewport_camera or focus_on_actor, then capture_viewport to save a screenshot to Saved/Screenshots. get_scene_stats and get_texture_stats help when a lighting pass gets heavy.
Get Unreal MCP Pro
$5 once on itch.io, free updates.