Skip to content

Commit

Permalink
Merge branch 'master' into update_pre-commit
Browse files Browse the repository at this point in the history
  • Loading branch information
kaixin-hc committed Apr 14, 2024
2 parents 74ae4d7 + 08f4be3 commit 8b781d3
Show file tree
Hide file tree
Showing 401 changed files with 9,376 additions and 3,431 deletions.
19 changes: 8 additions & 11 deletions about/faq.rst
Original file line number Diff line number Diff line change
Expand Up @@ -275,26 +275,23 @@ data directory. This is usually a good approach, but this means configuration fi
will not carry across machines if you copy the folder containing the Godot executable.
See :ref:`doc_data_paths` for more information.

If *true* portable operation is desired (e.g. for use on an USB stick),
If *true* portable operation is desired (e.g. for use on a USB stick),
follow the steps in :ref:`doc_data_paths_self_contained_mode`.

Why does Godot use Vulkan or OpenGL instead of Direct3D?
--------------------------------------------------------
Why does Godot prioritize Vulkan and OpenGL over Direct3D?
----------------------------------------------------------

Godot aims for cross-platform compatibility and open standards first and
foremost. OpenGL and Vulkan are the technologies that are both open and
available on (nearly) all platforms. Thanks to this design decision, a project
developed with Godot on Windows will run out of the box on Linux, macOS, and
more.

Since Godot only has a few people working on its renderer, we would prefer
having fewer rendering backends to maintain. On top of that, using a single API
on all platforms allows for greater consistency with fewer platform-specific
issues.

In the long term, we may develop a Direct3D 12 renderer for Godot (mainly for
Xbox), but Vulkan and OpenGL will remain the default rendering
backends on all platforms, including Windows.
While Vulkan and OpenGL remain our primary focus for their open standard and
cross-platform benefits, Godot 4.3 introduced experimental support for Direct3D 12.
This addition aims to enhance performance and compatibility on platforms where
Direct3D 12 is prevalent, such as Windows and Xbox. However, Vulkan and OpenGL
will continue as the default rendering backends on all platforms, including Windows.

Why does Godot aim to keep its core feature set small?
------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion about/list_of_features.rst
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ Rendering
- Does not rely on run-time mesh generation. This means decals can be used on
complex skinned meshes with no performance penalty, even if the decal moves every frame.
- Support for nearest, bilinear, trilinear or anisotropic texture filtering (configured globally).
- Optional distance fade system to fade distant lights and their shadows, improving performance.
- Optional distance fade system to fade distant decals, improving performance.
- When using the Forward+ backend (default on desktop), decals are
rendered with clustered forward optimizations to decrease their individual cost.
Clustered rendering also lifts any limits on the number of decals that can be used on a mesh.
Expand Down
4 changes: 2 additions & 2 deletions about/system_requirements.rst
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ Desktop or laptop PC - Minimum

Vulkan drivers for these Windows versions are known to have issues with
memory leaks. As a result, it's recommended to stick to the Compatibility
rendering method when running Godot on an Windows version older than 10.
rendering method when running Godot on a Windows version older than 10.

Mobile device (smartphone/tablet) - Minimum
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Expand Down Expand Up @@ -252,7 +252,7 @@ Desktop or laptop PC - Minimum

Vulkan drivers for these Windows versions are known to have issues with
memory leaks. As a result, it's recommended to stick to the Compatibility
rendering method when running Godot on an Windows version older than 10.
rendering method when running Godot on a Windows version older than 10.

Mobile device (smartphone/tablet) - Minimum
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Expand Down
24 changes: 16 additions & 8 deletions classes/[email protected]
Original file line number Diff line number Diff line change
Expand Up @@ -788,6 +788,10 @@ The order of ``mode``, ``sync`` and ``transfer_mode`` does not matter, but value

Make a script with static variables to not persist after all references are lost. If the script is loaded again the static variables will revert to their default values.

\ **Note:** As annotations describe their subject, the :ref:`@static_unload<class_@GDScript_annotation_@static_unload>` annotation must be placed before the class definition and inheritance.

