+1 vote

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???????????????????

enter image description here

Resolved

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

in Engine by (174 points)
edited by

1 Answer

0 votes

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()
by (211 points)
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.