Closed chippmann closed 3 months ago
@MartinHaeusler If you could test your cases here as well, I'd be very grateful :-)
@chippmann my use case was simply:
@Export
@RegisterProperty
var nodes: VariantArray<Node3D>? = null
It looks to me like your test cases went far beyond that, which is cool! I was able to "fix" my case with the current release codebase by manually assigning NodePath resources to the array entries in the editor, and then assigning the actual nodes to the node paths. It works, but was very clunky and it had the issue that I could add arbitrary resources to the array. Your screenshots already show that this is no longer the case, which is great :+1:
Fixes #573
With godot 4 the hint string for the inspector changed it's format and now also Node and Resource based classes are allowed for Array's. Our implementation now covers those cases as well.
For reference, the code which handles this in the inspector can be found here: https://github.com/godotengine/godot/blob/36e943b6b20cb7a8a89bc30489c4a81c3e149d74/editor/editor_properties_array_dict.cpp#L616-L635
And the GDScript parser handles this here: https://github.com/godotengine/godot/blob/36e943b6b20cb7a8a89bc30489c4a81c3e149d74/modules/gdscript/gdscript_parser.cpp#L4077-L4170
Custom classes are also supported now:![](https://github.com/utopia-rise/godot-kotlin-jvm/assets/22662033/b9e2e6e1-185f-4022-9a3f-6770e84f8d67)
![](https://github.com/utopia-rise/godot-kotlin-jvm/assets/22662033/b5c2e863-babb-44b5-80c4-f5ace885c50b)