class_editorfilesystem.rst 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258
  1. :github_url: hide
  2. .. DO NOT EDIT THIS FILE!!!
  3. .. Generated automatically from Godot engine sources.
  4. .. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
  5. .. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/EditorFileSystem.xml.
  6. .. _class_EditorFileSystem:
  7. EditorFileSystem
  8. ================
  9. **Inherits:** :ref:`Node<class_Node>` **<** :ref:`Object<class_Object>`
  10. Resource filesystem, as the editor sees it.
  11. .. rst-class:: classref-introduction-group
  12. Description
  13. -----------
  14. This object holds information of all resources in the filesystem, their types, etc.
  15. \ **Note:** This class shouldn't be instantiated directly. Instead, access the singleton using :ref:`EditorInterface.get_resource_filesystem<class_EditorInterface_method_get_resource_filesystem>`.
  16. .. rst-class:: classref-reftable-group
  17. Methods
  18. -------
  19. .. table::
  20. :widths: auto
  21. +-------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------+
  22. | :ref:`String<class_String>` | :ref:`get_file_type<class_EditorFileSystem_method_get_file_type>`\ (\ path\: :ref:`String<class_String>`\ ) |const| |
  23. +-------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------+
  24. | :ref:`EditorFileSystemDirectory<class_EditorFileSystemDirectory>` | :ref:`get_filesystem<class_EditorFileSystem_method_get_filesystem>`\ (\ ) |
  25. +-------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------+
  26. | :ref:`EditorFileSystemDirectory<class_EditorFileSystemDirectory>` | :ref:`get_filesystem_path<class_EditorFileSystem_method_get_filesystem_path>`\ (\ path\: :ref:`String<class_String>`\ ) |
  27. +-------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------+
  28. | :ref:`float<class_float>` | :ref:`get_scanning_progress<class_EditorFileSystem_method_get_scanning_progress>`\ (\ ) |const| |
  29. +-------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------+
  30. | :ref:`bool<class_bool>` | :ref:`is_scanning<class_EditorFileSystem_method_is_scanning>`\ (\ ) |const| |
  31. +-------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------+
  32. | |void| | :ref:`reimport_files<class_EditorFileSystem_method_reimport_files>`\ (\ files\: :ref:`PackedStringArray<class_PackedStringArray>`\ ) |
  33. +-------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------+
  34. | |void| | :ref:`scan<class_EditorFileSystem_method_scan>`\ (\ ) |
  35. +-------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------+
  36. | |void| | :ref:`scan_sources<class_EditorFileSystem_method_scan_sources>`\ (\ ) |
  37. +-------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------+
  38. | |void| | :ref:`update_file<class_EditorFileSystem_method_update_file>`\ (\ path\: :ref:`String<class_String>`\ ) |
  39. +-------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------+
  40. .. rst-class:: classref-section-separator
  41. ----
  42. .. rst-class:: classref-descriptions-group
  43. Signals
  44. -------
  45. .. _class_EditorFileSystem_signal_filesystem_changed:
  46. .. rst-class:: classref-signal
  47. **filesystem_changed**\ (\ ) :ref:`🔗<class_EditorFileSystem_signal_filesystem_changed>`
  48. Emitted if the filesystem changed.
  49. .. rst-class:: classref-item-separator
  50. ----
  51. .. _class_EditorFileSystem_signal_resources_reimported:
  52. .. rst-class:: classref-signal
  53. **resources_reimported**\ (\ resources\: :ref:`PackedStringArray<class_PackedStringArray>`\ ) :ref:`🔗<class_EditorFileSystem_signal_resources_reimported>`
  54. Emitted if a resource is reimported.
  55. .. rst-class:: classref-item-separator
  56. ----
  57. .. _class_EditorFileSystem_signal_resources_reimporting:
  58. .. rst-class:: classref-signal
  59. **resources_reimporting**\ (\ resources\: :ref:`PackedStringArray<class_PackedStringArray>`\ ) :ref:`🔗<class_EditorFileSystem_signal_resources_reimporting>`
  60. Emitted before a resource is reimported.
  61. .. rst-class:: classref-item-separator
  62. ----
  63. .. _class_EditorFileSystem_signal_resources_reload:
  64. .. rst-class:: classref-signal
  65. **resources_reload**\ (\ resources\: :ref:`PackedStringArray<class_PackedStringArray>`\ ) :ref:`🔗<class_EditorFileSystem_signal_resources_reload>`
  66. Emitted if at least one resource is reloaded when the filesystem is scanned.
  67. .. rst-class:: classref-item-separator
  68. ----
  69. .. _class_EditorFileSystem_signal_script_classes_updated:
  70. .. rst-class:: classref-signal
  71. **script_classes_updated**\ (\ ) :ref:`🔗<class_EditorFileSystem_signal_script_classes_updated>`
  72. Emitted when the list of global script classes gets updated.
  73. .. rst-class:: classref-item-separator
  74. ----
  75. .. _class_EditorFileSystem_signal_sources_changed:
  76. .. rst-class:: classref-signal
  77. **sources_changed**\ (\ exist\: :ref:`bool<class_bool>`\ ) :ref:`🔗<class_EditorFileSystem_signal_sources_changed>`
  78. Emitted if the source of any imported file changed.
  79. .. rst-class:: classref-section-separator
  80. ----
  81. .. rst-class:: classref-descriptions-group
  82. Method Descriptions
  83. -------------------
  84. .. _class_EditorFileSystem_method_get_file_type:
  85. .. rst-class:: classref-method
  86. :ref:`String<class_String>` **get_file_type**\ (\ path\: :ref:`String<class_String>`\ ) |const| :ref:`🔗<class_EditorFileSystem_method_get_file_type>`
  87. Returns the resource type of the file, given the full path. This returns a string such as ``"Resource"`` or ``"GDScript"``, *not* a file extension such as ``".gd"``.
  88. .. rst-class:: classref-item-separator
  89. ----
  90. .. _class_EditorFileSystem_method_get_filesystem:
  91. .. rst-class:: classref-method
  92. :ref:`EditorFileSystemDirectory<class_EditorFileSystemDirectory>` **get_filesystem**\ (\ ) :ref:`🔗<class_EditorFileSystem_method_get_filesystem>`
  93. Gets the root directory object.
  94. .. rst-class:: classref-item-separator
  95. ----
  96. .. _class_EditorFileSystem_method_get_filesystem_path:
  97. .. rst-class:: classref-method
  98. :ref:`EditorFileSystemDirectory<class_EditorFileSystemDirectory>` **get_filesystem_path**\ (\ path\: :ref:`String<class_String>`\ ) :ref:`🔗<class_EditorFileSystem_method_get_filesystem_path>`
  99. Returns a view into the filesystem at ``path``.
  100. .. rst-class:: classref-item-separator
  101. ----
  102. .. _class_EditorFileSystem_method_get_scanning_progress:
  103. .. rst-class:: classref-method
  104. :ref:`float<class_float>` **get_scanning_progress**\ (\ ) |const| :ref:`🔗<class_EditorFileSystem_method_get_scanning_progress>`
  105. Returns the scan progress for 0 to 1 if the FS is being scanned.
  106. .. rst-class:: classref-item-separator
  107. ----
  108. .. _class_EditorFileSystem_method_is_scanning:
  109. .. rst-class:: classref-method
  110. :ref:`bool<class_bool>` **is_scanning**\ (\ ) |const| :ref:`🔗<class_EditorFileSystem_method_is_scanning>`
  111. Returns ``true`` if the filesystem is being scanned.
  112. .. rst-class:: classref-item-separator
  113. ----
  114. .. _class_EditorFileSystem_method_reimport_files:
  115. .. rst-class:: classref-method
  116. |void| **reimport_files**\ (\ files\: :ref:`PackedStringArray<class_PackedStringArray>`\ ) :ref:`🔗<class_EditorFileSystem_method_reimport_files>`
  117. Reimports a set of files. Call this if these files or their ``.import`` files were directly edited by script or an external program.
  118. If the file type changed or the file was newly created, use :ref:`update_file<class_EditorFileSystem_method_update_file>` or :ref:`scan<class_EditorFileSystem_method_scan>`.
  119. \ **Note:** This function blocks until the import is finished. However, the main loop iteration, including timers and :ref:`Node._process<class_Node_private_method__process>`, will occur during the import process due to progress bar updates. Avoid calls to :ref:`reimport_files<class_EditorFileSystem_method_reimport_files>` or :ref:`scan<class_EditorFileSystem_method_scan>` while an import is in progress.
  120. .. rst-class:: classref-item-separator
  121. ----
  122. .. _class_EditorFileSystem_method_scan:
  123. .. rst-class:: classref-method
  124. |void| **scan**\ (\ ) :ref:`🔗<class_EditorFileSystem_method_scan>`
  125. Scan the filesystem for changes.
  126. .. rst-class:: classref-item-separator
  127. ----
  128. .. _class_EditorFileSystem_method_scan_sources:
  129. .. rst-class:: classref-method
  130. |void| **scan_sources**\ (\ ) :ref:`🔗<class_EditorFileSystem_method_scan_sources>`
  131. Check if the source of any imported resource changed.
  132. .. rst-class:: classref-item-separator
  133. ----
  134. .. _class_EditorFileSystem_method_update_file:
  135. .. rst-class:: classref-method
  136. |void| **update_file**\ (\ path\: :ref:`String<class_String>`\ ) :ref:`🔗<class_EditorFileSystem_method_update_file>`
  137. Add a file in an existing directory, or schedule file information to be updated on editor restart. Can be used to update text files saved by an external program.
  138. This will not import the file. To reimport, call :ref:`reimport_files<class_EditorFileSystem_method_reimport_files>` or :ref:`scan<class_EditorFileSystem_method_scan>` methods.
  139. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  140. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  141. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  142. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  143. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  144. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`
  145. .. |bitfield| replace:: :abbr:`BitField (This value is an integer composed as a bitmask of the following flags.)`
  146. .. |void| replace:: :abbr:`void (No return value.)`