How to list the export vars of a node?

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

I would like to have a list of export variables/properties of a node.
How to reach that information?

Script example:

export var a = 10
export var b = "a"
var notInteresting = null

I would like to have only a, b as output.

:bust_in_silhouette: Reply From: avencherus

You can parse them out get_property_list() by filtering the usage field by PROPERTY_USAGE_SCRIPT_VARIABLE.

Thank you. It was very helpful.

The usage id of export variables is 8199.
It is not in the documentation at this pont. (Godot 3.1 alfa 4)

The normal variables has this usage id. PROPERTY_USAGE_SCRIPT_VARIABLE = 8192

DavidPeterWorks | 2019-01-02 20:16

Hey DavidPeterWorks,

could we see your code for this?

I am confused on how to turn “usage” key into 8199 . . . to get var “whatever_property” as an export var?

SevenEater | 2021-11-01 21:11