Skip to content

Resource sometimes running code in editor without @tool annotation #104398

Open
@GivenFlesh

Description

@GivenFlesh

Tested versions

Reproducible in 4.4

System information

Windows 10

Issue description

If a resource without the @tool annotation is created from within a resource that has the @tool annotation, such as with a setter that autofills array entries, any script inside of the created resource will run even if it does not have the @tool annotation.

Steps to reproduce

  • Create two resource scripts
  • Give one the @tool annotation
  • Give them both a class name
  • In the @tool enabled resource, create an export variable that contains an array
  • Create a setter for that variable that fills 'null' values with new copies of the other resource
  • In the other resource, create an export variable with a setter of any kind. For ease of testing, a boolean that = true, and setting it always makes the value true
  • Create a new resource of the @tool annotated resource.
  • Increase the size of the array. If a new copy of the second resource does not automatically fill, reload the project.
  • Attempt to turn the variable of the new resource to false.

This does not apply to copies created manually, either through 'new resource' or right clicking in the file dock, only resources created through script in an @tool annotated script.

Minimal reproduction project (MRP)

MRP.zip

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions