Skip to content

Commit 9eb8552

Browse files
authored
Merge pull request #10309 from godotengine/classref/sync-0c45ace
classref: Sync with current master branch (0c45ace)
2 parents e7d5ab3 + fa8c143 commit 9eb8552

35 files changed

+553
-211
lines changed

classes/[email protected]

+9-1
Original file line numberDiff line numberDiff line change
@@ -3867,11 +3867,19 @@ Hints that a :ref:`Callable<class_Callable>` property should be displayed as a c
38673867
38683868
\ **Note:** A :ref:`Callable<class_Callable>` cannot be properly serialized and stored in a file, so it is recommended to use :ref:`PROPERTY_USAGE_EDITOR<class_@GlobalScope_constant_PROPERTY_USAGE_EDITOR>` instead of :ref:`PROPERTY_USAGE_DEFAULT<class_@GlobalScope_constant_PROPERTY_USAGE_DEFAULT>`.
38693869

3870+
.. _class_@GlobalScope_constant_PROPERTY_HINT_ONESHOT:
3871+
3872+
.. rst-class:: classref-enumeration-constant
3873+
3874+
:ref:`PropertyHint<enum_@GlobalScope_PropertyHint>` **PROPERTY_HINT_ONESHOT** = ``40``
3875+
3876+
Hints that a property will be changed on its own after setting, such as :ref:`AudioStreamPlayer.playing<class_AudioStreamPlayer_property_playing>` or :ref:`GPUParticles3D.emitting<class_GPUParticles3D_property_emitting>`.
3877+
38703878
.. _class_@GlobalScope_constant_PROPERTY_HINT_MAX:
38713879

38723880
.. rst-class:: classref-enumeration-constant
38733881

3874-
:ref:`PropertyHint<enum_@GlobalScope_PropertyHint>` **PROPERTY_HINT_MAX** = ``40``
3882+
:ref:`PropertyHint<enum_@GlobalScope_PropertyHint>` **PROPERTY_HINT_MAX** = ``41``
38753883

38763884
Represents the size of the :ref:`PropertyHint<enum_@GlobalScope_PropertyHint>` enum.
38773885

classes/class_aabb.rst

+3-3
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ Property Descriptions
163163

164164
:ref:`Vector3<class_Vector3>` **end** = ``Vector3(0, 0, 0)`` :ref:`🔗<class_AABB_property_end>`
165165

166-
The ending point. This is usually the corner on the top-right and forward of the bounding box, and is equivalent to ``position + size``. Setting this point affects the :ref:`size<class_AABB_property_size>`.
166+
The ending point. This is usually the corner on the top-right and back of the bounding box, and is equivalent to ``position + size``. Setting this point affects the :ref:`size<class_AABB_property_size>`.
167167

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

@@ -175,7 +175,7 @@ The ending point. This is usually the corner on the top-right and forward of the
175175

176176
:ref:`Vector3<class_Vector3>` **position** = ``Vector3(0, 0, 0)`` :ref:`🔗<class_AABB_property_position>`
177177

178-
The origin point. This is usually the corner on the bottom-left and back of the bounding box.
178+
The origin point. This is usually the corner on the bottom-left and forward of the bounding box.
179179

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

@@ -189,7 +189,7 @@ The origin point. This is usually the corner on the bottom-left and back of the
189189

190190
The bounding box's width, height, and depth starting from :ref:`position<class_AABB_property_position>`. Setting this value also affects the :ref:`end<class_AABB_property_end>` point.
191191

192-
\ **Note:** It's recommended setting the width, height, and depth to non-negative values. This is because most methods in Godot assume that the :ref:`position<class_AABB_property_position>` is the bottom-left-back corner, and the :ref:`end<class_AABB_property_end>` is the top-right-forward corner. To get an equivalent bounding box with non-negative size, use :ref:`abs<class_AABB_method_abs>`.
192+
\ **Note:** It's recommended setting the width, height, and depth to non-negative values. This is because most methods in Godot assume that the :ref:`position<class_AABB_property_position>` is the bottom-left-forward corner, and the :ref:`end<class_AABB_property_end>` is the top-right-back corner. To get an equivalent bounding box with non-negative size, use :ref:`abs<class_AABB_method_abs>`.
193193

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

classes/class_animationmixer.rst

+52-14
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,8 @@ Properties
5555
+-----------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+--------------------+
5656
| :ref:`bool<class_bool>` | :ref:`reset_on_save<class_AnimationMixer_property_reset_on_save>` | ``true`` |
5757
+-----------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+--------------------+
58+
| :ref:`bool<class_bool>` | :ref:`root_motion_local<class_AnimationMixer_property_root_motion_local>` | |
59+
+-----------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+--------------------+
5860
| :ref:`NodePath<class_NodePath>` | :ref:`root_motion_track<class_AnimationMixer_property_root_motion_track>` | ``NodePath("")`` |
5961
+-----------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+--------------------+
6062
| :ref:`NodePath<class_NodePath>` | :ref:`root_node<class_AnimationMixer_property_root_node>` | ``NodePath("..")`` |
@@ -474,6 +476,23 @@ This makes it more convenient to preview and edit animations in the editor, as c
474476

