Class SceneState
Provides access to a scene file's information.
- Inheritance
-
SceneState
Remarks
Maintains a list of resources, nodes, exported and overridden properties, and built-in scripts associated with a scene. They cannot be modified from a SceneState, only accessed. Useful for peeking into what a PackedScene contains without instantiating it.
This class cannot be instantiated directly, it is retrieved for a given scene as the result of get_state.
Methods
get_connection_binds(int)
Qualifiers: const
Returns the list of bound parameters for the signal at idx
.
Array get_connection_binds(int idx)
Parameters
idx
int
get_connection_count
Qualifiers: const
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]
.
int get_connection_count
get_connection_flags(int)
Qualifiers: const
Returns the connection flags for the signal at idx
. See ConnectFlags constants.
int get_connection_flags(int idx)
Parameters
idx
int
get_connection_method(int)
Qualifiers: const
Returns the method connected to the signal at idx
.
StringName get_connection_method(int idx)
Parameters
idx
int
get_connection_signal(int)
Qualifiers: const
Returns the name of the signal at idx
.
StringName get_connection_signal(int idx)
Parameters
idx
int
get_connection_source(int)
Qualifiers: const
Returns the path to the node that owns the signal at idx
, relative to the root node.
NodePath get_connection_source(int idx)
Parameters
idx
int
get_connection_target(int)
Qualifiers: const
Returns the path to the node that owns the method connected to the signal at idx
, relative to the root node.
NodePath get_connection_target(int idx)
Parameters
idx
int
get_connection_unbinds(int)
Qualifiers: const
Returns the number of unbound parameters for the signal at idx
.
int get_connection_unbinds(int idx)
Parameters
idx
int
get_node_count
Qualifiers: const
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]
.
int get_node_count
get_node_groups(int)
Qualifiers: const
Returns the list of group names associated with the node at idx
.
PackedStringArray get_node_groups(int idx)
Parameters
idx
int
get_node_index(int)
Qualifiers: const
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 instantiated 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.
int get_node_index(int idx)
Parameters
idx
int
get_node_instance(int)
Qualifiers: const
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.
PackedScene get_node_instance(int idx)
Parameters
idx
int
get_node_instance_placeholder(int)
Qualifiers: const
Returns the path to the represented scene file if the node at idx
is an InstancePlaceholder.
String get_node_instance_placeholder(int idx)
Parameters
idx
int
get_node_name(int)
Qualifiers: const
Returns the name of the node at idx
.
StringName get_node_name(int idx)
Parameters
idx
int
get_node_owner_path(int)
Qualifiers: const
Returns the path to the owner of the node at idx
, relative to the root node.
NodePath get_node_owner_path(int idx)
Parameters
idx
int
get_node_path(int, bool)
Qualifiers: const
Returns the path to the node at idx
.
If for_parent
is true
, returns the path of the idx
node's parent instead.
NodePath get_node_path(int idx, bool for_parent)
Parameters
get_node_property_count(int)
Qualifiers: const
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]
.
int get_node_property_count(int idx)
Parameters
idx
int
get_node_property_name(int, int)
Qualifiers: const
Returns the name of the property at prop_idx
for the node at idx
.
StringName get_node_property_name(int idx, int prop_idx)
Parameters
get_node_property_value(int, int)
Qualifiers: const
Returns the value of the property at prop_idx
for the node at idx
.
Variant get_node_property_value(int idx, int prop_idx)
Parameters
get_node_type(int)
Qualifiers: const
Returns the type of the node at idx
.
StringName get_node_type(int idx)
Parameters
idx
int
is_node_instance_placeholder(int)
Qualifiers: const
Returns true
if the node at idx
is an InstancePlaceholder.
bool is_node_instance_placeholder(int idx)
Parameters
idx
int