Godot Version
4.3
Question
Hi,
I’ve got a tool script with exported variables. I’m trying to run a method everytime a texture is changed, but the setter is not called when I update the texture in the editor.
@tool
extends Node
class_name Level
@export_range(16, 128) var level_size: int = 32 :
set (value):
print_debug("update level")
level_size = value
@export_color_no_alpha var color: Color:
set (value):
print_debug("update color")
color = value
@export var heightmap_texture: Texture2D:
set (value):
print_debug("update terrain")
heightmap_texture = value
For the texture, I set a NoiseTexture2D in the editor.
Now, everytime I update the level size, or the color property, the corresponding getter is called. But for the texture, the setter is only called when the scene is initialized, or if I clear the property and set it again from scratch.
If I update a single property of the nexture (changing noise parameters, changing texture size, or any of the texture properties like “seamless”, “normalize”, etc.) the setter is not called.
Is this a bug or an expected behaviour? How can I react to any change in the texture?
Thanks