UE-291403 still present in UE 5.8.2: static switch setter always returns false

Summary

Follow-up to UE-291403: https://issues.unrealengine.com/issue/UE-291403

The static-switch setter case is still present in UE 5.8.2 (CL 56702186, ++UE5+Release-5.8). UMaterialEditingLibrary::SetMaterialInstanceStaticSwitchParameterValue returns false even when the parameter is successfully set. This can cause editor automation to report a failure after a successful change.

Independent inspection of the installed 5.8.2 source confirms the cause in Engine/Source/Editor/MaterialEditor/Private/MaterialEditingLibrary.cpp, lines 1596-1614: bResult is initialized to false and returned without ever being assigned true, although SetStaticSwitchParameterValueEditorOnly and the optional UpdateMaterialInstance are called.

Please associate this report with UE-291403 and consider adding 5.8.2 to the affected versions. This follow-up checks the static-switch function specifically, not all setters listed in the existing issue.

What Type of Bug are you experiencing?

Editor

Steps to Reproduce

  1. In UE 5.8.2, create a material with an active Static Switch Parameter named EnableWind, default false, connected to the material output.
  2. Create a Material Instance Constant using that material.
  3. From editor Python or C++, call MaterialEditingLibrary.set_material_instance_static_switch_parameter_value / UMaterialEditingLibrary::SetMaterialInstanceStaticSwitchParameterValue for that instance, EnableWind, true.
  4. Record the returned boolean.
  5. Read the switch value back with the corresponding getter and inspect the override in the Material Instance Editor.

The project investigation reported false from the setter and true on readback. The independent confirmation for this follow-up is source inspection; a fresh minimal-project runtime reproduction was not performed by Codex.

Expected Result

The setter should report success when a valid static-switch parameter is successfully set, and should not unconditionally return false.

Observed Result

The setter returns false despite the parameter being set to true (reported during the project investigation). The 5.8.2 implementation independently confirms that every return path returns the unchanged false result.

Affects Versions

5.8

Platform(s)

Windows

Additional Notes

Workaround: verify the parameter value after setting it, rather than treating the setter return alone as a failure. Also verify that the parameter exists and the expected override is present, especially when setting false.

Credits for this project investigation and report: Viktor (Vic40k), project author and co-author of this report; Claude Code Sonnet 5, which identified and diagnosed the issue in the project; OpenAI Codex, which independently confirmed the defect in the UE 5.8.2 source and prepared/submitted this follow-up on Viktor’s behalf. These credits concern our investigation of the affected version, not the original discovery of the already tracked UE-291403.

I’ve attached a link to your report in the ticket. Thank you!