475477
----
476478

479+
.. _class_AnimationMixer_property_root_motion_local:
480+
481+
.. rst-class:: classref-property
482+
483+
:ref:`bool<class_bool>` **root_motion_local** :ref:`🔗<class_AnimationMixer_property_root_motion_local>`
484+
485+
.. rst-class:: classref-property-setget
486+
487+
- |void| **set_root_motion_local**\ (\ value\: :ref:`bool<class_bool>`\ )
488+
- :ref:`bool<class_bool>` **is_root_motion_local**\ (\ )
489+
490+
If ``true``, :ref:`get_root_motion_position<class_AnimationMixer_method_get_root_motion_position>` value is extracted as a local translation value before blending. In other words, it is treated like the translation is done after the rotation.
491+
492+
.. rst-class:: classref-item-separator
493+
494+
----
495+
477496
.. _class_AnimationMixer_property_root_motion_track:
478497

479498
.. rst-class:: classref-property
@@ -684,13 +703,13 @@ The most basic example is applying position to :ref:`CharacterBody3D<class_Chara
684703

685704
.. code-tab:: gdscript
686705

687-
var current_rotation: Quaternion
706+
var current_rotation
688707

689708
func _process(delta):
690709
if Input.is_action_just_pressed("animate"):
691710
current_rotation = get_quaternion()
692711
state_machine.travel("Animate")
693-
var velocity: Vector3 = current_rotation * animation_tree.get_root_motion_position() / delta
712+
var velocity = current_rotation * animation_tree.get_root_motion_position() / delta
694713
set_velocity(velocity)
695714
move_and_slide()
696715

@@ -707,7 +726,26 @@ By using this in combination with :ref:`get_root_motion_rotation_accumulator<cla
707726
if Input.is_action_just_pressed("animate"):
708727
state_machine.travel("Animate")
709728
set_quaternion(get_quaternion() * animation_tree.get_root_motion_rotation())
710-
var velocity: Vector3 = (animation_tree.get_root_motion_rotation_accumulator().inverse() * get_quaternion()) * animation_tree.get_root_motion_position() / delta
729+
var velocity = (animation_tree.get_root_motion_rotation_accumulator().inverse() * get_quaternion()) * animation_tree.get_root_motion_position() / delta
730+
set_velocity(velocity)
731+
move_and_slide()
732+
733+
734+
735+
If :ref:`root_motion_local<class_AnimationMixer_property_root_motion_local>` is ``true``, return the pre-multiplied translation value with the inverted rotation.
736+
737+
In this case, the code can be written as follows:
738+
739+
740+
.. tabs::
741+
742+
.. code-tab:: gdscript
743+
744+
func _process(delta):
745+
if Input.is_action_just_pressed("animate"):
746+
state_machine.travel("Animate")
747+
set_quaternion(get_quaternion() * animation_tree.get_root_motion_rotation())
748+
var velocity = get_quaternion() * animation_tree.get_root_motion_position() / delta
711749
set_velocity(velocity)
712750
move_and_slide()
713751

@@ -734,13 +772,13 @@ For example, if an animation with only one key ``Vector3(0, 0, 0)`` is played in
734772

735773
.. code-tab:: gdscript
736774

737-
var prev_root_motion_position_accumulator: Vector3
775+
var prev_root_motion_position_accumulator
738776

739777
func _process(delta):
740778
if Input.is_action_just_pressed("animate"):
741779
state_machine.travel("Animate")
742-
var current_root_motion_position_accumulator: Vector3 = animation_tree.get_root_motion_position_accumulator()
743-
var difference: Vector3 = current_root_motion_position_accumulator - prev_root_motion_position_accumulator
780+
var current_root_motion_position_accumulator = animation_tree.get_root_motion_position_accumulator()
781+
var difference = current_root_motion_position_accumulator - prev_root_motion_position_accumulator
744782
prev_root_motion_position_accumulator = current_root_motion_position_accumulator
745783
transform.origin += difference
746784

@@ -801,13 +839,13 @@ For example, if an animation with only one key ``Quaternion(0, 0, 0, 1)`` is pla
801839

802840
.. code-tab:: gdscript
803841

804-
var prev_root_motion_rotation_accumulator: Quaternion
842+
var prev_root_motion_rotation_accumulator
805843

