How to get EditorProperty to update when not visible in Inspector?

Godot Version

4.3

Question

In my project I have a resource called Colours that contains an array of an object called ColourData. ColourData has just a name, and a colour and that’s it.

The idea is that in parts of my program where I need ‘standardised’ colours instead of exporting godot’s Color type, I export my ColourData type - which is overridden by the EditorProperty and displays only the colours on the Colours resource which I have.

Now this all works for the most part.
image

However I cannot come up with a way to notify these properties when the resource changes to update themselves. If I change the colour of one of these properties within the resource, I have to select the Node with the property attached to send through an update.
I think this is because EditorProperty only exists when a node with the property is selected in the inspector, and afterwards it is deleted. So it’s not as simple as just connecting to a changed signal or something like that, because the EditorProperty simply no longer exists when it isn’t selected.

Is there any way I can update them in some way to reflect the changes that I’ve made to the resource?

1 Like

Why do you need to update the Inspector’s EditorProperty when your custom resource is not being edited in the Inspector?

The Inspector provides a way of editing persistent property values. It does not store values, it edits values stored elsewhere. The values should be stored in your resource (.tres) or some other storage method (Dictionary/JSON, ConfigFile, binary file, etc.)

I may be misunderstanding your question.