godot icon indicating copy to clipboard operation
godot copied to clipboard

Exporting Node variable can't trigger setget in tool mode.

Open Hapenia-Lans opened this issue 2 years ago • 0 comments

Godot version

4.0 beta 6

System information

This is system-independent.

Issue description

As title.

This is because when the exported node variable a_variable is modified, the editor actually modifies the variable metadata/_ editor_prop_ptr_a_variable, so the setget defined in the @ tool script does not work.

image

Steps to reproduce

@tool
extends Node

@export var a_export_node: Node :
    set(v):
         print("set!")
         a_export_node = v

Minimal reproduction project

very easy to reproduce.

Hapenia-Lans avatar Nov 28 '22 07:11 Hapenia-Lans