Skip to content

Include a SceneTreeCodeGenerator? #6

@coderbloke

Description

@coderbloke
  • The class code skeleton should come from a template
  • There should the a Resource type, where user can pull in a scene (.tscn)
    But from code this can be an already instantiated scene tree also.
    In the background, the tscn will be instantiated also. (If there is no other way around.)
  • How to solve properties? The property name is not the same as the variable name.
    Property list can be asked with get_property_info + get.
    Should simply set to be used in the generated code?
    It would be nice, to substitute that with direct variable setting, or using set_xxx function if there is no variable (or chosen so by user)
    It's good as theme overrides and metadata also listed as properties by get_property_info.
  • Problem: How to solve signal connections? They cannot be recovered from the instantiated scene tree.
  • Problem: What to do with nodes, which are generated by script? Those will be present in the instantiated tree (if user did not added them as INTERNAL)
  • No problem: See SceneState
  • Should be set if root to be set owner, in addition to add_child. But is it for the whole tree? Or by node?
  • Most below thing shall be in the inspector in the resource
    • Output file path. Generation can be automatic on change (checkbox) or by request (button)
    • The node of the scene should be in a TreeView
    • For each node: To be able to choose if they should be accessible in a variable (or no need)
      This selection could be some checkbox (or more intuitive) in the tree view. (For a checkbox user could thing, it for exclusion.)
      but rather just an indication (e.g. %, like for the unique names)
    • Below the tree view there should be a list of setting for the node
      • There should be an automatically generated variable name for each node, but could be overridden by the user.
        Could be a drop down for 3 options: no variable name, auto variable name, overridden variable name
        Input field for manual name, could visible only for the option.
        But there should be a read-only text edit for the auto-name option also.
      • Another option: Whether the initialization of the node should be in a separate function.
        Again: no function, auto-named, manually named
  • The generator should be able to generate into an existing script without changing the user's code.
    For this, this generator feature is needed:

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    Status

    Idea

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions