anyone know how to refresh the inspector panel in editor from gdscript? (it's solved)

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By newold

I have a script with tool keyword.
I have an export array variable.
I have a function that complete the array with x values when you add a child
Then when the function change the array, i need select other child and then select the parent again to refresh the export array in the editor inspector panel. can i do it from gdscript?

extends Control
tool


export(Array) var any_array


func add_child(node: Node, legible_unique_name: bool = false):
	$CONTAINER.add_child(node, legible_unique_name)
	
	any_array.append("SOME DATA")
	
	# HOW UPDATE THE INSPECTOR PANEL IN THE EDITOR FROM HERE???????????????????

Resolved

I find it: i only need call to function property_list_changed_notify() and magic is done

:bust_in_silhouette: Reply From: luislodosm

You can also set a boolean to update properties in the inspector when you click on the boolean’s checkbox, like a button.

tool
extends node

export var update = false setget update_inspector

func update_inspector(_value):
    # Do stuff
    property_list_changed_notify()

In Godot 4 is:

notify_property_list_changed()

luislodosm | 2022-09-16 16:15