Skip to content

Property Usage flags for properties in non-@tool scripts differs in Editor from @tool or a running program #108068

Open
@TemporalCatcher

Description

@TemporalCatcher

Tested versions

Reproducible in: 4.0.stable, 4.4.1.stable, 4.5.beta1

System information

W11

Issue description

I will preface it with this:
To me, it feels like a bug, but I may have fundamentally misunderstood how properties should work when in the editor; especially since the way it currently works is how it worked since 4.0.

When I call get_property_list(), I want to separate script variables using PROPERTY_USAGE_SCRIPT_VARIABLE flag in the editor. The way I do this is have a @tool Node that saves a Resource as a variable and call resource.get_property_list(). The thing is, when the resource in question is not a @tool, the property is missing the PROPERTY_USAGE_SCRIPT_VARIABLE flag, even when the property has an @export annotation.

My expectation is that script variables would always have the PROPERTY_USAGE_SCRIPT_VARIABLE flag on, regardless of if it's a tool or not; they definitely have it when I run the program. I'm more concerned about properties that are exported than those that aren't.

Steps to reproduce

  1. Import MRP and look at Output
  2. Run my_node.tscn and look at Output

How to interpret the Outputs:
I have 2 resource files: tool_resource.gd and toolless_resource.gd
Both are the same other than class_name and one has the @tool annotation. This is why all outputted lists are the same when the program runs.

I made the output a Name->PropertyUsageFlag pair per list item for ease of viewing.
My main concern is that, in the editor, toolless outputs an empty list when filtering the list for those with the PROPERTY_USAGE_SCRIPT_VARIABLE flag. I would have wanted it to be at least [{ "editor_property": 4102 }], but it's not. For some reason editor_property's usage flag is only PROPERTY_USAGE_DEFAULT. I'm not so concerned about internal_property because it's not exported, but I have it in case it's a concern.

Minimal reproduction project (MRP)

script_var_mrp.zip

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    For team assessment

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions