A script interface to a scene file's data.
    public abstract class SceneState : Reference

Maintains a list of resources, nodes, exported, and overridden properties, and built-in scripts associated with a scene.

This class cannot be instantiated directly, it is retrieved for a given scene as the result of PackedScene.GetState().

Inheritance Chain

Methods

    public Godot.Collections.Array GetConnectionBinds(int idx)

Returns the list of bound parameters for the signal at idx.

    public int GetConnectionCount()

Returns the number of signal connections in the scene.

The idx argument used to query connection metadata in other get_connection_* methods in the interval [0, get_connection_count() - 1].

    public int GetConnectionFlags(int idx)

Returns the connection flags for the signal at idx. See Object.ConnectFlags constants.

    public string GetConnectionMethod(int idx)

Returns the method connected to the signal at idx.

    public string GetConnectionSignal(int idx)

Returns the name of the signal at idx.

    public NodePath GetConnectionSource(int idx)

Returns the path to the node that owns the signal at idx, relative to the root node.

    public NodePath GetConnectionTarget(int idx)

Returns the path to the node that owns the method connected to the signal at idx, relative to the root node.

    public int GetNodeCount()

Returns the number of nodes in the scene.

The idx argument used to query node data in other get_node_* methods in the interval [0, get_node_count() - 1].

    public string[] GetNodeGroups(int idx)

Returns the list of group names associated with the node at idx.

    public int GetNodeIndex(int idx)

Returns the node’s index, which is its position relative to its siblings. This is only relevant and saved in scenes for cases where new nodes are added to an instanced or inherited scene among siblings from the base scene. Despite the name, this index is not related to the idx argument used here and in other methods.

    public PackedScene GetNodeInstance(int idx)

Returns a PackedScene for the node at idx (i.e. the whole branch starting at this node, with its child nodes and resources), or null if the node is not an instance.

    public string GetNodeInstancePlaceholder(int idx)

Returns the path to the represented scene file if the node at idx is an InstancePlaceholder.

    public string GetNodeName(int idx)

Returns the name of the node at idx.

    public NodePath GetNodeOwnerPath(int idx)

Returns the path to the owner of the node at idx, relative to the root node.

    public NodePath GetNodePath(int idx, bool forParent = false)

Returns the path to the node at idx.

If forParent is true, returns the path of the idx node’s parent instead.

    public int GetNodePropertyCount(int idx)

Returns the number of exported or overridden properties for the node at idx.

The prop_idx argument used to query node property data in other get_node_property_* methods in the interval [0, get_node_property_count() - 1].

    public string GetNodePropertyName(int idx, int propIdx)

Returns the name of the property at propIdx for the node at idx.

    public object GetNodePropertyValue(int idx, int propIdx)

Returns the value of the property at propIdx for the node at idx.

    public string GetNodeType(int idx)

Returns the type of the node at idx.

    public bool IsNodeInstancePlaceholder(int idx)

Returns true if the node at idx is an InstancePlaceholder.

Inner Types

GenEditState

Name Value Description
Disabled 0 If passed to [method PackedScene.instance], blocks edits to the scene state.
Instance 1 If passed to [method PackedScene.instance], provides inherited scene resources to the local scene.
[b]Note:[/b] Only available in editor builds.    
Main 2 If passed to [method PackedScene.instance], provides local scene resources to the local scene. Only the main scene should receive the main edit state.
[b]Note:[/b] Only available in editor builds.    
Tags: