add_material_function_input
Add an input pin to a UMaterialFunction asset, set its type, description, sort order, and preview/default value, then recompile the function and mark it dirty without saving.
Instructions
Add a FunctionInput node (a new input pin) to a UMaterialFunction asset with the optional props applied, then recompile the function and mark it dirty without saving. Returns node_id, the handle for set_material_function_input_props and delete_material_function_input, plus num_inputs and added.
Returns: { function_path: string, input_name: string, input_type: string, node_id: string, num_inputs: number, added: bool }
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| input_name | Yes | Name of the new input pin, stored as given: a name another input already uses is not made unique. | |
| input_type | No | One of the 13 EFunctionInputType values: Scalar|Vector2|Vector3|Vector4|Texture2D|TextureCube|Texture2DArray|VolumeTexture|StaticBool|MaterialAttributes|TextureExternal|Bool|Substrate (optional, default "Scalar") | |
| description | No | Optional tooltip/description string for the input pin | |
| function_path | Yes | Full path to the material function, e.g. '/Game/MyGame/MF_Example.MF_Example' | |
| preview_value | No | JSON object {"x":0,"y":0,"z":0,"w":0} (FVector4f), any subset; missing components keep their current value. Used for previews, and as the default with use_preview_value_as_default. | |
| sort_priority | No | Optional int controlling the input's display order relative to other inputs | |
| use_preview_value_as_default | No | Optional bool; if true, the preview value becomes the input's default |