set_niagara_scratch_pad_hlsl
Set HLSL source on a Niagara scratch pad's Custom HLSL node, automatically creating input and output pins as defined.
Instructions
Set HLSL source on a scratch pad module's Custom HLSL node, creating pins as needed.
Pin creation uses exported schema APIs (UEdGraphSchema_Niagara::TypeDefinitionToPinType) plus reflection on the CustomHlsl UPROPERTY (SetCustomHlsl is not NIAGARAEDITOR_API exported). After changes the node's FNiagaraFunctionSignature is rebuilt from the pin list, mirroring UNiagaraNodeCustomHlsl::RebuildSignatureFromPins exactly.
Args: system_path: Niagara System asset path module_name: Scratch pad module name containing the Custom HLSL node hlsl_code: Raw HLSL source. Reference pins by name (e.g. Result = Value * Scale;) inputs: Optional list of {"name": str, "type": str} — input pins to create outputs: Optional list of {"name": str, "type": str} — output pins to create clear_existing_pins: If true, remove all current non-Add pins before adding new ones
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| inputs | No | ||
| outputs | No | ||
| hlsl_code | Yes | ||
| module_name | Yes | ||
| system_path | Yes | ||
| clear_existing_pins | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |