diff options
author | reduz <reduzio@gmail.com> | 2022-06-19 00:42:02 +0200 |
---|---|---|
committer | reduz <reduzio@gmail.com> | 2022-06-25 15:50:15 +0200 |
commit | b7c41f9ba1afe892af465b56cd942b83e1a19b13 (patch) | |
tree | 4704fff413b5593bed54ccc483088e7cb7a357a0 /servers/text_server.cpp | |
parent | c32285733d4f235249c1031ee64d19b751e4d7df (diff) |
Add ability to export Node pointers as NodePaths
This PR implements:
* A new hint: PROPERTY_HINT_NODE_TYPE for variant type OBJECT, which can take specific node types as hint string.
* The editor will show it as a node path, but will set it as a pointer to a node from the current scene if you select a path.
* When scene is saved, the node path is saved, then restored as a pointer.
NOTE: This is a proof of concept and this approach will most likely not work. The reason if that, if the node referenced is deleted, then when trying to edit this the node will become invalid.
Potential workarounds: Since this uses the Variant API, it should obtain the pointer from the Variant object ID. Yet, this would either only really work in GDScript or it would need to be implemented with workarounds in every language.
Alternative ways to make this work: Nodes could export an additional property with a node path (like for which_node, it could be which_node_path).
Another alternative: Path editing could happen as a hidden metadata (ignoring the pointer).
Diffstat (limited to 'servers/text_server.cpp')
0 files changed, 0 insertions, 0 deletions