123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404 |
- :github_url: hide
- .. DO NOT EDIT THIS FILE!!!
- .. Generated automatically from Godot engine sources.
- .. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
- .. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/SceneState.xml.
- .. _class_SceneState:
- SceneState
- ==========
- **Inherits:** :ref:`RefCounted<class_RefCounted>` **<** :ref:`Object<class_Object>`
- Provides access to a scene file's information.
- .. rst-class:: classref-introduction-group
- Description
- -----------
- 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 :ref:`PackedScene<class_PackedScene>` contains without instantiating it.
- This class cannot be instantiated directly, it is retrieved for a given scene as the result of :ref:`PackedScene.get_state<class_PackedScene_method_get_state>`.
- .. rst-class:: classref-reftable-group
- Methods
- -------
- .. table::
- :widths: auto
- +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`Array<class_Array>` | :ref:`get_connection_binds<class_SceneState_method_get_connection_binds>`\ (\ idx\: :ref:`int<class_int>`\ ) |const| |
- +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`int<class_int>` | :ref:`get_connection_count<class_SceneState_method_get_connection_count>`\ (\ ) |const| |
- +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`int<class_int>` | :ref:`get_connection_flags<class_SceneState_method_get_connection_flags>`\ (\ idx\: :ref:`int<class_int>`\ ) |const| |
- +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`StringName<class_StringName>` | :ref:`get_connection_method<class_SceneState_method_get_connection_method>`\ (\ idx\: :ref:`int<class_int>`\ ) |const| |
- +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`StringName<class_StringName>` | :ref:`get_connection_signal<class_SceneState_method_get_connection_signal>`\ (\ idx\: :ref:`int<class_int>`\ ) |const| |
- +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`NodePath<class_NodePath>` | :ref:`get_connection_source<class_SceneState_method_get_connection_source>`\ (\ idx\: :ref:`int<class_int>`\ ) |const| |
- +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`NodePath<class_NodePath>` | :ref:`get_connection_target<class_SceneState_method_get_connection_target>`\ (\ idx\: :ref:`int<class_int>`\ ) |const| |
- +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`int<class_int>` | :ref:`get_connection_unbinds<class_SceneState_method_get_connection_unbinds>`\ (\ idx\: :ref:`int<class_int>`\ ) |const| |
- +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`int<class_int>` | :ref:`get_node_count<class_SceneState_method_get_node_count>`\ (\ ) |const| |
- +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`PackedStringArray<class_PackedStringArray>` | :ref:`get_node_groups<class_SceneState_method_get_node_groups>`\ (\ idx\: :ref:`int<class_int>`\ ) |const| |
- +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`int<class_int>` | :ref:`get_node_index<class_SceneState_method_get_node_index>`\ (\ idx\: :ref:`int<class_int>`\ ) |const| |
- +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`PackedScene<class_PackedScene>` | :ref:`get_node_instance<class_SceneState_method_get_node_instance>`\ (\ idx\: :ref:`int<class_int>`\ ) |const| |
- +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`String<class_String>` | :ref:`get_node_instance_placeholder<class_SceneState_method_get_node_instance_placeholder>`\ (\ idx\: :ref:`int<class_int>`\ ) |const| |
- +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`StringName<class_StringName>` | :ref:`get_node_name<class_SceneState_method_get_node_name>`\ (\ idx\: :ref:`int<class_int>`\ ) |const| |
- +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`NodePath<class_NodePath>` | :ref:`get_node_owner_path<class_SceneState_method_get_node_owner_path>`\ (\ idx\: :ref:`int<class_int>`\ ) |const| |
- +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`NodePath<class_NodePath>` | :ref:`get_node_path<class_SceneState_method_get_node_path>`\ (\ idx\: :ref:`int<class_int>`, for_parent\: :ref:`bool<class_bool>` = false\ ) |const| |
- +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`int<class_int>` | :ref:`get_node_property_count<class_SceneState_method_get_node_property_count>`\ (\ idx\: :ref:`int<class_int>`\ ) |const| |
- +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`StringName<class_StringName>` | :ref:`get_node_property_name<class_SceneState_method_get_node_property_name>`\ (\ idx\: :ref:`int<class_int>`, prop_idx\: :ref:`int<class_int>`\ ) |const| |
- +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`Variant<class_Variant>` | :ref:`get_node_property_value<class_SceneState_method_get_node_property_value>`\ (\ idx\: :ref:`int<class_int>`, prop_idx\: :ref:`int<class_int>`\ ) |const| |
- +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`StringName<class_StringName>` | :ref:`get_node_type<class_SceneState_method_get_node_type>`\ (\ idx\: :ref:`int<class_int>`\ ) |const| |
- +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`bool<class_bool>` | :ref:`is_node_instance_placeholder<class_SceneState_method_is_node_instance_placeholder>`\ (\ idx\: :ref:`int<class_int>`\ ) |const| |
- +---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------+
- .. rst-class:: classref-section-separator
- ----
- .. rst-class:: classref-descriptions-group
- Enumerations
- ------------
- .. _enum_SceneState_GenEditState:
- .. rst-class:: classref-enumeration
- enum **GenEditState**: :ref:`🔗<enum_SceneState_GenEditState>`
- .. _class_SceneState_constant_GEN_EDIT_STATE_DISABLED:
- .. rst-class:: classref-enumeration-constant
- :ref:`GenEditState<enum_SceneState_GenEditState>` **GEN_EDIT_STATE_DISABLED** = ``0``
- If passed to :ref:`PackedScene.instantiate<class_PackedScene_method_instantiate>`, blocks edits to the scene state.
- .. _class_SceneState_constant_GEN_EDIT_STATE_INSTANCE:
- .. rst-class:: classref-enumeration-constant
- :ref:`GenEditState<enum_SceneState_GenEditState>` **GEN_EDIT_STATE_INSTANCE** = ``1``
- If passed to :ref:`PackedScene.instantiate<class_PackedScene_method_instantiate>`, provides inherited scene resources to the local scene.
- \ **Note:** Only available in editor builds.
- .. _class_SceneState_constant_GEN_EDIT_STATE_MAIN:
- .. rst-class:: classref-enumeration-constant
- :ref:`GenEditState<enum_SceneState_GenEditState>` **GEN_EDIT_STATE_MAIN** = ``2``
- If passed to :ref:`PackedScene.instantiate<class_PackedScene_method_instantiate>`, provides local scene resources to the local scene. Only the main scene should receive the main edit state.
- \ **Note:** Only available in editor builds.
- .. _class_SceneState_constant_GEN_EDIT_STATE_MAIN_INHERITED:
- .. rst-class:: classref-enumeration-constant
- :ref:`GenEditState<enum_SceneState_GenEditState>` **GEN_EDIT_STATE_MAIN_INHERITED** = ``3``
- If passed to :ref:`PackedScene.instantiate<class_PackedScene_method_instantiate>`, it's similar to :ref:`GEN_EDIT_STATE_MAIN<class_SceneState_constant_GEN_EDIT_STATE_MAIN>`, but for the case where the scene is being instantiated to be the base of another one.
- \ **Note:** Only available in editor builds.
- .. rst-class:: classref-section-separator
- ----
- .. rst-class:: classref-descriptions-group
- Method Descriptions
- -------------------
- .. _class_SceneState_method_get_connection_binds:
- .. rst-class:: classref-method
- :ref:`Array<class_Array>` **get_connection_binds**\ (\ idx\: :ref:`int<class_int>`\ ) |const| :ref:`🔗<class_SceneState_method_get_connection_binds>`
- Returns the list of bound parameters for the signal at ``idx``.
- .. rst-class:: classref-item-separator
- ----
- .. _class_SceneState_method_get_connection_count:
- .. rst-class:: classref-method
- :ref:`int<class_int>` **get_connection_count**\ (\ ) |const| :ref:`🔗<class_SceneState_method_get_connection_count>`
- 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]``.
- .. rst-class:: classref-item-separator
- ----
- .. _class_SceneState_method_get_connection_flags:
- .. rst-class:: classref-method
- :ref:`int<class_int>` **get_connection_flags**\ (\ idx\: :ref:`int<class_int>`\ ) |const| :ref:`🔗<class_SceneState_method_get_connection_flags>`
- Returns the connection flags for the signal at ``idx``. See :ref:`ConnectFlags<enum_Object_ConnectFlags>` constants.
- .. rst-class:: classref-item-separator
- ----
- .. _class_SceneState_method_get_connection_method:
- .. rst-class:: classref-method
- :ref:`StringName<class_StringName>` **get_connection_method**\ (\ idx\: :ref:`int<class_int>`\ ) |const| :ref:`🔗<class_SceneState_method_get_connection_method>`
- Returns the method connected to the signal at ``idx``.
- .. rst-class:: classref-item-separator
- ----
- .. _class_SceneState_method_get_connection_signal:
- .. rst-class:: classref-method
- :ref:`StringName<class_StringName>` **get_connection_signal**\ (\ idx\: :ref:`int<class_int>`\ ) |const| :ref:`🔗<class_SceneState_method_get_connection_signal>`
- Returns the name of the signal at ``idx``.
- .. rst-class:: classref-item-separator
- ----
- .. _class_SceneState_method_get_connection_source:
- .. rst-class:: classref-method
- :ref:`NodePath<class_NodePath>` **get_connection_source**\ (\ idx\: :ref:`int<class_int>`\ ) |const| :ref:`🔗<class_SceneState_method_get_connection_source>`
- Returns the path to the node that owns the signal at ``idx``, relative to the root node.
- .. rst-class:: classref-item-separator
- ----
- .. _class_SceneState_method_get_connection_target:
- .. rst-class:: classref-method
- :ref:`NodePath<class_NodePath>` **get_connection_target**\ (\ idx\: :ref:`int<class_int>`\ ) |const| :ref:`🔗<class_SceneState_method_get_connection_target>`
- Returns the path to the node that owns the method connected to the signal at ``idx``, relative to the root node.
- .. rst-class:: classref-item-separator
- ----
- .. _class_SceneState_method_get_connection_unbinds:
- .. rst-class:: classref-method
- :ref:`int<class_int>` **get_connection_unbinds**\ (\ idx\: :ref:`int<class_int>`\ ) |const| :ref:`🔗<class_SceneState_method_get_connection_unbinds>`
- Returns the number of unbound parameters for the signal at ``idx``.
- .. rst-class:: classref-item-separator
- ----
- .. _class_SceneState_method_get_node_count:
- .. rst-class:: classref-method
- :ref:`int<class_int>` **get_node_count**\ (\ ) |const| :ref:`🔗<class_SceneState_method_get_node_count>`
- 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]``.
- .. rst-class:: classref-item-separator
- ----
- .. _class_SceneState_method_get_node_groups:
- .. rst-class:: classref-method
- :ref:`PackedStringArray<class_PackedStringArray>` **get_node_groups**\ (\ idx\: :ref:`int<class_int>`\ ) |const| :ref:`🔗<class_SceneState_method_get_node_groups>`
- Returns the list of group names associated with the node at ``idx``.
- .. rst-class:: classref-item-separator
- ----
- .. _class_SceneState_method_get_node_index:
- .. rst-class:: classref-method
- :ref:`int<class_int>` **get_node_index**\ (\ idx\: :ref:`int<class_int>`\ ) |const| :ref:`🔗<class_SceneState_method_get_node_index>`
- 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.
- .. rst-class:: classref-item-separator
- ----
- .. _class_SceneState_method_get_node_instance:
- .. rst-class:: classref-method
- :ref:`PackedScene<class_PackedScene>` **get_node_instance**\ (\ idx\: :ref:`int<class_int>`\ ) |const| :ref:`🔗<class_SceneState_method_get_node_instance>`
- Returns a :ref:`PackedScene<class_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.
- .. rst-class:: classref-item-separator
- ----
- .. _class_SceneState_method_get_node_instance_placeholder:
- .. rst-class:: classref-method
- :ref:`String<class_String>` **get_node_instance_placeholder**\ (\ idx\: :ref:`int<class_int>`\ ) |const| :ref:`🔗<class_SceneState_method_get_node_instance_placeholder>`
- Returns the path to the represented scene file if the node at ``idx`` is an :ref:`InstancePlaceholder<class_InstancePlaceholder>`.
- .. rst-class:: classref-item-separator
- ----
- .. _class_SceneState_method_get_node_name:
- .. rst-class:: classref-method
- :ref:`StringName<class_StringName>` **get_node_name**\ (\ idx\: :ref:`int<class_int>`\ ) |const| :ref:`🔗<class_SceneState_method_get_node_name>`
- Returns the name of the node at ``idx``.
- .. rst-class:: classref-item-separator
- ----
- .. _class_SceneState_method_get_node_owner_path:
- .. rst-class:: classref-method
- :ref:`NodePath<class_NodePath>` **get_node_owner_path**\ (\ idx\: :ref:`int<class_int>`\ ) |const| :ref:`🔗<class_SceneState_method_get_node_owner_path>`
- Returns the path to the owner of the node at ``idx``, relative to the root node.
- .. rst-class:: classref-item-separator
- ----
- .. _class_SceneState_method_get_node_path:
- .. rst-class:: classref-method
- :ref:`NodePath<class_NodePath>` **get_node_path**\ (\ idx\: :ref:`int<class_int>`, for_parent\: :ref:`bool<class_bool>` = false\ ) |const| :ref:`🔗<class_SceneState_method_get_node_path>`
- Returns the path to the node at ``idx``.
- If ``for_parent`` is ``true``, returns the path of the ``idx`` node's parent instead.
- .. rst-class:: classref-item-separator
- ----
- .. _class_SceneState_method_get_node_property_count:
- .. rst-class:: classref-method
- :ref:`int<class_int>` **get_node_property_count**\ (\ idx\: :ref:`int<class_int>`\ ) |const| :ref:`🔗<class_SceneState_method_get_node_property_count>`
- 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]``.
- .. rst-class:: classref-item-separator
- ----
- .. _class_SceneState_method_get_node_property_name:
- .. rst-class:: classref-method
- :ref:`StringName<class_StringName>` **get_node_property_name**\ (\ idx\: :ref:`int<class_int>`, prop_idx\: :ref:`int<class_int>`\ ) |const| :ref:`🔗<class_SceneState_method_get_node_property_name>`
- Returns the name of the property at ``prop_idx`` for the node at ``idx``.
- .. rst-class:: classref-item-separator
- ----
- .. _class_SceneState_method_get_node_property_value:
- .. rst-class:: classref-method
- :ref:`Variant<class_Variant>` **get_node_property_value**\ (\ idx\: :ref:`int<class_int>`, prop_idx\: :ref:`int<class_int>`\ ) |const| :ref:`🔗<class_SceneState_method_get_node_property_value>`
- Returns the value of the property at ``prop_idx`` for the node at ``idx``.
- .. rst-class:: classref-item-separator
- ----
- .. _class_SceneState_method_get_node_type:
- .. rst-class:: classref-method
- :ref:`StringName<class_StringName>` **get_node_type**\ (\ idx\: :ref:`int<class_int>`\ ) |const| :ref:`🔗<class_SceneState_method_get_node_type>`
- Returns the type of the node at ``idx``.
- .. rst-class:: classref-item-separator
- ----
- .. _class_SceneState_method_is_node_instance_placeholder:
- .. rst-class:: classref-method
- :ref:`bool<class_bool>` **is_node_instance_placeholder**\ (\ idx\: :ref:`int<class_int>`\ ) |const| :ref:`🔗<class_SceneState_method_is_node_instance_placeholder>`
- Returns ``true`` if the node at ``idx`` is an :ref:`InstancePlaceholder<class_InstancePlaceholder>`.
- .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
- .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
- .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
- .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
- .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
- .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`
- .. |bitfield| replace:: :abbr:`BitField (This value is an integer composed as a bitmask of the following flags.)`
- .. |void| replace:: :abbr:`void (No return value.)`
|