Godot 4.6.2.stable
I have this small custom class for testing:
@tool
extends ShaderMaterial
class_name TestShaderMaterial
func set_shader_parameter_persistent(parameter_name : String, value : Variant) -> void:
set("shader_parameter/" + parameter_name, value)
emit_changed()
I am calling set_shader_parameter_persistent from an autoload, always with a Texture2DArray. When it gets called, the inspector seems fine with it, everything updates as I’d expect, and the shader starts sampling the TextureArray, but when I do anything to refresh the inspector, my change is lost. It just forgets I ever set that parameter. It’s quite frustrating. The change is never saved into the material’s .tres file either. Does anyone have a clue what could be going wrong? I really need this to work for a project.