\ **Warning:** Currently, due to a bug, scripts are never freed, even if :ref:`@static_unload<class_@GDScript_annotation_@static_unload>` annotation is used.

.. rst-class:: classref-item-separator

----
Expand Down Expand Up @@ -877,6 +881,8 @@ An optional ``message`` can be shown in addition to the generic "Assertion faile
assert(speed >= 0 and speed < 20) # You can also combine the two conditional statements in one check.
assert(speed < 20, "the speed limit is 20") # Show a message.

\ **Note:** :ref:`assert<class_@GDScript_method_assert>` is a keyword, not a function. So you cannot access it as a :ref:`Callable<class_Callable>` or use it inside expressions.

.. rst-class:: classref-item-separator

----
Expand Down Expand Up @@ -955,7 +961,7 @@ Returns an array of dictionaries representing the current call stack. See also :

Starting from ``_ready()``, ``bar()`` would print:

.. code::
.. code:: text
[{function:bar, line:12, source:res://script.gd}, {function:foo, line:9, source:res://script.gd}, {function:_ready, line:6, source:res://script.gd}]
Expand Down Expand Up @@ -987,7 +993,7 @@ Returns the passed ``instance`` converted to a Dictionary. Can be useful for ser

Prints out:

.. code::
.. code:: text
[@subpath, @path, foo]
[, res://test.gd, bar]
Expand All @@ -1010,7 +1016,7 @@ Returns ``true`` if ``value`` is an instance of ``type``. The ``type`` value mus

- A :ref:`Script<class_Script>` (you can use any class, including inner one).

Unlike the right operand of the ``is`` operator, ``type`` can be a non-constant value. The ``is`` operator supports more features (such as typed arrays) and is more performant. Use the operator instead of this method if you do not need dynamic type checking.
Unlike the right operand of the ``is`` operator, ``type`` can be a non-constant value. The ``is`` operator supports more features (such as typed arrays). Use the operator instead of this method if you do not need dynamic type checking.

Examples:

Expand Down Expand Up @@ -1064,7 +1070,7 @@ Returns a :ref:`Resource<class_Resource>` from the filesystem located at the abs
# Load a scene called "main" located in the root of the project directory and cache it in a variable.
var main = load("res://main.tscn") # main will contain a PackedScene resource.

\ **Important:** The path must be absolute. A relative path will always return ``null``.
\ **Important:** Relative paths are *not* relative to the script calling this method, instead it is prefixed with ``"res://"``. Loading from relative paths might not work as expected.

This function is a simplified version of :ref:`ResourceLoader.load<class_ResourceLoader_method_load>`, which can be used for more advanced scenarios.

Expand All @@ -1091,6 +1097,8 @@ Returns a :ref:`Resource<class_Resource>` from the filesystem located at ``path`
# Create instance of a scene.
var diamond = preload("res://diamond.tscn").instantiate()

\ **Note:** :ref:`preload<class_@GDScript_method_preload>` is a keyword, not a function. So you cannot access it as a :ref:`Callable<class_Callable>`.

.. rst-class:: classref-item-separator

----
Expand All @@ -1105,7 +1113,7 @@ Like :ref:`@GlobalScope.print<class_@GlobalScope_method_print>`, but includes th

The output in the console may look like the following:

.. code::
.. code:: text
Test print
At: res://test.gd:15:_process()
Expand All @@ -1126,7 +1134,7 @@ Prints a stack trace at the current code location. See also :ref:`get_stack<clas

The output in the console may look like the following:

.. code::
.. code:: text
Frame 0 - res://test.gd:16 in function '_process'
Expand Down Expand Up @@ -1175,7 +1183,7 @@ To iterate over an :ref:`Array<class_Array>` backwards, use:

Output:

.. code::
.. code:: text
9
6
Expand All @@ -1190,7 +1198,7 @@ To iterate over :ref:`float<class_float>`, convert them in the loop.

Output:

.. code::
.. code:: text
0.3
0.2
Expand Down
18 changes: 10 additions & 8 deletions classes/[email protected]
Original file line number Diff line number Diff line change
Expand Up @@ -5715,7 +5715,7 @@ Converts an angle expressed in degrees to radians.

Returns an "eased" value of ``x`` based on an easing function defined with ``curve``. This easing function is based on an exponent. The ``curve`` can be any floating-point number, with specific values leading to the following behaviors:

::
.. code:: text
- Lower than -1.0 (exclusive): Ease in-out
- 1.0: Linear
Expand Down Expand Up @@ -5856,9 +5856,9 @@ Returns the floating-point modulus of ``x`` divided by ``y``, wrapping equally i
var x = i * 0.5 - 1.5
print("%4.1f %4.1f | %4.1f" % [x, fmod(x, 1.5), fposmod(x, 1.5)])

Produces:
Prints:

::
.. code:: text
(x) (fmod(x, 1.5)) (fposmod(x, 1.5))
-1.5 -0.0 | 0.0
Expand Down Expand Up @@ -6374,9 +6374,9 @@ Returns the integer modulus of ``x`` divided by ``y`` that wraps equally in posi
for i in range(-3, 4):
print("%2d %2d | %2d" % [i, i % 3, posmod(i, 3)])

Produces:
Prints:

::
.. code:: text
(i) (i % 3) (posmod(i, 3))
-3 0 | 0
Expand Down Expand Up @@ -6523,6 +6523,8 @@ Prints one or more arguments to strings in the best way possible to standard err

Prints one or more arguments to strings in the best way possible to the OS terminal. Unlike :ref:`print<class_@GlobalScope_method_print>`, no newline is automatically added at the end.

\ **Note:** The OS terminal is *not* the same as the editor's Output dock. The output sent to the OS terminal can be seen when running Godot from a terminal. On Windows, this requires using the ``console.exe`` executable.


.. tabs::

Expand Down Expand Up @@ -6849,7 +6851,7 @@ For complex use cases where multiple ranges are needed, consider using :ref:`Cur

:ref:`int<class_int>` **rid_allocate_id**\ (\ )

Allocates a unique ID which can be used by the implementation to construct a RID. This is used mainly from native extensions to implement servers.
Allocates a unique ID which can be used by the implementation to construct an RID. This is used mainly from native extensions to implement servers.

.. rst-class:: classref-item-separator

Expand All @@ -6861,7 +6863,7 @@ Allocates a unique ID which can be used by the implementation to construct a RID

:ref:`RID<class_RID>` **rid_from_int64**\ (\ base\: :ref:`int<class_int>`\ )

Creates a RID from a ``base``. This is used mainly from native extensions to build servers.
Creates an RID from a ``base``. This is used mainly from native extensions to build servers.

.. rst-class:: classref-item-separator

Expand Down Expand Up @@ -7396,7 +7398,7 @@ Converts a :ref:`Variant<class_Variant>` ``variable`` to a formatted :ref:`Strin

Prints:

::
.. code:: text
{
"a": 1,
Expand Down
8 changes: 4 additions & 4 deletions classes/class_acceptdialog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,9 @@ Methods
+-----------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Button<class_Button>` | :ref:`get_ok_button<class_AcceptDialog_method_get_ok_button>`\ (\ ) |
+-----------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| |void| | :ref:`register_text_enter<class_AcceptDialog_method_register_text_enter>`\ (\ line_edit\: :ref:`Control<class_Control>`\ ) |
| |void| | :ref:`register_text_enter<class_AcceptDialog_method_register_text_enter>`\ (\ line_edit\: :ref:`LineEdit<class_LineEdit>`\ ) |
+-----------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| |void| | :ref:`remove_button<class_AcceptDialog_method_remove_button>`\ (\ button\: :ref:`Control<class_Control>`\ ) |
| |void| | :ref:`remove_button<class_AcceptDialog_method_remove_button>`\ (\ button\: :ref:`Button<class_Button>`\ ) |
+-----------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+

.. rst-class:: classref-reftable-group
Expand Down Expand Up @@ -295,7 +295,7 @@ Returns the OK :ref:`Button<class_Button>` instance.

.. rst-class:: classref-method

|void| **register_text_enter**\ (\ line_edit\: :ref:`Control<class_Control>`\ )
|void| **register_text_enter**\ (\ line_edit\: :ref:`LineEdit<class_LineEdit>`\ )

Registers a :ref:`LineEdit<class_LineEdit>` in the dialog. When the enter key is pressed, the dialog will be accepted.

Expand All @@ -307,7 +307,7 @@ Registers a :ref:`LineEdit<class_LineEdit>` in the dialog. When the enter key is

.. rst-class:: classref-method

|void| **remove_button**\ (\ button\: :ref:`Control<class_Control>`\ )
|void| **remove_button**\ (\ button\: :ref:`Button<class_Button>`\ )

Removes the ``button`` from the dialog. Does NOT free the ``button``. The ``button`` must be a :ref:`Button<class_Button>` added with :ref:`add_button<class_AcceptDialog_method_add_button>` or :ref:`add_cancel_button<class_AcceptDialog_method_add_cancel_button>` method. After removal, pressing the ``button`` will no longer emit this dialog's :ref:`custom_action<class_AcceptDialog_signal_custom_action>` or :ref:`canceled<class_AcceptDialog_signal_canceled>` signals.

Expand Down
6 changes: 3 additions & 3 deletions classes/class_animatablebody3d.rst
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@ When **AnimatableBody3D** is moved, its linear and angular velocity are estimate
Tutorials
---------

- `3D Physics Tests Demo <https://godotengine.org/asset-library/asset/675>`__
- `3D Physics Tests Demo <https://godotengine.org/asset-library/asset/2747>`__

- `Third Person Shooter Demo <https://godotengine.org/asset-library/asset/678>`__
- `Third Person Shooter (TPS) Demo <https://godotengine.org/asset-library/asset/2710>`__

- `3D Voxel Demo <https://godotengine.org/asset-library/asset/676>`__
- `3D Voxel Demo <https://godotengine.org/asset-library/asset/2755>`__

.. rst-class:: classref-reftable-group

Expand Down
2 changes: 1 addition & 1 deletion classes/class_animatedsprite2d.rst
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ Tutorials

- :doc:`2D Sprite animation <../tutorials/2d/2d_sprite_animation>`

- `2D Dodge The Creeps Demo <https://godotengine.org/asset-library/asset/515>`__
- `2D Dodge The Creeps Demo <https://godotengine.org/asset-library/asset/2712>`__

.. rst-class:: classref-reftable-group

Expand Down
20 changes: 16 additions & 4 deletions classes/class_animationmixer.rst
Original file line number Diff line number Diff line change
Expand Up @@ -176,13 +176,25 @@ Notifies when the caches have been cleared, either automatically, or manually vi

----

.. _class_AnimationMixer_signal_mixer_applied:

.. rst-class:: classref-signal

**mixer_applied**\ (\ )

Notifies when the blending result related have been applied to the target objects.

.. rst-class:: classref-item-separator

----

.. _class_AnimationMixer_signal_mixer_updated:

.. rst-class:: classref-signal

**mixer_updated**\ (\ )

Editor only. Notifies when the property have been updated to update dummy :ref:`AnimationPlayer<class_AnimationPlayer>` in animation player editor.
Notifies when the property related process have been updated.

.. rst-class:: classref-section-separator

Expand Down Expand Up @@ -580,7 +592,7 @@ Returns the :ref:`Animation<class_Animation>` with the key ``name``. If the anim

Returns the first :ref:`AnimationLibrary<class_AnimationLibrary>` with key ``name`` or ``null`` if not found.

To get the :ref:`AnimationPlayer<class_AnimationPlayer>`'s global animation library, use ``get_animation_library("")``.
To get the **AnimationMixer**'s global animation library, use ``get_animation_library("")``.

.. rst-class:: classref-item-separator

Expand Down Expand Up @@ -839,7 +851,7 @@ However, if the animation loops, an unintended discrete change may occur, so thi

:ref:`bool<class_bool>` **has_animation**\ (\ name\: :ref:`StringName<class_StringName>`\ ) |const|

Returns ``true`` if the :ref:`AnimationPlayer<class_AnimationPlayer>` stores an :ref:`Animation<class_Animation>` with key ``name``.
Returns ``true`` if the **AnimationMixer** stores an :ref:`Animation<class_Animation>` with key ``name``.

.. rst-class:: classref-item-separator

Expand All @@ -851,7 +863,7 @@ Returns ``true`` if the :ref:`AnimationPlayer<class_AnimationPlayer>` stores an

:ref:`bool<class_bool>` **has_animation_library**\ (\ name\: :ref:`StringName<class_StringName>`\ ) |const|

Returns ``true`` if the :ref:`AnimationPlayer<class_AnimationPlayer>` stores an :ref:`AnimationLibrary<class_AnimationLibrary>` with key ``name``.
Returns ``true`` if the **AnimationMixer** stores an :ref:`AnimationLibrary<class_AnimationLibrary>` with key ``name``.

.. rst-class:: classref-item-separator

Expand Down
14 changes: 13 additions & 1 deletion classes/class_animationnode.rst
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,16 @@ Base resource for :ref:`AnimationTree<class_AnimationTree>` nodes. In general, i

Inherit this when creating animation nodes mainly for use in :ref:`AnimationNodeBlendTree<class_AnimationNodeBlendTree>`, otherwise :ref:`AnimationRootNode<class_AnimationRootNode>` should be used instead.

You can access the time information as read-only parameter which is processed and stored in the previous frame for all nodes except :ref:`AnimationNodeOutput<class_AnimationNodeOutput>`.

\ **Note:** If more than two inputs exist in the **AnimationNode**, which time information takes precedence depends on the type of **AnimationNode**.

::

var current_length = $AnimationTree[parameters/AnimationNodeName/current_length]
var current_position = $AnimationTree[parameters/AnimationNodeName/current_position]
var current_delta = $AnimationTree[parameters/AnimationNodeName/current_delta]

.. rst-class:: classref-introduction-group

Tutorials
Expand Down Expand Up @@ -305,11 +315,13 @@ When inheriting from :ref:`AnimationRootNode<class_AnimationRootNode>`, implemen

:ref:`float<class_float>` **_process**\ (\ time\: :ref:`float<class_float>`, seek\: :ref:`bool<class_bool>`, is_external_seeking\: :ref:`bool<class_bool>`, test_only\: :ref:`bool<class_bool>`\ ) |virtual| |const|

**Deprecated:** Currently this is mostly useless as there is a lack of many APIs to extend AnimationNode by GDScript. It is planned that a more flexible API using structures will be provided in the future.

When inheriting from :ref:`AnimationRootNode<class_AnimationRootNode>`, implement this virtual method to run some code when this animation node is processed. The ``time`` parameter is a relative delta, unless ``seek`` is ``true``, in which case it is absolute.

Here, call the :ref:`blend_input<class_AnimationNode_method_blend_input>`, :ref:`blend_node<class_AnimationNode_method_blend_node>` or :ref:`blend_animation<class_AnimationNode_method_blend_animation>` functions. You can also use :ref:`get_parameter<class_AnimationNode_method_get_parameter>` and :ref:`set_parameter<class_AnimationNode_method_set_parameter>` to modify local memory.

This function should return the time left for the current animation to finish (if unsure, pass the value from the main blend being called).
This function should return the delta.

.. rst-class:: classref-item-separator

Expand Down
2 changes: 1 addition & 1 deletion classes/class_animationnodeadd3.rst
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ Tutorials

- :doc:`Using AnimationTree <../tutorials/animation/animation_tree>`

- `Third Person Shooter Demo <https://godotengine.org/asset-library/asset/678>`__
- `Third Person Shooter (TPS) Demo <https://godotengine.org/asset-library/asset/2710>`__

.. |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.)`
Expand Down
Loading

0 comments on commit 8b781d3

Please sign in to comment.