806844
func _process(delta):
807845
if Input.is_action_just_pressed("animate"):
808846
state_machine.travel("Animate")
809-
var current_root_motion_rotation_accumulator: Quaternion = animation_tree.get_root_motion_rotation_accumulator()
810-
var difference: Quaternion = prev_root_motion_rotation_accumulator.inverse() * current_root_motion_rotation_accumulator
847+
var current_root_motion_rotation_accumulator = animation_tree.get_root_motion_rotation_accumulator()
848+
var difference = prev_root_motion_rotation_accumulator.inverse() * current_root_motion_rotation_accumulator
811849
prev_root_motion_rotation_accumulator = current_root_motion_rotation_accumulator
812850
transform.basis *= Basis(difference)
813851
@@ -838,8 +876,8 @@ The most basic example is applying scale to :ref:`CharacterBody3D<class_Characte
838876

839877
.. code-tab:: gdscript
840878

841-
var current_scale: Vector3 = Vector3(1, 1, 1)
842-
var scale_accum: Vector3 = Vector3(1, 1, 1)
879+
var current_scale = Vector3(1, 1, 1)
880+
var scale_accum = Vector3(1, 1, 1)
843881

844882
func _process(delta):
845883
if Input.is_action_just_pressed("animate"):
@@ -870,13 +908,13 @@ For example, if an animation with only one key ``Vector3(1, 1, 1)`` is played in
870908

871909
.. code-tab:: gdscript
872910

873-
var prev_root_motion_scale_accumulator: Vector3
911+
var prev_root_motion_scale_accumulator
874912

875913
func _process(delta):
876914
if Input.is_action_just_pressed("animate"):
877915
state_machine.travel("Animate")
878-
var current_root_motion_scale_accumulator: Vector3 = animation_tree.get_root_motion_scale_accumulator()
879-
var difference: Vector3 = current_root_motion_scale_accumulator - prev_root_motion_scale_accumulator
916+
var current_root_motion_scale_accumulator = animation_tree.get_root_motion_scale_accumulator()
917+
var difference = current_root_motion_scale_accumulator - prev_root_motion_scale_accumulator
880918
prev_root_motion_scale_accumulator = current_root_motion_scale_accumulator
881919
transform.basis = transform.basis.scaled(difference)
882920

classes/class_animationnodetimeseek.rst

+34
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,40 @@ Tutorials
5555

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

58+
.. rst-class:: classref-reftable-group
59+
60+
Properties
61+
----------
62+
63+
.. table::
64+
:widths: auto
65+
66+
+-------------------------+------------------------------------------------------------------------------+----------+
67+
| :ref:`bool<class_bool>` | :ref:`explicit_elapse<class_AnimationNodeTimeSeek_property_explicit_elapse>` | ``true`` |
68+
+-------------------------+------------------------------------------------------------------------------+----------+
69+
70+
.. rst-class:: classref-section-separator
71+
72+
----
73+
74+
.. rst-class:: classref-descriptions-group
75+
76+
Property Descriptions
77+
---------------------
78+
79+
.. _class_AnimationNodeTimeSeek_property_explicit_elapse:
80+
81+
.. rst-class:: classref-property
82+
83+
:ref:`bool<class_bool>` **explicit_elapse** = ``true`` :ref:`🔗<class_AnimationNodeTimeSeek_property_explicit_elapse>`
84+
85+
.. rst-class:: classref-property-setget
86+
87+
- |void| **set_explicit_elapse**\ (\ value\: :ref:`bool<class_bool>`\ )
88+
- :ref:`bool<class_bool>` **is_explicit_elapse**\ (\ )
89+
90+
If ``true``, some processes are executed to handle keys between seeks, such as calculating root motion and finding the nearest discrete key.
91+
5892
.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
5993
.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
6094
.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`

classes/class_audiostream.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ Override this method to customize the name assigned to this audio stream. Unused
168168

169169
:ref:`AudioStreamPlayback<class_AudioStreamPlayback>` **_instantiate_playback**\ (\ ) |virtual| |const| :ref:`🔗<class_AudioStream_private_method__instantiate_playback>`
170170

171-
Override this method to customize the returned value of :ref:`instantiate_playback<class_AudioStream_method_instantiate_playback>`. Should returned a new :ref:`AudioStreamPlayback<class_AudioStreamPlayback>` created when the stream is played (such as by an :ref:`AudioStreamPlayer<class_AudioStreamPlayer>`)..
171+
Override this method to customize the returned value of :ref:`instantiate_playback<class_AudioStream_method_instantiate_playback>`. Should return a new :ref:`AudioStreamPlayback<class_AudioStreamPlayback>` created when the stream is played (such as by an :ref:`AudioStreamPlayer<class_AudioStreamPlayer>`).
172172

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

classes/class_audiostreamplayer.rst

+2
Original file line numberDiff line numberDiff line change
@@ -355,6 +355,8 @@ Returns the position in the :ref:`AudioStream<class_AudioStream>` of the latest
355355

356356
\ **Note:** The position is not always accurate, as the :ref:`AudioServer<class_AudioServer>` does not mix audio every processed frame. To get more accurate results, add :ref:`AudioServer.get_time_since_last_mix<class_AudioServer_method_get_time_since_last_mix>` to the returned position.
357357

358+
\ **Note:** This method always returns ``0.0`` if the :ref:`stream<class_AudioStreamPlayer_property_stream>` is an :ref:`AudioStreamInteractive<class_AudioStreamInteractive>`, since it can have multiple clips playing at once.
359+
358360
.. rst-class:: classref-item-separator
359361

360362
----

0 commit comments

Comments
 (0)