Clearing an exported Node using the drop down menu does not clear the property, when in a script which runs in editor using @tool
@export var annotation_node:Node = null
Additionally, if exporting a property of type Node with _get_property_list(), results in error when pressing the clear button:
Trying to assign value of type 'NodePath' to a variable of type 'Node'.
Because of the error I believe the issue is probably similiar as in: https://github.com/godotengine/godot/issues/62481. (As the issue says, currently the reset arrow works and set the variable to Nil correctly.)
In fact when printing the type of the value in _set, it gives Object when setting a node, Nil when resetting with the arrow, and NodePath when pressing clear button in the drop down.
For Node exported with @export, when pressing the clear button will not print anything in it's setter, as if the setter is not called:
@export var annotation_node:Node:
set(value):
print(type_string(typeof(value)))
annotation_node = value
Steps to reproduce
Create a script which runs in editor with @tool
Export a property of type Node with @export var node:Node or using get_property_list().
Tested versions
v4.2.2.stable.arch_linux
System information
Godot v4.2.2.stable unknown - Arch Linux #1 SMP PREEMPT_DYNAMIC Sun, 16 Jun 2024 19:06:37 +0000 - X11 - Vulkan (Forward+) - dedicated AMD Radeon RX 5700 XT (RADV NAVI10) () - AMD Ryzen 9 5950X 16-Core Processor (32 Threads)
Issue description
Clearing an exported Node using the drop down menu does not clear the property, when in a script which runs in editor using
@tool
Additionally, if exporting a property of type Node with
_get_property_list()
, results in error when pressing the clear button:Trying to assign value of type 'NodePath' to a variable of type 'Node'.
Because of the error I believe the issue is probably similiar as in: https://github.com/godotengine/godot/issues/62481. (As the issue says, currently the reset arrow works and set the variable to
Nil
correctly.)In fact when printing the type of the value in
_set
, it givesObject
when setting a node,Nil
when resetting with the arrow, andNodePath
when pressing clear button in the drop down.For Node exported with
@export
, when pressing the clear button will not print anything in it's setter, as if the setter is not called:Steps to reproduce
@tool
@export var node:Node
or usingget_property_list()
.Minimal reproduction project (MRP)
mrp-node-export-clear.zip