diff options
Diffstat (limited to 'doc/classes')
67 files changed, 584 insertions, 346 deletions
diff --git a/doc/classes/AESContext.xml b/doc/classes/AESContext.xml index 69cd54a79b..7f582e4be7 100644 --- a/doc/classes/AESContext.xml +++ b/doc/classes/AESContext.xml @@ -45,6 +45,7 @@ public class Example : Node { public AESContext Aes = new AESContext(); + public override void _Ready() { string key = "My secret key!!!"; // Key must be either 16 or 32 bytes. diff --git a/doc/classes/AnimatedSprite2D.xml b/doc/classes/AnimatedSprite2D.xml index b207eda27f..afbe34816a 100644 --- a/doc/classes/AnimatedSprite2D.xml +++ b/doc/classes/AnimatedSprite2D.xml @@ -5,6 +5,8 @@ </brief_description> <description> [AnimatedSprite2D] is similar to the [Sprite2D] node, except it carries multiple textures as animation frames. Animations are created using a [SpriteFrames] resource, which allows you to import image files (or a folder containing said files) to provide the animation frames for the sprite. The [SpriteFrames] resource can be configured in the editor via the SpriteFrames bottom panel. + After setting up [member frames], [method play] may be called. It's also possible to select an [member animation] and toggle [member playing], even within the editor. + To pause the current animation, call [method stop] or set [member playing] to [code]false[/code]. Alternatively, setting [member speed_scale] to [code]0[/code] also preserves the current frame's elapsed time. [b]Note:[/b] You can associate a set of normal or specular maps by creating additional [SpriteFrames] resources with a [code]_normal[/code] or [code]_specular[/code] suffix. For example, having 3 [SpriteFrames] resources [code]run[/code], [code]run_normal[/code], and [code]run_specular[/code] will make it so the [code]run[/code] animation uses normal and specular maps. </description> <tutorials> @@ -17,13 +19,14 @@ <param index="0" name="anim" type="StringName" default="&""" /> <param index="1" name="backwards" type="bool" default="false" /> <description> - Plays the animation named [param anim]. If no [param anim] is provided, the current animation is played. If [code]backwards[/code] is [code]true[/code], the animation will be played in reverse. + Plays the animation named [param anim]. If no [param anim] is provided, the current animation is played. If [param backwards] is [code]true[/code], the animation is played in reverse. </description> </method> <method name="stop"> <return type="void" /> <description> - Stops the current animation (does not reset the frame counter). + Stops the current [member animation] at the current [member frame]. + [b]Note:[/b] This method resets the current frame's elapsed time. If this behavior is undesired, consider setting [member speed_scale] to [code]0[/code], instead. </description> </method> </methods> @@ -50,10 +53,10 @@ The texture's drawing offset. </member> <member name="playing" type="bool" setter="set_playing" getter="is_playing" default="false"> - If [code]true[/code], the [member animation] is currently playing. + If [code]true[/code], the [member animation] is currently playing. Setting this property to [code]false[/code] is the equivalent of calling [method stop]. </member> <member name="speed_scale" type="float" setter="set_speed_scale" getter="get_speed_scale" default="1.0"> - The animation speed is multiplied by this value. + The animation speed is multiplied by this value. If set to a negative value, the animation is played in reverse. If set to [code]0[/code], the animation is paused, preserving the current frame's elapsed time. </member> </members> <signals> diff --git a/doc/classes/AnimatedSprite3D.xml b/doc/classes/AnimatedSprite3D.xml index 0bc5484e3a..09baf882fb 100644 --- a/doc/classes/AnimatedSprite3D.xml +++ b/doc/classes/AnimatedSprite3D.xml @@ -4,7 +4,9 @@ 2D sprite node in 3D world, that can use multiple 2D textures for animation. </brief_description> <description> - Animations are created using a [SpriteFrames] resource, which can be configured in the editor via the SpriteFrames panel. + [AnimatedSprite3D] is similar to the [Sprite3D] node, except it carries multiple textures as animation [member frames]. Animations are created using a [SpriteFrames] resource, which allows you to import image files (or a folder containing said files) to provide the animation frames for the sprite. The [SpriteFrames] resource can be configured in the editor via the SpriteFrames bottom panel. + After setting up [member frames], [method play] may be called. It's also possible to select an [member animation] and toggle [member playing], even within the editor. + To pause the current animation, call [method stop] or set [member playing] to [code]false[/code]. Alternatively, setting [member speed_scale] to [code]0[/code] also preserves the current frame's elapsed time. </description> <tutorials> <link title="2D Sprite animation (also applies to 3D)">$DOCS_URL/tutorials/2d/2d_sprite_animation.html</link> @@ -13,14 +15,16 @@ <method name="play"> <return type="void" /> <param index="0" name="anim" type="StringName" default="&""" /> + <param index="1" name="backwards" type="bool" default="false" /> <description> - Plays the animation named [param anim]. If no [param anim] is provided, the current animation is played. + Plays the animation named [param anim]. If no [param anim] is provided, the current animation is played. If [param backwards] is [code]true[/code], the animation is played in reverse. </description> </method> <method name="stop"> <return type="void" /> <description> - Stops the current animation (does not reset the frame counter). + Stops the current [member animation] at the current [member frame]. + [b]Note:[/b] This method resets the current frame's elapsed time. If this behavior is undesired, consider setting [member speed_scale] to [code]0[/code], instead. </description> </method> </methods> @@ -35,7 +39,10 @@ The [SpriteFrames] resource containing the animation(s). </member> <member name="playing" type="bool" setter="set_playing" getter="is_playing" default="false"> - If [code]true[/code], the [member animation] is currently playing. + If [code]true[/code], the [member animation] is currently playing. Setting this property to [code]false[/code] is the equivalent of calling [method stop]. + </member> + <member name="speed_scale" type="float" setter="set_speed_scale" getter="get_speed_scale" default="1.0"> + The animation speed is multiplied by this value. If set to a negative value, the animation is played in reverse. If set to [code]0[/code], the animation is paused, preserving the current frame's elapsed time. </member> </members> <signals> diff --git a/doc/classes/AnimationNodeBlendTree.xml b/doc/classes/AnimationNodeBlendTree.xml index 4c7943ece3..2a765ac8d6 100644 --- a/doc/classes/AnimationNodeBlendTree.xml +++ b/doc/classes/AnimationNodeBlendTree.xml @@ -87,6 +87,14 @@ The global offset of all sub-nodes. </member> </members> + <signals> + <signal name="node_changed"> + <param index="0" name="node_name" type="StringName" /> + <description> + Emitted when the input port information is changed. + </description> + </signal> + </signals> <constants> <constant name="CONNECTION_OK" value="0"> The connection was successful. diff --git a/doc/classes/AnimationPlayer.xml b/doc/classes/AnimationPlayer.xml index 710dc55a4b..d24703203b 100644 --- a/doc/classes/AnimationPlayer.xml +++ b/doc/classes/AnimationPlayer.xml @@ -268,6 +268,11 @@ [b]Note:[/b] This signal is not emitted if an animation is looping. </description> </signal> + <signal name="animation_list_changed"> + <description> + Notifies when an animation list is changed. + </description> + </signal> <signal name="animation_started"> <param index="0" name="anim_name" type="StringName" /> <description> diff --git a/doc/classes/AnimationTree.xml b/doc/classes/AnimationTree.xml index f2bf74f495..27797b00b5 100644 --- a/doc/classes/AnimationTree.xml +++ b/doc/classes/AnimationTree.xml @@ -54,6 +54,13 @@ The root animation node of this [AnimationTree]. See [AnimationNode]. </member> </members> + <signals> + <signal name="animation_player_changed"> + <description> + Emitted when the [member anim_player] is changed. + </description> + </signal> + </signals> <constants> <constant name="ANIMATION_PROCESS_PHYSICS" value="0" enum="AnimationProcessCallback"> The animations will progress during the physics frame (i.e. [method Node._physics_process]). diff --git a/doc/classes/Area2D.xml b/doc/classes/Area2D.xml index f1e40d4979..29592f133d 100644 --- a/doc/classes/Area2D.xml +++ b/doc/classes/Area2D.xml @@ -25,10 +25,24 @@ <method name="get_overlapping_bodies" qualifiers="const"> <return type="Node2D[]" /> <description> - Returns a list of intersecting [PhysicsBody2D]s. The overlapping body's [member CollisionObject2D.collision_layer] must be part of this area's [member CollisionObject2D.collision_mask] in order to be detected. + Returns a list of intersecting [PhysicsBody2D]s and [TileMap]s. The overlapping body's [member CollisionObject2D.collision_layer] must be part of this area's [member CollisionObject2D.collision_mask] in order to be detected. For performance reasons (collisions are all processed at the same time) this list is modified once during the physics step, not immediately after objects are moved. Consider using signals instead. </description> </method> + <method name="has_overlapping_areas" qualifiers="const"> + <return type="bool" /> + <description> + Returns [code]true[/code] if intersecting any [Area2D]s, otherwise returns [code]false[/code]. The overlapping area's [member CollisionObject2D.collision_layer] must be part of this area's [member CollisionObject2D.collision_mask] in order to be detected. + For performance reasons (collisions are all processed at the same time) the list of overlapping areas is modified once during the physics step, not immediately after objects are moved. Consider using signals instead. + </description> + </method> + <method name="has_overlapping_bodies" qualifiers="const"> + <return type="bool" /> + <description> + Returns [code]true[/code] if intersecting any [PhysicsBody2D]s or [TileMap]s, otherwise returns [code]false[/code]. The overlapping body's [member CollisionObject2D.collision_layer] must be part of this area's [member CollisionObject2D.collision_mask] in order to be detected. + For performance reasons (collisions are all processed at the same time) the list of overlapping bodies is modified once during the physics step, not immediately after objects are moved. Consider using signals instead. + </description> + </method> <method name="overlaps_area" qualifiers="const"> <return type="bool" /> <param index="0" name="area" type="Node" /> diff --git a/doc/classes/Area3D.xml b/doc/classes/Area3D.xml index 14081918cf..ce49be9bc1 100644 --- a/doc/classes/Area3D.xml +++ b/doc/classes/Area3D.xml @@ -23,10 +23,24 @@ <method name="get_overlapping_bodies" qualifiers="const"> <return type="Node3D[]" /> <description> - Returns a list of intersecting [PhysicsBody3D]s. The overlapping body's [member CollisionObject3D.collision_layer] must be part of this area's [member CollisionObject3D.collision_mask] in order to be detected. + Returns a list of intersecting [PhysicsBody3D]s and [GridMap]s. The overlapping body's [member CollisionObject3D.collision_layer] must be part of this area's [member CollisionObject3D.collision_mask] in order to be detected. For performance reasons (collisions are all processed at the same time) this list is modified once during the physics step, not immediately after objects are moved. Consider using signals instead. </description> </method> + <method name="has_overlapping_areas" qualifiers="const"> + <return type="bool" /> + <description> + Returns [code]true[/code] if intersecting any [Area3D]s, otherwise returns [code]false[/code]. The overlapping area's [member CollisionObject3D.collision_layer] must be part of this area's [member CollisionObject3D.collision_mask] in order to be detected. + For performance reasons (collisions are all processed at the same time) the list of overlapping areas is modified once during the physics step, not immediately after objects are moved. Consider using signals instead. + </description> + </method> + <method name="has_overlapping_bodies" qualifiers="const"> + <return type="bool" /> + <description> + Returns [code]true[/code] if intersecting any [PhysicsBody3D]s or [GridMap]s, otherwise returns [code]false[/code]. The overlapping body's [member CollisionObject3D.collision_layer] must be part of this area's [member CollisionObject3D.collision_mask] in order to be detected. + For performance reasons (collisions are all processed at the same time) the list of overlapping bodies is modified once during the physics step, not immediately after objects are moved. Consider using signals instead. + </description> + </method> <method name="overlaps_area" qualifiers="const"> <return type="bool" /> <param index="0" name="area" type="Node" /> diff --git a/doc/classes/BaseMaterial3D.xml b/doc/classes/BaseMaterial3D.xml index ee28675d89..cbb58a3e1e 100644 --- a/doc/classes/BaseMaterial3D.xml +++ b/doc/classes/BaseMaterial3D.xml @@ -28,7 +28,7 @@ <return type="Texture2D" /> <param index="0" name="param" type="int" enum="BaseMaterial3D.TextureParam" /> <description> - Returns the [Texture] associated with the specified [enum TextureParam]. + Returns the [Texture2D] associated with the specified [enum TextureParam]. </description> </method> <method name="set_feature"> diff --git a/doc/classes/BoneAttachment3D.xml b/doc/classes/BoneAttachment3D.xml index dc3d448621..f29525038e 100644 --- a/doc/classes/BoneAttachment3D.xml +++ b/doc/classes/BoneAttachment3D.xml @@ -16,10 +16,11 @@ Returns the [NodePath] to the external [Skeleton3D] node, if one has been set. </description> </method> - <method name="get_override_mode" qualifiers="const"> + <method name="get_override_mode" qualifiers="const" is_deprecated="true"> <return type="int" /> <description> - Returns the override mode for the BoneAttachment3D node. + Deprecated. Local pose overrides will be removed. + Returns the override mode for the BoneAttachment3D node (0=global / 1=local). </description> </method> <method name="get_override_pose" qualifiers="const"> @@ -48,11 +49,12 @@ Sets the [NodePath] to the external skeleton that the BoneAttachment3D node should use. The external [Skeleton3D] node is only used when [code]use_external_skeleton[/code] is set to [code]true[/code]. </description> </method> - <method name="set_override_mode"> + <method name="set_override_mode" is_deprecated="true"> <return type="void" /> <param index="0" name="override_mode" type="int" /> <description> - Sets the override mode for the BoneAttachment3D node. The override mode defines which of the bone poses the BoneAttachment3D node will override. + Deprecated. Local pose overrides will be removed. + Sets the override mode for the BoneAttachment3D node (0=global / 1=local). The override mode defines which of the bone poses the BoneAttachment3D node will override. </description> </method> <method name="set_override_pose"> diff --git a/doc/classes/CanvasItem.xml b/doc/classes/CanvasItem.xml index 70d825efac..d74f49c897 100644 --- a/doc/classes/CanvasItem.xml +++ b/doc/classes/CanvasItem.xml @@ -310,16 +310,16 @@ # If using this method in a script that redraws constantly, move the # `default_font` declaration to a member variable assigned in `_ready()` # so the Control is only created once. - var default_font = Control.new().get_font("font") - var default_font_size = Control.new().get_font_size("font_size") - draw_string(default_font, Vector2(64, 64), "Hello world", HORIZONTAL_ALIGNMENT_LEFT, -1, font_size) + var default_font = ThemeDB.fallback_font + var default_font_size = ThemeDB.fallback_font_size + draw_string(default_font, Vector2(64, 64), "Hello world", HORIZONTAL_ALIGNMENT_LEFT, -1, default_font_size) [/gdscript] [csharp] // If using this method in a script that redraws constantly, move the - // `default_font` declaration to a member variable assigned in `_ready()` + // `default_font` declaration to a member variable assigned in `_Ready()` // so the Control is only created once. - Font defaultFont = new Control().GetFont("font"); - int defaultFontSize = new Control().GetFontSize("font_size"); + Font defaultFont = ThemeDB.FallbackFont; + int defaultFontSize = ThemeDB.FallbackFontSize; DrawString(defaultFont, new Vector2(64, 64), "Hello world", HORIZONTAL_ALIGNMENT_LEFT, -1, defaultFontSize); [/csharp] [/codeblocks] diff --git a/doc/classes/Cubemap.xml b/doc/classes/Cubemap.xml index 7173388027..0cdebeda95 100644 --- a/doc/classes/Cubemap.xml +++ b/doc/classes/Cubemap.xml @@ -4,9 +4,9 @@ 6-sided texture typically used in 3D rendering. </brief_description> <description> - A cubemap is a 6-sided texture typically used for faking reflections in 3D rendering. It can be used to make an object look as if it's reflecting its surroundings. This usually delivers much better performance than other reflection methods. + A cubemap is made of 6 textures organized in layers. They are typically used for faking reflections (see [ReflectionProbe]) in 3D rendering. It can be used to make an object look as if it's reflecting its surroundings. This usually delivers much better performance than other reflection methods. This resource is typically used as a uniform in custom shaders. Few core Godot methods make use of Cubemap resources. - [b]Note:[/b] Godot doesn't support using cubemaps as a [PanoramaSkyMaterial]. You can use [url=https://danilw.github.io/GLSL-howto/cubemap_to_panorama_js/cubemap_to_panorama.html]this tool[/url] to convert a cube map to an equirectangular sky map. + [b]Note:[/b] Godot doesn't support using cubemaps in a [PanoramaSkyMaterial]. You can use [url=https://danilw.github.io/GLSL-howto/cubemap_to_panorama_js/cubemap_to_panorama.html]this tool[/url] to convert a cubemap to an equirectangular sky map. </description> <tutorials> </tutorials> diff --git a/doc/classes/CubemapArray.xml b/doc/classes/CubemapArray.xml index 4fca842b5a..7f001155e4 100644 --- a/doc/classes/CubemapArray.xml +++ b/doc/classes/CubemapArray.xml @@ -1,8 +1,13 @@ <?xml version="1.0" encoding="UTF-8" ?> <class name="CubemapArray" inherits="ImageTextureLayered" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> <brief_description> + A single composite texture resource which consists of multiple [Cubemap]s. </brief_description> <description> + [CubemapArray]s are made of an array of [Cubemap]s. Accordingly, like [Cubemap]s they are made of multiple textures the amount of which must be divisible by 6 (one image for each face of the cube). The primary benefit of [CubemapArray]s is that they can be accessed in shader code using a single texture reference. In other words, you can pass multiple [Cubemap]s into a shader using a single [CubemapArray]. + Generally, [CubemapArray]s provide a more efficent way for storing multiple [Cubemap]s, than storing multiple [Cubemap]s themselves in an array. + Internally Godot, uses [CubemapArray]s for many effects including the [Sky], if you set [member ProjectSettings.rendering/reflections/sky_reflections/texture_array_reflections] to [code]true[/code]. + [b]Note:[/b] [CubemapArray] is not supported in the OpenGL 3 rendering backend. </description> <tutorials> </tutorials> diff --git a/doc/classes/Directory.xml b/doc/classes/DirAccess.xml index c9a9f346a5..ddb98030eb 100644 --- a/doc/classes/Directory.xml +++ b/doc/classes/DirAccess.xml @@ -1,18 +1,18 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="Directory" inherits="RefCounted" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> +<class name="DirAccess" inherits="RefCounted" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> <brief_description> Type used to handle the filesystem. </brief_description> <description> Directory type. It is used to manage directories and their content (not restricted to the project folder). - When creating a new [Directory], it must be explicitly opened using [method open] before most methods can be used. However, [method file_exists] and [method dir_exists] can be used without opening a directory. If so, they use a path relative to [code]res://[/code]. + [DirAccess] can't be instantiated directly. Instead it is created with a static method that takes a path for which it will be opened. [b]Note:[/b] Many resources types are imported (e.g. textures or sound files), and their source asset will not be included in the exported game, as only the imported version is used. Use [ResourceLoader] to access imported resources. Here is an example on how to iterate through the files of a directory: [codeblocks] [gdscript] func dir_contents(path): - var dir = Directory.new() - if dir.open(path) == OK: + var dir = DirAccess.open(path) + if dir: dir.list_dir_begin() var file_name = dir.get_next() while file_name != "": @@ -27,8 +27,8 @@ [csharp] public void DirContents(string path) { - var dir = new Directory(); - if (dir.Open(path) == Error.Ok) + var dir = DirAccess.Open(path); + if (dir != null) { dir.ListDirBegin(); string fileName = dir.GetNext(); @@ -69,8 +69,10 @@ <return type="int" enum="Error" /> <param index="0" name="from" type="String" /> <param index="1" name="to" type="String" /> + <param index="2" name="chmod_flags" type="int" default="-1" /> <description> Copies the [param from] file to the [param to] destination. Both arguments should be paths to files, either relative or absolute. If the destination file exists and is not access-protected, it will be overwritten. + If [param chmod_flags] is different than [code]-1[/code], the unix permissions for the destination path will be set to the provided value, if available on the current operating system. Returns one of the [enum Error] code constants ([code]OK[/code] on success). </description> </method> @@ -85,7 +87,7 @@ <param index="0" name="path" type="String" /> <description> Returns whether the target directory exists. The argument can be relative to the current directory, or an absolute path. - If the [Directory] is not open, the path is relative to [code]res://[/code]. + If the [DirAccess] is not open, the path is relative to [code]res://[/code]. </description> </method> <method name="file_exists"> @@ -93,11 +95,12 @@ <param index="0" name="path" type="String" /> <description> Returns whether the target file exists. The argument can be relative to the current directory, or an absolute path. - If the [Directory] is not open, the path is relative to [code]res://[/code]. + If the [DirAccess] is not open, the path is relative to [code]res://[/code]. </description> </method> - <method name="get_current_dir"> + <method name="get_current_dir" qualifiers="const"> <return type="String" /> + <param index="0" name="include_drive" type="bool" default="true" /> <description> Returns the absolute path to the currently opened directory (e.g. [code]res://folder[/code] or [code]C:\tmp\folder[/code]). </description> @@ -144,8 +147,14 @@ <method name="get_next"> <return type="String" /> <description> - Returns the next element (file or directory) in the current directory (including [code].[/code] and [code]..[/code], unless [code]skip_navigational[/code] was given to [method list_dir_begin]). - The name of the file or directory is returned (and not its full path). Once the stream has been fully processed, the method returns an empty String and closes the stream automatically (i.e. [method list_dir_end] would not be mandatory in such a case). + Returns the next element (file or directory) in the current directory. + The name of the file or directory is returned (and not its full path). Once the stream has been fully processed, the method returns an empty [String] and closes the stream automatically (i.e. [method list_dir_end] would not be mandatory in such a case). + </description> + </method> + <method name="get_open_error" qualifiers="static"> + <return type="int" enum="Error" /> + <description> + Returns the result of the last [method open] call in the current thread. </description> </method> <method name="get_space_left"> @@ -184,12 +193,12 @@ Returns one of the [enum Error] code constants ([code]OK[/code] on success). </description> </method> - <method name="open"> - <return type="int" enum="Error" /> + <method name="open" qualifiers="static"> + <return type="DirAccess" /> <param index="0" name="path" type="String" /> <description> - Opens an existing directory of the filesystem. The [param path] argument can be within the project tree ([code]res://folder[/code]), the user directory ([code]user://folder[/code]) or an absolute path of the user filesystem (e.g. [code]/tmp/folder[/code] or [code]C:\tmp\folder[/code]). - Returns one of the [enum Error] code constants ([code]OK[/code] on success). + Creates a new [DirAccess] object and opens an existing directory of the filesystem. The [param path] argument can be within the project tree ([code]res://folder[/code]), the user directory ([code]user://folder[/code]) or an absolute path of the user filesystem (e.g. [code]/tmp/folder[/code] or [code]C:\tmp\folder[/code]). + Returns [code]null[/code] if opening the directory failed. You can use [method get_open_error] to check the error that ocurred. </description> </method> <method name="remove"> @@ -212,11 +221,11 @@ </method> </methods> <members> - <member name="include_hidden" type="bool" setter="set_include_hidden" getter="get_include_hidden" default="false"> + <member name="include_hidden" type="bool" setter="set_include_hidden" getter="get_include_hidden"> If [code]true[/code], hidden files are included when the navigating directory. Affects [method list_dir_begin], [method get_directories] and [method get_files]. </member> - <member name="include_navigational" type="bool" setter="set_include_navigational" getter="get_include_navigational" default="false"> + <member name="include_navigational" type="bool" setter="set_include_navigational" getter="get_include_navigational"> If [code]true[/code], [code].[/code] and [code]..[/code] are included when navigating the directory. Affects [method list_dir_begin] and [method get_directories]. </member> diff --git a/doc/classes/EditorPlugin.xml b/doc/classes/EditorPlugin.xml index 3c0d3ec6be..27cf410c15 100644 --- a/doc/classes/EditorPlugin.xml +++ b/doc/classes/EditorPlugin.xml @@ -64,8 +64,8 @@ if event is InputEventMouseMotion: # Redraw viewport when cursor is moved. update_overlays() - return true - return false + return EditorPlugin.AFTER_GUI_INPUT_STOP + return EditorPlugin.AFTER_GUI_INPUT_PASS [/gdscript] [csharp] public override void _Forward3dDrawOverViewport(Godot.Control overlay) @@ -74,15 +74,15 @@ overlay.DrawCircle(overlay.GetLocalMousePosition(), 64, Colors.White); } - public override bool _Forward3dGuiInput(Godot.Camera3D camera, InputEvent @event) + public override EditorPlugin.AfterGUIInput _Forward3dGuiInput(Godot.Camera3D camera, InputEvent @event) { if (@event is InputEventMouseMotion) { // Redraw viewport when cursor is moved. UpdateOverlays(); - return true; + return EditorPlugin.AFTER_GUI_INPUT_STOP; } - return false; + return EditorPlugin.AFTER_GUI_INPUT_PASS; [/csharp] [/codeblocks] </description> @@ -100,33 +100,33 @@ <param index="0" name="viewport_camera" type="Camera3D" /> <param index="1" name="event" type="InputEvent" /> <description> - Called when there is a root node in the current edited scene, [method _handles] is implemented and an [InputEvent] happens in the 3D viewport. Intercepts the [InputEvent], if [code]return true[/code] [EditorPlugin] consumes the [param event], otherwise forwards [param event] to other Editor classes. Example: + Called when there is a root node in the current edited scene, [method _handles] is implemented, and an [InputEvent] happens in the 3D viewport. The return value decides whether the [InputEvent] is consumed or forwarded to other [EditorPlugin]s. See [enum AfterGUIInput] for options. Example: [codeblocks] [gdscript] - # Prevents the InputEvent to reach other Editor classes. + # Prevents the InputEvent from reaching other Editor classes. func _forward_3d_gui_input(camera, event): return EditorPlugin.AFTER_GUI_INPUT_STOP [/gdscript] [csharp] - // Prevents the InputEvent to reach other Editor classes. - public override bool _Forward3dGuiInput(Camera3D camera, InputEvent @event) + // Prevents the InputEvent from reaching other Editor classes. + public override EditorPlugin.AfterGUIInput _Forward3dGuiInput(Camera3D camera, InputEvent @event) { return EditorPlugin.AFTER_GUI_INPUT_STOP; } [/csharp] [/codeblocks] - Must [code]return false[/code] in order to forward the [InputEvent] to other Editor classes. Example: + Must [code]return EditorPlugin.AFTER_GUI_INPUT_PASS[/code] in order to forward the [InputEvent] to other Editor classes. Example: [codeblocks] [gdscript] # Consumes InputEventMouseMotion and forwards other InputEvent types. func _forward_3d_gui_input(camera, event): - return event is InputEventMouseMotion + return EditorPlugin.AFTER_GUI_INPUT_STOP if event is InputEventMouseMotion else EditorPlugin.AFTER_GUI_INPUT_PASS [/gdscript] [csharp] // Consumes InputEventMouseMotion and forwards other InputEvent types. - public override bool _Forward3dGuiInput(Camera3D camera, InputEvent @event) + public override EditorPlugin.AfterGUIInput _Forward3dGuiInput(Camera3D camera, InputEvent @event) { - return @event is InputEventMouseMotion; + return @event is InputEventMouseMotion ? EditorPlugin.AFTER_GUI_INPUT_STOP : EditorPlugin.AFTER_GUI_INPUT_PASS; } [/csharp] [/codeblocks] @@ -185,12 +185,12 @@ Called when there is a root node in the current edited scene, [method _handles] is implemented and an [InputEvent] happens in the 2D viewport. Intercepts the [InputEvent], if [code]return true[/code] [EditorPlugin] consumes the [param event], otherwise forwards [param event] to other Editor classes. Example: [codeblocks] [gdscript] - # Prevents the InputEvent to reach other Editor classes. + # Prevents the InputEvent from reaching other Editor classes. func _forward_canvas_gui_input(event): return true [/gdscript] [csharp] - // Prevents the InputEvent to reach other Editor classes. + // Prevents the InputEvent from reaching other Editor classes. public override bool ForwardCanvasGuiInput(InputEvent @event) { return true; @@ -237,7 +237,7 @@ # You can use a custom icon: return preload("res://addons/my_plugin/my_plugin_icon.svg") # Or use a built-in icon: - return get_editor_interface().get_base_control().get_icon("Node", "EditorIcons") + return get_editor_interface().get_base_control().get_theme_icon("Node", "EditorIcons") [/gdscript] [csharp] public override Texture2D GetPluginIcon() @@ -245,7 +245,7 @@ // You can use a custom icon: return ResourceLoader.Load<Texture2D>("res://addons/my_plugin/my_plugin_icon.svg"); // Or use a built-in icon: - return GetEditorInterface().GetBaseControl().GetIcon("Node", "EditorIcons"); + return GetEditorInterface().GetBaseControl().GetThemeIcon("Node", "EditorIcons"); } [/csharp] [/codeblocks] @@ -755,5 +755,14 @@ <constant name="DOCK_SLOT_MAX" value="8" enum="DockSlot"> Represents the size of the [enum DockSlot] enum. </constant> + <constant name="AFTER_GUI_INPUT_PASS" value="0" enum="AfterGUIInput"> + Forwards the [InputEvent] to other EditorPlugins. + </constant> + <constant name="AFTER_GUI_INPUT_STOP" value="1" enum="AfterGUIInput"> + Prevents the [InputEvent] from reaching other Editor classes. + </constant> + <constant name="AFTER_GUI_INPUT_CUSTOM" value="2" enum="AfterGUIInput"> + Pass the [InputEvent] to other editor plugins except the main [Node3D] one. This can be used to prevent node selection changes and work with sub-gizmos instead. + </constant> </constants> </class> diff --git a/doc/classes/EditorProperty.xml b/doc/classes/EditorProperty.xml index 7bac4bf7ac..9170c449bf 100644 --- a/doc/classes/EditorProperty.xml +++ b/doc/classes/EditorProperty.xml @@ -9,6 +9,13 @@ <tutorials> </tutorials> <methods> + <method name="_set_read_only" qualifiers="virtual"> + <return type="void" /> + <param index="0" name="read_only" type="bool" /> + <description> + Called when the read-only status of the property is changed. It may be used to change custom controls into a read-only or modifiable state. + </description> + </method> <method name="_update_property" qualifiers="virtual"> <return type="void" /> <description> diff --git a/doc/classes/EditorTranslationParserPlugin.xml b/doc/classes/EditorTranslationParserPlugin.xml index d028996db8..08986781cd 100644 --- a/doc/classes/EditorTranslationParserPlugin.xml +++ b/doc/classes/EditorTranslationParserPlugin.xml @@ -72,7 +72,7 @@ msgidsContextPlural.Add(new Godot.Collections.Array{"Only with context", "a friendly context", ""}); [/csharp] [/codeblocks] - [b]Note:[/b] If you override parsing logic for standard script types (GDScript, C#, etc.), it would be better to load the [code]path[/code] argument using [method ResourceLoader.load]. This is because built-in scripts are loaded as [Resource] type, not [File] type. + [b]Note:[/b] If you override parsing logic for standard script types (GDScript, C#, etc.), it would be better to load the [code]path[/code] argument using [method ResourceLoader.load]. This is because built-in scripts are loaded as [Resource] type, not [FileAccess] type. For example: [codeblocks] [gdscript] diff --git a/doc/classes/Environment.xml b/doc/classes/Environment.xml index 695f2cbc66..243a28e73d 100644 --- a/doc/classes/Environment.xml +++ b/doc/classes/Environment.xml @@ -86,7 +86,7 @@ This is useful to simulate [url=https://en.wikipedia.org/wiki/Aerial_perspective]aerial perspective[/url] in large scenes with low density fog. However, it is not very useful for high-density fog, as the sky will shine through. When set to [code]1.0[/code], the fog color comes completely from the [Sky]. If set to [code]0.0[/code], aerial perspective is disabled. </member> <member name="fog_density" type="float" setter="set_fog_density" getter="get_fog_density" default="0.01"> - The exponential fog density to use. Higher values result in a more dense fog. + The [i]exponential[/i] fog density to use. Higher values result in a more dense fog. Fog rendering is exponential as in real life. </member> <member name="fog_enabled" type="bool" setter="set_fog_enabled" getter="is_fog_enabled" default="false"> If [code]true[/code], fog effects are enabled. @@ -292,13 +292,15 @@ The [Color] of the volumetric fog when interacting with lights. Mist and fog have an albedo close to [code]Color(1, 1, 1, 1)[/code] while smoke has a darker albedo. </member> <member name="volumetric_fog_ambient_inject" type="float" setter="set_volumetric_fog_ambient_inject" getter="get_volumetric_fog_ambient_inject" default="0.0"> - Scales the strength of ambient light used in the volumetric fog. A value of [code]0[/code] means that ambient light will not impact the volumetric fog. + Scales the strength of ambient light used in the volumetric fog. A value of [code]0.0[/code] means that ambient light will not impact the volumetric fog. [member volumetric_fog_ambient_inject] has a small performance cost when set above [code]0.0[/code]. + [b]Note:[/b] This has no visible effect if [member volumetric_fog_density] is [code]0.0[/code] or if [member volumetric_fog_albedo] is a fully black color. </member> <member name="volumetric_fog_anisotropy" type="float" setter="set_volumetric_fog_anisotropy" getter="get_volumetric_fog_anisotropy" default="0.2"> - The direction of scattered light as it goes through the volumetric fog. A value close [code]1[/code] means almost all light is scattered forward. A value close to [code]0[/code] means light is scattered equally in all directions. A value close to [code]-1[/code] means light is scattered mostly backward. Fog and mist scatter light slightly forward, while smoke scatters light equally in all directions. + The direction of scattered light as it goes through the volumetric fog. A value close to [code]1.0[/code] means almost all light is scattered forward. A value close to [code]0.0[/code] means light is scattered equally in all directions. A value close to [code]-1.0[/code] means light is scattered mostly backward. Fog and mist scatter light slightly forward, while smoke scatters light equally in all directions. </member> <member name="volumetric_fog_density" type="float" setter="set_volumetric_fog_density" getter="get_volumetric_fog_density" default="0.05"> - The base density of the volumetric fog. Set this to the lowest density you want to have globally. + The base [i]exponential[/i] density of the volumetric fog. Set this to the lowest density you want to have globally. [FogVolume]s can be used to add to or subtract from this density in specific areas. Fog rendering is exponential as in real life. + A value of [code]0.0[/code] disables global volumetric fog while allowing [FogVolume]s to display volumetric fog in specific areas. </member> <member name="volumetric_fog_detail_spread" type="float" setter="set_volumetric_fog_detail_spread" getter="get_volumetric_fog_detail_spread" default="2.0"> The distribution of size down the length of the froxel buffer. A higher value compresses the froxels closer to the camera and places more detail closer to the camera. @@ -311,22 +313,25 @@ </member> <member name="volumetric_fog_enabled" type="bool" setter="set_volumetric_fog_enabled" getter="is_volumetric_fog_enabled" default="false"> Enables the volumetric fog effect. Volumetric fog uses a screen-aligned froxel buffer to calculate accurate volumetric scattering in the short to medium range. Volumetric fog interacts with [FogVolume]s and lights to calculate localized and global fog. Volumetric fog uses a PBR single-scattering model based on extinction, scattering, and emission which it exposes to users as density, albedo, and emission. + [b]Note:[/b] Volumetric fog is only available in the forward plus renderer. It is not available in the mobile renderer or the compatibility renderer. </member> <member name="volumetric_fog_gi_inject" type="float" setter="set_volumetric_fog_gi_inject" getter="get_volumetric_fog_gi_inject" default="1.0"> - Scales the strength of Global Illumination used in the volumetric fog. A value of [code]0.0[/code] means that Global Illumination will not impact the volumetric fog. + Scales the strength of Global Illumination used in the volumetric fog's albedo color. A value of [code]0.0[/code] means that Global Illumination will not impact the volumetric fog. [member volumetric_fog_gi_inject] has a small performance cost when set above [code]0.0[/code]. + [b]Note:[/b] This has no visible effect if [member volumetric_fog_density] is [code]0.0[/code] or if [member volumetric_fog_albedo] is a fully black color. [b]Note:[/b] Only [VoxelGI] and SDFGI ([member Environment.sdfgi_enabled]) are taken into account when using [member volumetric_fog_gi_inject]. Global illumination from [LightmapGI], [ReflectionProbe] and SSIL (see [member ssil_enabled]) will be ignored by volumetric fog. </member> <member name="volumetric_fog_length" type="float" setter="set_volumetric_fog_length" getter="get_volumetric_fog_length" default="64.0"> - The distance over which the volumetric fog is computed. Increase to compute fog over a greater range, decrease to add more detail when a long range is not needed. For best quality fog, keep this as low as possible. + The distance over which the volumetric fog is computed. Increase to compute fog over a greater range, decrease to add more detail when a long range is not needed. For best quality fog, keep this as low as possible. See also [member ProjectSettings.rendering/environment/volumetric_fog/volume_depth]. </member> <member name="volumetric_fog_sky_affect" type="float" setter="set_volumetric_fog_sky_affect" getter="get_volumetric_fog_sky_affect" default="1.0"> The factor to use when affecting the sky with volumetric fog. [code]1.0[/code] means that volumetric fog can fully obscure the sky. Lower values reduce the impact of volumetric fog on sky rendering, with [code]0.0[/code] not affecting sky rendering at all. + [b]Note:[/b] [member volumetric_fog_sky_affect] also affects [FogVolume]s, even if [member volumetric_fog_density] is [code]0.0[/code]. If you notice [FogVolume]s are disappearing when looking towards the sky, set [member volumetric_fog_sky_affect] to [code]1.0[/code]. </member> <member name="volumetric_fog_temporal_reprojection_amount" type="float" setter="set_volumetric_fog_temporal_reprojection_amount" getter="get_volumetric_fog_temporal_reprojection_amount" default="0.9"> The amount by which to blend the last frame with the current frame. A higher number results in smoother volumetric fog, but makes "ghosting" much worse. A lower value reduces ghosting but can result in the per-frame temporal jitter becoming visible. </member> <member name="volumetric_fog_temporal_reprojection_enabled" type="bool" setter="set_volumetric_fog_temporal_reprojection_enabled" getter="is_volumetric_fog_temporal_reprojection_enabled" default="true"> - Enables temporal reprojection in the volumetric fog. Temporal reprojection blends the current frame's volumetric fog with the last frame's volumetric fog to smooth out jagged edges. The performance cost is minimal, however it does lead to moving [FogVolume]s and [Light3D]s "ghosting" and leaving a trail behind them. When temporal reprojection is enabled, try to avoid moving [FogVolume]s or [Light3D]s too fast. + Enables temporal reprojection in the volumetric fog. Temporal reprojection blends the current frame's volumetric fog with the last frame's volumetric fog to smooth out jagged edges. The performance cost is minimal; however, it leads to moving [FogVolume]s and [Light3D]s "ghosting" and leaving a trail behind them. When temporal reprojection is enabled, try to avoid moving [FogVolume]s or [Light3D]s too fast. Short-lived dynamic lighting effects should have [member Light3D.light_volumetric_fog_energy] set to [code]0.0[/code] to avoid ghosting. </member> </members> <constants> diff --git a/doc/classes/File.xml b/doc/classes/FileAccess.xml index 76c6a4871c..61377fb13a 100644 --- a/doc/classes/File.xml +++ b/doc/classes/FileAccess.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="File" inherits="RefCounted" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> +<class name="FileAccess" inherits="RefCounted" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> <brief_description> Type to handle file reading and writing operations. </brief_description> @@ -9,39 +9,36 @@ [codeblocks] [gdscript] func save(content): - var file = File.new() - file.open("user://save_game.dat", File.WRITE) + var file = FileAccess.open("user://save_game.dat", FileAccess.WRITE) file.store_string(content) - file.close() func load(): - var file = File.new() - file.open("user://save_game.dat", File.READ) + var file = FileAccess.open("user://save_game.dat", FileAccess.READ) var content = file.get_as_text() - file.close() return content [/gdscript] [csharp] public void Save(string content) { - var file = new File(); - file.Open("user://save_game.dat", File.ModeFlags.Write); + var file = FileAccess.Open("user://save_game.dat", File.ModeFlags.Write); file.StoreString(content); - file.Close(); } public string Load() { - var file = new File(); - file.Open("user://save_game.dat", File.ModeFlags.Read); + var file = FileAccess.Open("user://save_game.dat", File.ModeFlags.Read); string content = file.GetAsText(); - file.Close(); return content; } [/csharp] [/codeblocks] In the example above, the file will be saved in the user data folder as specified in the [url=$DOCS_URL/tutorials/io/data_paths.html]Data paths[/url] documentation. - [b]Note:[/b] To access project resources once exported, it is recommended to use [ResourceLoader] instead of the [File] API, as some files are converted to engine-specific formats and their original source files might not be present in the exported PCK package. + There is no method to close a file in order to free it from use. Instead, [FileAccess] will close when it's freed, which happens when it goes out of scope or when it gets assigned with [code]null[/code]. + [codeblock] + var file = FileAccess.open("res://something") # File is opened and locked for use. + file = null # File is closed. + [/codeblock] + [b]Note:[/b] To access project resources once exported, it is recommended to use [ResourceLoader] instead of the [FileAccess] API, as some files are converted to engine-specific formats and their original source files might not be present in the exported PCK package. [b]Note:[/b] Files are automatically closed only if the process exits "normally" (such as by clicking the window manager's close button or pressing [b]Alt + F4[/b]). If you stop the project execution by pressing [b]F8[/b] while the project is running, the file won't be closed as the game process will be killed. You can work around this by calling [method flush] at regular intervals. </description> <tutorials> @@ -49,12 +46,6 @@ <link title="3D Voxel Demo">https://godotengine.org/asset-library/asset/676</link> </tutorials> <methods> - <method name="close"> - <return type="void" /> - <description> - Closes the currently opened file and prevents subsequent read/write operations. Use [method flush] to persist the data to disk without closing the file. - </description> - </method> <method name="eof_reached" qualifiers="const"> <return type="bool" /> <description> @@ -85,7 +76,7 @@ <method name="flush"> <return type="void" /> <description> - Writes the file's buffer to disk. Flushing is automatically performed when the file is closed. This means you don't need to call [method flush] manually before closing a file using [method close]. Still, calling [method flush] can be used to ensure the data is safe even if the project crashes instead of being closed gracefully. + Writes the file's buffer to disk. Flushing is automatically performed when the file is closed. This means you don't need to call [method flush] manually before closing a file. Still, calling [method flush] can be used to ensure the data is safe even if the project crashes instead of being closed gracefully. [b]Note:[/b] Only call [method flush] when you actually need it. Otherwise, it will decrease performance due to constant disk writes. </description> </method> @@ -174,20 +165,26 @@ Text is interpreted as being UTF-8 encoded. </description> </method> - <method name="get_md5" qualifiers="const"> + <method name="get_md5" qualifiers="static"> <return type="String" /> <param index="0" name="path" type="String" /> <description> Returns an MD5 String representing the file at the given path or an empty [String] on failure. </description> </method> - <method name="get_modified_time" qualifiers="const"> + <method name="get_modified_time" qualifiers="static"> <return type="int" /> <param index="0" name="file" type="String" /> <description> Returns the last time the [param file] was modified in Unix timestamp format or returns a [String] "ERROR IN [code]file[/code]". This Unix timestamp can be converted to another format using the [Time] singleton. </description> </method> + <method name="get_open_error" qualifiers="static"> + <return type="int" enum="Error" /> + <description> + Returns the result of the last [method open] call in the current thread. + </description> + </method> <method name="get_pascal_string"> <return type="String" /> <description> @@ -219,7 +216,7 @@ Returns the next bits from the file as a floating-point number. </description> </method> - <method name="get_sha256" qualifiers="const"> + <method name="get_sha256" qualifiers="static"> <return type="String" /> <param index="0" name="path" type="String" /> <description> @@ -240,41 +237,45 @@ Returns [code]true[/code] if the file is currently opened. </description> </method> - <method name="open"> - <return type="int" enum="Error" /> + <method name="open" qualifiers="static"> + <return type="FileAccess" /> <param index="0" name="path" type="String" /> - <param index="1" name="flags" type="int" enum="File.ModeFlags" /> + <param index="1" name="flags" type="int" enum="FileAccess.ModeFlags" /> <description> - Opens the file for writing or reading, depending on the flags. + Creates a new [FileAccess] object and opens the file for writing or reading, depending on the flags. + Returns [code]null[/code] if opening the file failed. You can use [method get_open_error] to check the error that ocurred. </description> </method> - <method name="open_compressed"> - <return type="int" enum="Error" /> + <method name="open_compressed" qualifiers="static"> + <return type="FileAccess" /> <param index="0" name="path" type="String" /> - <param index="1" name="mode_flags" type="int" enum="File.ModeFlags" /> - <param index="2" name="compression_mode" type="int" enum="File.CompressionMode" default="0" /> + <param index="1" name="mode_flags" type="int" enum="FileAccess.ModeFlags" /> + <param index="2" name="compression_mode" type="int" enum="FileAccess.CompressionMode" default="0" /> <description> - Opens a compressed file for reading or writing. + Creates a new [FileAccess] object and opens a compressed file for reading or writing. [b]Note:[/b] [method open_compressed] can only read files that were saved by Godot, not third-party compression formats. See [url=https://github.com/godotengine/godot/issues/28999]GitHub issue #28999[/url] for a workaround. + Returns [code]null[/code] if opening the file failed. You can use [method get_open_error] to check the error that ocurred. </description> </method> - <method name="open_encrypted"> - <return type="int" enum="Error" /> + <method name="open_encrypted" qualifiers="static"> + <return type="FileAccess" /> <param index="0" name="path" type="String" /> - <param index="1" name="mode_flags" type="int" enum="File.ModeFlags" /> + <param index="1" name="mode_flags" type="int" enum="FileAccess.ModeFlags" /> <param index="2" name="key" type="PackedByteArray" /> <description> - Opens an encrypted file in write or read mode. You need to pass a binary key to encrypt/decrypt it. + Creates a new [FileAccess] object and opens an encrypted file in write or read mode. You need to pass a binary key to encrypt/decrypt it. [b]Note:[/b] The provided key must be 32 bytes long. + Returns [code]null[/code] if opening the file failed. You can use [method get_open_error] to check the error that ocurred. </description> </method> - <method name="open_encrypted_with_pass"> - <return type="int" enum="Error" /> + <method name="open_encrypted_with_pass" qualifiers="static"> + <return type="FileAccess" /> <param index="0" name="path" type="String" /> - <param index="1" name="mode_flags" type="int" enum="File.ModeFlags" /> + <param index="1" name="mode_flags" type="int" enum="FileAccess.ModeFlags" /> <param index="2" name="pass" type="String" /> <description> - Opens an encrypted file in write or read mode. You need to pass a password to encrypt/decrypt it. + Creates a new [FileAccess] object and opens an encrypted file in write or read mode. You need to pass a password to encrypt/decrypt it. + Returns [code]null[/code] if opening the file failed. You can use [method get_open_error] to check the error that ocurred. </description> </method> <method name="seek"> @@ -432,7 +433,7 @@ </method> </methods> <members> - <member name="big_endian" type="bool" setter="set_big_endian" getter="is_big_endian" default="false"> + <member name="big_endian" type="bool" setter="set_big_endian" getter="is_big_endian"> If [code]true[/code], the file is read with big-endian [url=https://en.wikipedia.org/wiki/Endianness]endianness[/url]. If [code]false[/code], the file is read with little-endian endianness. If in doubt, leave this to [code]false[/code] as most files are written with little-endian endianness. [b]Note:[/b] [member big_endian] is only about the file format, not the CPU type. The CPU endianness doesn't affect the default endianness for files written. [b]Note:[/b] This is always reset to [code]false[/code] whenever you open the file. Therefore, you must set [member big_endian] [i]after[/i] opening the file, not before. diff --git a/doc/classes/FogMaterial.xml b/doc/classes/FogMaterial.xml index e63d4ddf3e..7428d6169a 100644 --- a/doc/classes/FogMaterial.xml +++ b/doc/classes/FogMaterial.xml @@ -5,27 +5,28 @@ </brief_description> <description> A [Material] resource that can be used by [FogVolume]s to draw volumetric effects. + If you need more advanced effects, use a custom [url=$DOCS_URL/tutorials/shaders/shader_reference/fog_shader.html]fog shader[/url]. </description> <tutorials> </tutorials> <members> <member name="albedo" type="Color" setter="set_albedo" getter="get_albedo" default="Color(1, 1, 1, 1)"> - Sets the single-scattering [Color] of the [FogVolume]. Internally [member albedo] is converted into single-scattering which is additively blended with other [FogVolume]s and the [member Environment.volumetric_fog_albedo]. + The single-scattering [Color] of the [FogVolume]. Internally, [member albedo] is converted into single-scattering, which is additively blended with other [FogVolume]s and the [member Environment.volumetric_fog_albedo]. </member> <member name="density" type="float" setter="set_density" getter="get_density" default="1.0"> - Sets the density of the [FogVolume]. Denser objects are more opaque, but may suffer from under-sampling artifacts that look like stripes. + The density of the [FogVolume]. Denser objects are more opaque, but may suffer from under-sampling artifacts that look like stripes. Negative values can be used to subtract fog from other [FogVolume]s or global volumetric fog. </member> <member name="density_texture" type="Texture3D" setter="set_density_texture" getter="get_density_texture"> - Sets a 3D texture that is used to scale the [member density] of the [FogVolume]. + The 3D texture that is used to scale the [member density] of the [FogVolume]. This can be used to vary fog density within the [FogVolume] with any kind of static pattern. For animated effects, consider using a custom [url=$DOCS_URL/tutorials/shaders/shader_reference/fog_shader.html]fog shader[/url]. </member> <member name="edge_fade" type="float" setter="set_edge_fade" getter="get_edge_fade" default="0.1"> - Sets the hardness of the edges of the [FogVolume]. A higher number will result in softer edges while a lower number will result in harder edges. + The hardness of the edges of the [FogVolume]. A higher value will result in softer edges, while a lower value will result in harder edges. </member> <member name="emission" type="Color" setter="set_emission" getter="get_emission" default="Color(0, 0, 0, 1)"> - Sets the [Color] of the light emitted by the [FogVolume]. Emitted light will not cast light or shadows on other objects, but can be useful for modulating the [Color] of the [FogVolume] independently from light sources. + The [Color] of the light emitted by the [FogVolume]. Emitted light will not cast light or shadows on other objects, but can be useful for modulating the [Color] of the [FogVolume] independently from light sources. </member> <member name="height_falloff" type="float" setter="set_height_falloff" getter="get_height_falloff" default="0.0"> - Sets the rate by which the height-based fog decreases in density as height increases in world space. A high falloff will result in a sharp transition, while a low falloff will result in a smoother transition. A value of [code]0[/code] results in uniform-density fog. The height threshold is determined by the height of the associated [FogVolume]. + The rate by which the height-based fog decreases in density as height increases in world space. A high falloff will result in a sharp transition, while a low falloff will result in a smoother transition. A value of [code]0.0[/code] results in uniform-density fog. The height threshold is determined by the height of the associated [FogVolume]. </member> </members> </class> diff --git a/doc/classes/FogVolume.xml b/doc/classes/FogVolume.xml index 3f2ee3035c..d9fa2e6ebb 100644 --- a/doc/classes/FogVolume.xml +++ b/doc/classes/FogVolume.xml @@ -4,22 +4,23 @@ A node used to add local fog with the volumetric fog effect. </brief_description> <description> - [FogVolume]s are used to add localized fog into the global volumetric fog effect. + [FogVolume]s are used to add localized fog into the global volumetric fog effect. [FogVolume]s can also remove volumetric fog from specific areas if using a [FogMaterial] with a negative [member FogMaterial.density]. Performance of [FogVolume]s is directly related to their relative size on the screen and the complexity of their attached [FogMaterial]. It is best to keep [FogVolume]s relatively small and simple where possible. + [b]Note:[/b] [FogVolume]s only have a visible effect if [member Environment.volumetric_fog_enabled] is [code]true[/code]. If you don't want fog to be globally visible (but only within [FogVolume] nodes), set [member Environment.volumetric_fog_density] to [code]0.0[/code]. </description> <tutorials> </tutorials> <members> <member name="extents" type="Vector3" setter="set_extents" getter="get_extents" default="Vector3(1, 1, 1)"> - Sets the size of the [FogVolume] when [member shape] is [constant RenderingServer.FOG_VOLUME_SHAPE_ELLIPSOID], [constant RenderingServer.FOG_VOLUME_SHAPE_CONE], [constant RenderingServer.FOG_VOLUME_SHAPE_CYLINDER] or [constant RenderingServer.FOG_VOLUME_SHAPE_BOX]. + The size of the [FogVolume] when [member shape] is [constant RenderingServer.FOG_VOLUME_SHAPE_ELLIPSOID], [constant RenderingServer.FOG_VOLUME_SHAPE_CONE], [constant RenderingServer.FOG_VOLUME_SHAPE_CYLINDER] or [constant RenderingServer.FOG_VOLUME_SHAPE_BOX]. [b]Note:[/b] Thin fog volumes may appear to flicker when the camera moves or rotates. This can be alleviated by increasing [member ProjectSettings.rendering/environment/volumetric_fog/volume_depth] (at a performance cost) or by decreasing [member Environment.volumetric_fog_length] (at no performance cost, but at the cost of lower fog range). Alternatively, the [FogVolume] can be made thicker and use a lower density in the [member material]. [b]Note:[/b] If [member shape] is [constant RenderingServer.FOG_VOLUME_SHAPE_CONE] or [constant RenderingServer.FOG_VOLUME_SHAPE_CYLINDER], the cone/cylinder will be adjusted to fit within the extents. Non-uniform scaling of cone/cylinder shapes via the [member extents] property is not supported, but you can scale the [FogVolume] node instead. </member> <member name="material" type="Material" setter="set_material" getter="get_material"> - Sets the [Material] to be used by the [FogVolume]. Can be either a [FogMaterial] or a custom [ShaderMaterial]. + The [Material] used by the [FogVolume]. Can be either a built-in [FogMaterial] or a custom [ShaderMaterial]. </member> <member name="shape" type="int" setter="set_shape" getter="get_shape" enum="RenderingServer.FogVolumeShape" default="3"> - Sets the shape of the [FogVolume] to either [constant RenderingServer.FOG_VOLUME_SHAPE_ELLIPSOID], [constant RenderingServer.FOG_VOLUME_SHAPE_CONE], [constant RenderingServer.FOG_VOLUME_SHAPE_CYLINDER], [constant RenderingServer.FOG_VOLUME_SHAPE_BOX] or [constant RenderingServer.FOG_VOLUME_SHAPE_WORLD]. + The shape of the [FogVolume]. This can be set to either [constant RenderingServer.FOG_VOLUME_SHAPE_ELLIPSOID], [constant RenderingServer.FOG_VOLUME_SHAPE_CONE], [constant RenderingServer.FOG_VOLUME_SHAPE_CYLINDER], [constant RenderingServer.FOG_VOLUME_SHAPE_BOX] or [constant RenderingServer.FOG_VOLUME_SHAPE_WORLD]. </member> </members> </class> diff --git a/doc/classes/Geometry2D.xml b/doc/classes/Geometry2D.xml index 392ca2cabb..e613ab1a55 100644 --- a/doc/classes/Geometry2D.xml +++ b/doc/classes/Geometry2D.xml @@ -126,7 +126,7 @@ <return type="Dictionary" /> <param index="0" name="sizes" type="PackedVector2Array" /> <description> - Given an array of [Vector2]s representing tiles, builds an atlas. The returned dictionary has two keys: [code]points[/code] is an array of [Vector2] that specifies the positions of each tile, [code]size[/code] contains the overall size of the whole atlas as [Vector2]. + Given an array of [Vector2]s representing tiles, builds an atlas. The returned dictionary has two keys: [code]points[/code] is a [PackedVector2Array] that specifies the positions of each tile, [code]size[/code] contains the overall size of the whole atlas as [Vector2i]. </description> </method> <method name="merge_polygons"> diff --git a/doc/classes/GraphEdit.xml b/doc/classes/GraphEdit.xml index dc093acdcd..5050ce7715 100644 --- a/doc/classes/GraphEdit.xml +++ b/doc/classes/GraphEdit.xml @@ -1,37 +1,38 @@ <?xml version="1.0" encoding="UTF-8" ?> <class name="GraphEdit" inherits="Control" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> <brief_description> - GraphEdit is an area capable of showing various GraphNodes. It manages connection events between them. + GraphEdit is a control responsible for displaying and manipulating graph-like data using [GraphNode]s. It provides access to creation, removal, connection, and disconnection of nodes. </brief_description> <description> - GraphEdit manages the showing of GraphNodes it contains, as well as connections and disconnections between them. Signals are sent for each of these two events. Disconnection between GraphNode slots is disabled by default. - It is greatly advised to enable low-processor usage mode (see [member OS.low_processor_usage_mode]) when using GraphEdits. + GraphEdit provides tools for creation, manipulation, and display of various graphs. Its main purpose in the engine is to power the visual programming systems, such as visual shaders, but it is also available for use in user projects. + GraphEdit by itself is only an empty container, representing an infinite grid where [GraphNode]s can be placed. Each [GraphNode] represent a node in the graph, a single unit of data in the connected scheme. GraphEdit, in turn, helps to control various interactions with nodes and between nodes. When the user attempts to connect, disconnect, or close a [GraphNode], a signal is emitted in the GraphEdit, but no action is taken by default. It is the responsibility of the programmer utilizing this control to implement the necessary logic to determine how each request should be handled. + [b]Performance:[/b] It is greatly advised to enable low-processor usage mode (see [member OS.low_processor_usage_mode]) when using GraphEdits. </description> <tutorials> </tutorials> <methods> <method name="_get_connection_line" qualifiers="virtual const"> <return type="PackedVector2Array" /> - <param index="0" name="from" type="Vector2" /> - <param index="1" name="to" type="Vector2" /> + <param index="0" name="from_position" type="Vector2" /> + <param index="1" name="to_position" type="Vector2" /> <description> Virtual method which can be overridden to customize how connections are drawn. </description> </method> <method name="_is_in_input_hotzone" qualifiers="virtual"> <return type="bool" /> - <param index="0" name="graph_node" type="Object" /> - <param index="1" name="slot_index" type="int" /> + <param index="0" name="in_node" type="Object" /> + <param index="1" name="in_port" type="int" /> <param index="2" name="mouse_position" type="Vector2" /> <description> Returns whether the [param mouse_position] is in the input hot zone. - By default, a hot zone is a [Rect2] positioned such that its center is at [param graph_node].[method GraphNode.get_connection_input_position]([param slot_index]) (For output's case, call [method GraphNode.get_connection_output_position] instead). The hot zone's width is twice the Theme Property [code]port_grab_distance_horizontal[/code], and its height is twice the [code]port_grab_distance_vertical[/code]. + By default, a hot zone is a [Rect2] positioned such that its center is at [param in_node].[method GraphNode.get_connection_input_position]([param in_port]) (For output's case, call [method GraphNode.get_connection_output_position] instead). The hot zone's width is twice the Theme Property [code]port_grab_distance_horizontal[/code], and its height is twice the [code]port_grab_distance_vertical[/code]. Below is a sample code to help get started: [codeblock] - func _is_in_input_hotzone(graph_node, slot_index, mouse_position): - var slot_size : Vector2 = Vector2(get_theme_constant("port_grab_distance_horizontal"), get_theme_constant("port_grab_distance_vertical")) - var slot_pos : Vector2 = graph_node.get_position() + graph_node.get_connection_input_position(slot_index) - slot_size / 2 - var rect = Rect2(slot_pos, slot_size) + func _is_in_input_hotzone(in_node, in_port, mouse_position): + var port_size : Vector2 = Vector2(get_theme_constant("port_grab_distance_horizontal"), get_theme_constant("port_grab_distance_vertical")) + var port_pos : Vector2 = in_node.get_position() + in_node.get_connection_input_position(in_port) - port_size / 2 + var rect = Rect2(port_pos, port_size) return rect.has_point(mouse_position) [/codeblock] @@ -39,17 +40,17 @@ </method> <method name="_is_in_output_hotzone" qualifiers="virtual"> <return type="bool" /> - <param index="0" name="graph_node" type="Object" /> - <param index="1" name="slot_index" type="int" /> + <param index="0" name="in_node" type="Object" /> + <param index="1" name="in_port" type="int" /> <param index="2" name="mouse_position" type="Vector2" /> <description> Returns whether the [param mouse_position] is in the output hot zone. For more information on hot zones, see [method _is_in_input_hotzone]. Below is a sample code to help get started: [codeblock] - func _is_in_output_hotzone(graph_node, slot_index, mouse_position): - var slot_size : Vector2 = Vector2(get_theme_constant("port_grab_distance_horizontal"), get_theme_constant("port_grab_distance_vertical")) - var slot_pos : Vector2 = graph_node.get_position() + graph_node.get_connection_output_position(slot_index) - slot_size / 2 - var rect = Rect2(slot_pos, slot_size) + func _is_in_output_hotzone(in_node, in_port, mouse_position): + var port_size : Vector2 = Vector2(get_theme_constant("port_grab_distance_horizontal"), get_theme_constant("port_grab_distance_vertical")) + var port_pos : Vector2 = in_node.get_position() + in_node.get_connection_output_position(in_port) - port_size / 2 + var rect = Rect2(port_pos, port_size) return rect.has_point(mouse_position) [/codeblock] @@ -57,17 +58,17 @@ </method> <method name="_is_node_hover_valid" qualifiers="virtual"> <return type="bool" /> - <param index="0" name="from" type="StringName" /> - <param index="1" name="from_slot" type="int" /> - <param index="2" name="to" type="StringName" /> - <param index="3" name="to_slot" type="int" /> + <param index="0" name="from_node" type="StringName" /> + <param index="1" name="from_port" type="int" /> + <param index="2" name="to_node" type="StringName" /> + <param index="3" name="to_port" type="int" /> <description> This virtual method can be used to insert additional error detection while the user is dragging a connection over a valid port. Return [code]true[/code] if the connection is indeed valid or return [code]false[/code] if the connection is impossible. If the connection is impossible, no snapping to the port and thus no connection request to that port will happen. In this example a connection to same node is suppressed: [codeblocks] [gdscript] - func _is_node_hover_valid(from, from_slot, to, to_slot): + func _is_node_hover_valid(from, from_port, to, to_port): return from != to [/gdscript] [csharp] @@ -83,21 +84,22 @@ <param index="0" name="from_type" type="int" /> <param index="1" name="to_type" type="int" /> <description> - Makes possible the connection between two different slot types. The type is defined with the [method GraphNode.set_slot] method. + Allows the connection between two different port types. The port type is defined individually for the left and the right port of each slot with the [method GraphNode.set_slot] method. + See also [method is_valid_connection_type] and [method remove_valid_connection_type]. </description> </method> <method name="add_valid_left_disconnect_type"> <return type="void" /> <param index="0" name="type" type="int" /> <description> - Makes possible to disconnect nodes when dragging from the slot at the left if it has the specified type. + Allows to disconnect nodes when dragging from the left port of the [GraphNode]'s slot if it has the specified type. See also [method remove_valid_left_disconnect_type]. </description> </method> <method name="add_valid_right_disconnect_type"> <return type="void" /> <param index="0" name="type" type="int" /> <description> - Makes possible to disconnect nodes when dragging from the slot at the right if it has the specified type. + Allows to disconnect nodes when dragging from the right port of the [GraphNode]'s slot if it has the specified type. See also [method remove_valid_right_disconnect_type]. </description> </method> <method name="arrange_nodes"> @@ -114,22 +116,22 @@ </method> <method name="connect_node"> <return type="int" enum="Error" /> - <param index="0" name="from" type="StringName" /> + <param index="0" name="from_node" type="StringName" /> <param index="1" name="from_port" type="int" /> - <param index="2" name="to" type="StringName" /> + <param index="2" name="to_node" type="StringName" /> <param index="3" name="to_port" type="int" /> <description> - Create a connection between the [param from_port] slot of the [param from] GraphNode and the [param to_port] slot of the [param to] GraphNode. If the connection already exists, no connection is created. + Create a connection between the [param from_port] of the [param from_node] [GraphNode] and the [param to_port] of the [param to_node] [GraphNode]. If the connection already exists, no connection is created. </description> </method> <method name="disconnect_node"> <return type="void" /> - <param index="0" name="from" type="StringName" /> + <param index="0" name="from_node" type="StringName" /> <param index="1" name="from_port" type="int" /> - <param index="2" name="to" type="StringName" /> + <param index="2" name="to_node" type="StringName" /> <param index="3" name="to_port" type="int" /> <description> - Removes the connection between the [param from_port] slot of the [param from] GraphNode and the [param to_port] slot of the [param to] GraphNode. If the connection does not exist, no connection is removed. + Removes the connection between the [param from_port] of the [param from_node] [GraphNode] and the [param to_port] of the [param to_node] [GraphNode]. If the connection does not exist, no connection is removed. </description> </method> <method name="force_connection_drag_end"> @@ -142,10 +144,10 @@ </method> <method name="get_connection_line"> <return type="PackedVector2Array" /> - <param index="0" name="from" type="Vector2" /> - <param index="1" name="to" type="Vector2" /> + <param index="0" name="from_node" type="Vector2" /> + <param index="1" name="to_node" type="Vector2" /> <description> - Returns the points which would make up a connection between [param from] and [param to]. + Returns the points which would make up a connection between [param from_node] and [param to_node]. </description> </method> <method name="get_connection_list" qualifiers="const"> @@ -163,12 +165,12 @@ </method> <method name="is_node_connected"> <return type="bool" /> - <param index="0" name="from" type="StringName" /> + <param index="0" name="from_node" type="StringName" /> <param index="1" name="from_port" type="int" /> - <param index="2" name="to" type="StringName" /> + <param index="2" name="to_node" type="StringName" /> <param index="3" name="to_port" type="int" /> <description> - Returns [code]true[/code] if the [param from_port] slot of the [param from] GraphNode is connected to the [param to_port] slot of the [param to] GraphNode. + Returns [code]true[/code] if the [param from_port] of the [param from_node] [GraphNode] is connected to the [param to_port] of the [param to_node] [GraphNode]. </description> </method> <method name="is_valid_connection_type" qualifiers="const"> @@ -176,7 +178,8 @@ <param index="0" name="from_type" type="int" /> <param index="1" name="to_type" type="int" /> <description> - Returns whether it's possible to connect slots of the specified types. + Returns whether it's possible to make a connection between two different port types. The port type is defined individually for the left and the right port of each slot with the [method GraphNode.set_slot] method. + See also [method add_valid_connection_type] and [method remove_valid_connection_type]. </description> </method> <method name="remove_valid_connection_type"> @@ -184,32 +187,33 @@ <param index="0" name="from_type" type="int" /> <param index="1" name="to_type" type="int" /> <description> - Makes it not possible to connect between two different slot types. The type is defined with the [method GraphNode.set_slot] method. + Disallows the connection between two different port types previously allowed by [method add_valid_connection_type]. The port type is defined individually for the left and the right port of each slot with the [method GraphNode.set_slot] method. + See also [method is_valid_connection_type]. </description> </method> <method name="remove_valid_left_disconnect_type"> <return type="void" /> <param index="0" name="type" type="int" /> <description> - Removes the possibility to disconnect nodes when dragging from the slot at the left if it has the specified type. + Disallows to disconnect nodes when dragging from the left port of the [GraphNode]'s slot if it has the specified type. Use this to disable disconnection previously allowed with [method add_valid_left_disconnect_type]. </description> </method> <method name="remove_valid_right_disconnect_type"> <return type="void" /> <param index="0" name="type" type="int" /> <description> - Removes the possibility to disconnect nodes when dragging from the slot at the right if it has the specified type. + Disallows to disconnect nodes when dragging from the right port of the [GraphNode]'s slot if it has the specified type. Use this to disable disconnection previously allowed with [method add_valid_right_disconnect_type]. </description> </method> <method name="set_connection_activity"> <return type="void" /> - <param index="0" name="from" type="StringName" /> + <param index="0" name="from_node" type="StringName" /> <param index="1" name="from_port" type="int" /> - <param index="2" name="to" type="StringName" /> + <param index="2" name="to_node" type="StringName" /> <param index="3" name="to_port" type="int" /> <param index="4" name="amount" type="float" /> <description> - Sets the coloration of the connection between [param from]'s [param from_port] and [param to]'s [param to_port] with the color provided in the [theme_item activity] theme property. + Sets the coloration of the connection between [param from_node]'s [param from_port] and [param to_node]'s [param to_port] with the color provided in the [theme_item activity] theme property. </description> </method> <method name="set_selected"> @@ -287,36 +291,36 @@ </description> </signal> <signal name="connection_drag_started"> - <param index="0" name="from" type="String" /> - <param index="1" name="slot" type="int" /> + <param index="0" name="from_node" type="String" /> + <param index="1" name="from_port" type="int" /> <param index="2" name="is_output" type="bool" /> <description> Emitted at the beginning of a connection drag. </description> </signal> <signal name="connection_from_empty"> - <param index="0" name="to" type="StringName" /> - <param index="1" name="to_slot" type="int" /> + <param index="0" name="to_node" type="StringName" /> + <param index="1" name="to_port" type="int" /> <param index="2" name="release_position" type="Vector2" /> <description> - Emitted when user dragging connection from input port into empty space of the graph. + Emitted when user drags a connection from an input port into the empty space of the graph. </description> </signal> <signal name="connection_request"> - <param index="0" name="from" type="StringName" /> - <param index="1" name="from_slot" type="int" /> - <param index="2" name="to" type="StringName" /> - <param index="3" name="to_slot" type="int" /> + <param index="0" name="from_node" type="StringName" /> + <param index="1" name="from_port" type="int" /> + <param index="2" name="to_node" type="StringName" /> + <param index="3" name="to_port" type="int" /> <description> - Emitted to the GraphEdit when the connection between the [param from_slot] slot of the [param from] GraphNode and the [param to_slot] slot of the [param to] GraphNode is attempted to be created. + Emitted to the GraphEdit when the connection between the [param from_port] of the [param from_node] [GraphNode] and the [param to_port] of the [param to_node] [GraphNode] is attempted to be created. </description> </signal> <signal name="connection_to_empty"> - <param index="0" name="from" type="StringName" /> - <param index="1" name="from_slot" type="int" /> + <param index="0" name="from_node" type="StringName" /> + <param index="1" name="from_port" type="int" /> <param index="2" name="release_position" type="Vector2" /> <description> - Emitted when user dragging connection from output port into empty space of the graph. + Emitted when user drags a connection from an output port into the empty space of the graph. </description> </signal> <signal name="copy_nodes_request"> @@ -331,12 +335,12 @@ </description> </signal> <signal name="disconnection_request"> - <param index="0" name="from" type="StringName" /> - <param index="1" name="from_slot" type="int" /> - <param index="2" name="to" type="StringName" /> - <param index="3" name="to_slot" type="int" /> + <param index="0" name="from_node" type="StringName" /> + <param index="1" name="from_port" type="int" /> + <param index="2" name="to_node" type="StringName" /> + <param index="3" name="to_port" type="int" /> <description> - Emitted to the GraphEdit when the connection between [param from_slot] slot of [param from] GraphNode and [param to_slot] slot of [param to] GraphNode is attempted to be removed. + Emitted to the GraphEdit when the connection between [param from_port] of [param from_node] [GraphNode] and [param to_port] of [param to_node] [GraphNode] is attempted to be removed. </description> </signal> <signal name="duplicate_nodes_request"> diff --git a/doc/classes/GraphNode.xml b/doc/classes/GraphNode.xml index a80dd0d47f..16386ff81b 100644 --- a/doc/classes/GraphNode.xml +++ b/doc/classes/GraphNode.xml @@ -1,12 +1,13 @@ <?xml version="1.0" encoding="UTF-8" ?> <class name="GraphNode" inherits="Container" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> <brief_description> - A GraphNode is a container with potentially several input and output slots allowing connections between GraphNodes. Slots can have different, incompatible types. + GraphNode is a [Container] control that represents a single data unit in a [GraphEdit] graph. You can customize the number, type, and color of left- and right-side connection ports. </brief_description> <description> - A GraphNode is a container. Each GraphNode can have several input and output slots, sometimes referred to as ports, allowing connections between GraphNodes. To add a slot to GraphNode, add any [Control]-derived child node to it. - After adding at least one child to GraphNode new sections will be automatically created in the Inspector called 'Slot'. When 'Slot' is expanded you will see list with index number for each slot. You can click on each of them to expand further. - In the Inspector you can enable (show) or disable (hide) slots. By default, all slots are disabled so you may not see any slots on your GraphNode initially. You can assign a type to each slot. Only slots of the same type will be able to connect to each other. You can also assign colors to slots. A tuple of input and output slots is defined for each GUI element included in the GraphNode. Input connections are on the left and output connections are on the right side of GraphNode. Only enabled slots are counted as connections. + GraphNode allows to create nodes for a [GraphEdit] graph with customizable content based on its child [Control]s. GraphNode is a [Container] and is responsible for placing its children on screen. This works similar to [VBoxContainer]. Children, in turn, provide GraphNode with so-called slots, each of which can have a connection port on either side. This is similar to how [TabContainer] uses children to create the tabs. + Each GraphNode slot is defined by its index and can provide the node with up to two ports: one on the left, and one on the right. By convention the left port is also referred to as the input port and the right port is referred to as the output port. Each port can be enabled and configured individually, using different type and color. The type is an arbitrary value that you can define using your own considerations. The parent [GraphEdit] will receive this information on each connect and disconnect request. + Slots can be configured in the Inspector dock once you add at least one child [Control]. The properties are grouped by each slot's index in the "Slot" section. + [b]Note:[/b] While GraphNode is set up using slots and slot indices, connections are made between the ports which are enabled. Because of that [GraphEdit] uses port's index and not slot's index. You can use [method get_connection_input_slot] and [method get_connection_output_slot] to get the slot index from the port index. </description> <tutorials> </tutorials> @@ -19,16 +20,16 @@ </method> <method name="clear_slot"> <return type="void" /> - <param index="0" name="idx" type="int" /> + <param index="0" name="slot_index" type="int" /> <description> - Disables input and output slot whose index is [param idx]. + Disables input and output slot whose index is [param slot_index]. </description> </method> <method name="get_connection_input_color"> <return type="Color" /> - <param index="0" name="idx" type="int" /> + <param index="0" name="port" type="int" /> <description> - Returns the [Color] of the input connection [param idx]. + Returns the [Color] of the input connection [param port]. </description> </method> <method name="get_connection_input_count"> @@ -39,30 +40,37 @@ </method> <method name="get_connection_input_height"> <return type="int" /> - <param index="0" name="idx" type="int" /> + <param index="0" name="port" type="int" /> <description> - Returns the height of the input connection [param idx]. + Returns the height of the input connection [param port]. </description> </method> <method name="get_connection_input_position"> <return type="Vector2" /> - <param index="0" name="idx" type="int" /> + <param index="0" name="port" type="int" /> + <description> + Returns the position of the input connection [param port]. + </description> + </method> + <method name="get_connection_input_slot"> + <return type="int" /> + <param index="0" name="port" type="int" /> <description> - Returns the position of the input connection [param idx]. + Returns the corresponding slot index of the input connection [param port]. </description> </method> <method name="get_connection_input_type"> <return type="int" /> - <param index="0" name="idx" type="int" /> + <param index="0" name="port" type="int" /> <description> - Returns the type of the input connection [param idx]. + Returns the type of the input connection [param port]. </description> </method> <method name="get_connection_output_color"> <return type="Color" /> - <param index="0" name="idx" type="int" /> + <param index="0" name="port" type="int" /> <description> - Returns the [Color] of the output connection [param idx]. + Returns the [Color] of the output connection [param port]. </description> </method> <method name="get_connection_output_count"> @@ -73,150 +81,157 @@ </method> <method name="get_connection_output_height"> <return type="int" /> - <param index="0" name="idx" type="int" /> + <param index="0" name="port" type="int" /> <description> - Returns the height of the output connection [param idx]. + Returns the height of the output connection [param port]. </description> </method> <method name="get_connection_output_position"> <return type="Vector2" /> - <param index="0" name="idx" type="int" /> + <param index="0" name="port" type="int" /> + <description> + Returns the position of the output connection [param port]. + </description> + </method> + <method name="get_connection_output_slot"> + <return type="int" /> + <param index="0" name="port" type="int" /> <description> - Returns the position of the output connection [param idx]. + Returns the corresponding slot index of the output connection [param port]. </description> </method> <method name="get_connection_output_type"> <return type="int" /> - <param index="0" name="idx" type="int" /> + <param index="0" name="port" type="int" /> <description> - Returns the type of the output connection [param idx]. + Returns the type of the output connection [param port]. </description> </method> <method name="get_slot_color_left" qualifiers="const"> <return type="Color" /> - <param index="0" name="idx" type="int" /> + <param index="0" name="slot_index" type="int" /> <description> - Returns the left (input) [Color] of the slot [param idx]. + Returns the left (input) [Color] of the slot [param slot_index]. </description> </method> <method name="get_slot_color_right" qualifiers="const"> <return type="Color" /> - <param index="0" name="idx" type="int" /> + <param index="0" name="slot_index" type="int" /> <description> - Returns the right (output) [Color] of the slot [param idx]. + Returns the right (output) [Color] of the slot [param slot_index]. </description> </method> <method name="get_slot_type_left" qualifiers="const"> <return type="int" /> - <param index="0" name="idx" type="int" /> + <param index="0" name="slot_index" type="int" /> <description> - Returns the left (input) type of the slot [param idx]. + Returns the left (input) type of the slot [param slot_index]. </description> </method> <method name="get_slot_type_right" qualifiers="const"> <return type="int" /> - <param index="0" name="idx" type="int" /> + <param index="0" name="slot_index" type="int" /> <description> - Returns the right (output) type of the slot [param idx]. + Returns the right (output) type of the slot [param slot_index]. </description> </method> <method name="is_slot_draw_stylebox" qualifiers="const"> <return type="bool" /> - <param index="0" name="idx" type="int" /> + <param index="0" name="slot_index" type="int" /> <description> - Returns true if the background [StyleBox] of the slot [param idx] is drawn. + Returns true if the background [StyleBox] of the slot [param slot_index] is drawn. </description> </method> <method name="is_slot_enabled_left" qualifiers="const"> <return type="bool" /> - <param index="0" name="idx" type="int" /> + <param index="0" name="slot_index" type="int" /> <description> - Returns [code]true[/code] if left (input) side of the slot [param idx] is enabled. + Returns [code]true[/code] if left (input) side of the slot [param slot_index] is enabled. </description> </method> <method name="is_slot_enabled_right" qualifiers="const"> <return type="bool" /> - <param index="0" name="idx" type="int" /> + <param index="0" name="slot_index" type="int" /> <description> - Returns [code]true[/code] if right (output) side of the slot [param idx] is enabled. + Returns [code]true[/code] if right (output) side of the slot [param slot_index] is enabled. </description> </method> <method name="set_slot"> <return type="void" /> - <param index="0" name="idx" type="int" /> - <param index="1" name="enable_left" type="bool" /> + <param index="0" name="slot_index" type="int" /> + <param index="1" name="enable_left_port" type="bool" /> <param index="2" name="type_left" type="int" /> <param index="3" name="color_left" type="Color" /> - <param index="4" name="enable_right" type="bool" /> + <param index="4" name="enable_right_port" type="bool" /> <param index="5" name="type_right" type="int" /> <param index="6" name="color_right" type="Color" /> - <param index="7" name="custom_left" type="Texture2D" default="null" /> - <param index="8" name="custom_right" type="Texture2D" default="null" /> - <param index="9" name="enable" type="bool" default="true" /> - <description> - Sets properties of the slot with ID [param idx]. - If [param enable_left]/[param enable_right], a port will appear and the slot will be able to be connected from this side. - [param type_left]/[param type_right] is an arbitrary type of the port. Only ports with the same type values can be connected and negative values will disallow all connections to be made via user inputs. - [param color_left]/[param color_right] is the tint of the port's icon on this side. - [param custom_left]/[param custom_right] is a custom texture for this side's port. - [b]Note:[/b] This method only sets properties of the slot. To create the slot, add a [Control]-derived child to the GraphNode. - Individual properties can be set using one of the [code]set_slot_*[/code] methods. You must enable at least one side of the slot to do so. + <param index="7" name="custom_icon_left" type="Texture2D" default="null" /> + <param index="8" name="custom_icon_right" type="Texture2D" default="null" /> + <param index="9" name="draw_stylebox" type="bool" default="true" /> + <description> + Sets properties of the slot with the [param slot_index] index. + If [param enable_left_port]/[param enable_right_port] is [code]true[/code], a port will appear and the slot will be able to be connected from this side. + With [param type_left]/[param type_right] an arbitrary type can be assigned to each port. Two ports can be connected if they share the same type, or if the connection between their types is allowed in the parent [GraphEdit] (see [method GraphEdit.add_valid_connection_type]). Keep in mind that the [GraphEdit] has the final say in accepting the connection. Type compatibility simply allows the [signal GraphEdit.connection_request] signal to be emitted. + Ports can be further customized using [param color_left]/[param color_right] and [param custom_icon_left]/[param custom_icon_right]. The color parameter adds a tint to the icon. The custom icon can be used to override the default port dot. + Additionally, [param draw_stylebox] can be used to enable or disable drawing of the background stylebox for each slot. See [theme_item slot]. + Individual properties can also be set using one of the [code]set_slot_*[/code] methods. + [b]Note:[/b] This method only sets properties of the slot. To create the slot itself, add a [Control]-derived child to the GraphNode. </description> </method> <method name="set_slot_color_left"> <return type="void" /> - <param index="0" name="idx" type="int" /> - <param index="1" name="color_left" type="Color" /> + <param index="0" name="slot_index" type="int" /> + <param index="1" name="color" type="Color" /> <description> - Sets the [Color] of the left (input) side of the slot [param idx] to [param color_left]. + Sets the [Color] of the left (input) side of the slot [param slot_index] to [param color]. </description> </method> <method name="set_slot_color_right"> <return type="void" /> - <param index="0" name="idx" type="int" /> - <param index="1" name="color_right" type="Color" /> + <param index="0" name="slot_index" type="int" /> + <param index="1" name="color" type="Color" /> <description> - Sets the [Color] of the right (output) side of the slot [param idx] to [param color_right]. + Sets the [Color] of the right (output) side of the slot [param slot_index] to [param color]. </description> </method> <method name="set_slot_draw_stylebox"> <return type="void" /> - <param index="0" name="idx" type="int" /> - <param index="1" name="draw_stylebox" type="bool" /> + <param index="0" name="slot_index" type="int" /> + <param index="1" name="enable" type="bool" /> <description> - Toggles the background [StyleBox] of the slot [param idx]. + Toggles the background [StyleBox] of the slot [param slot_index]. </description> </method> <method name="set_slot_enabled_left"> <return type="void" /> - <param index="0" name="idx" type="int" /> - <param index="1" name="enable_left" type="bool" /> + <param index="0" name="slot_index" type="int" /> + <param index="1" name="enable" type="bool" /> <description> - Toggles the left (input) side of the slot [param idx]. If [param enable_left] is [code]true[/code], a port will appear on the left side and the slot will be able to be connected from this side. + Toggles the left (input) side of the slot [param slot_index]. If [param enable] is [code]true[/code], a port will appear on the left side and the slot will be able to be connected from this side. </description> </method> <method name="set_slot_enabled_right"> <return type="void" /> - <param index="0" name="idx" type="int" /> - <param index="1" name="enable_right" type="bool" /> + <param index="0" name="slot_index" type="int" /> + <param index="1" name="enable" type="bool" /> <description> - Toggles the right (output) side of the slot [param idx]. If [param enable_right] is [code]true[/code], a port will appear on the right side and the slot will be able to be connected from this side. + Toggles the right (output) side of the slot [param slot_index]. If [param enable] is [code]true[/code], a port will appear on the right side and the slot will be able to be connected from this side. </description> </method> <method name="set_slot_type_left"> <return type="void" /> - <param index="0" name="idx" type="int" /> - <param index="1" name="type_left" type="int" /> + <param index="0" name="slot_index" type="int" /> + <param index="1" name="type" type="int" /> <description> - Sets the left (input) type of the slot [param idx] to [param type_left]. If the value is negative, all connections will be disallowed to be created via user inputs. + Sets the left (input) type of the slot [param slot_index] to [param type]. If the value is negative, all connections will be disallowed to be created via user inputs. </description> </method> <method name="set_slot_type_right"> <return type="void" /> - <param index="0" name="idx" type="int" /> - <param index="1" name="type_right" type="int" /> + <param index="0" name="slot_index" type="int" /> + <param index="1" name="type" type="int" /> <description> - Sets the right (output) type of the slot [param idx] to [param type_right]. If the value is negative, all connections will be disallowed to be created via user inputs. + Sets the right (output) type of the slot [param slot_index] to [param type]. If the value is negative, all connections will be disallowed to be created via user inputs. </description> </method> </methods> diff --git a/doc/classes/HMACContext.xml b/doc/classes/HMACContext.xml index 52d4fce28f..706ee30963 100644 --- a/doc/classes/HMACContext.xml +++ b/doc/classes/HMACContext.xml @@ -32,22 +32,22 @@ public class CryptoNode : Node { private HMACContext ctx = new HMACContext(); + public override void _Ready() { - PackedByteArray key = String("supersecret").to_utf8(); - Error err = ctx.Start(HashingContext.HASH_SHA256, key); - GD.Assert(err == OK); - PackedByteArray msg1 = String("this is ").to_utf8(); - PackedByteArray msg2 = String("super duper secret").to_utf8(); + byte[] key = "supersecret".ToUTF8(); + Error err = ctx.Start(HashingContext.HashType.Sha256, key); + Debug.Assert(err == Error.Ok); + byte[] msg1 = "this is ".ToUTF8(); + byte[] msg2 = "super duper secret".ToUTF8(); err = ctx.Update(msg1); - GD.Assert(err == OK); + Debug.Assert(err == Error.Ok); err = ctx.Update(msg2); - GD.Assert(err == OK); - PackedByteArray hmac = ctx.Finish(); + Debug.Assert(err == Error.Ok); + byte[] hmac = ctx.Finish(); GD.Print(hmac.HexEncode()); } } - [/csharp] [/codeblocks] </description> diff --git a/doc/classes/ImageTextureLayered.xml b/doc/classes/ImageTextureLayered.xml index f5b338542b..f5786f070a 100644 --- a/doc/classes/ImageTextureLayered.xml +++ b/doc/classes/ImageTextureLayered.xml @@ -11,6 +11,8 @@ <return type="int" enum="Error" /> <param index="0" name="images" type="Image[]" /> <description> + Creates an [ImageTextureLayered] from an array of [Image]s. The first image decides the width, height, image format and mipmapping setting. The other images must have the same width, height, image format and mipmapping setting. + Each [Image] represents one [code]layer[/code]. </description> </method> <method name="update_layer"> @@ -18,6 +20,10 @@ <param index="0" name="image" type="Image" /> <param index="1" name="layer" type="int" /> <description> + Replaces the existing [Image] data at the given [code]layer[/code] with this new image. + The given [Image] must have the same width, height, image format and mipmapping setting (a [code]bool[/code] value) as the rest of the referenced images. + If the image format is unsupported, it will be decompressed and converted to a similar and supported [enum Image.Format]. + The update is immediate: synced with the draw. </description> </method> </methods> diff --git a/doc/classes/ImporterMesh.xml b/doc/classes/ImporterMesh.xml index 3c3dbe4d87..1c9655c266 100644 --- a/doc/classes/ImporterMesh.xml +++ b/doc/classes/ImporterMesh.xml @@ -43,10 +43,12 @@ <return type="void" /> <param index="0" name="normal_merge_angle" type="float" /> <param index="1" name="normal_split_angle" type="float" /> + <param index="2" name="bone_transform_array" type="Array" /> <description> Generates all lods for this ImporterMesh. [param normal_merge_angle] and [param normal_split_angle] are in degrees and used in the same way as the importer settings in [code]lods[/code]. As a good default, use 25 and 60 respectively. The number of generated lods can be accessed using [method get_surface_lod_count], and each LOD is available in [method get_surface_lod_size] and [method get_surface_lod_indices]. + [param bone_transform_array] is an [Array] which can be either empty or contain [Transform3D]s which, for each of the mesh's bone IDs, will apply mesh skinning when generating the LOD mesh variations. This is usually used to account for discrepancies in scale between the mesh itself and its skinning data. </description> </method> <method name="get_blend_shape_count" qualifiers="const"> diff --git a/doc/classes/JSON.xml b/doc/classes/JSON.xml index 46e46cc164..38ddca2727 100644 --- a/doc/classes/JSON.xml +++ b/doc/classes/JSON.xml @@ -6,7 +6,7 @@ <description> The [JSON] enables all data types to be converted to and from a JSON string. This useful for serializing data to save to a file or send over the network. [method stringify] is used to convert any data type into a JSON string. - [method parse] is used to convert any existing JSON data into a [Variant] that can be used within Godot. If successfully parsed, use [method get_data] to retrieve the [Variant], and use [code]typeof[/code] to check if the Variant's type is what you expect. JSON Objects are converted into a [Dictionary], but JSON data can be used to store [Array]s, numbers, [String]s and even just a boolean. + [method parse] is used to convert any existing JSON data into a [Variant] that can be used within Godot. If successfully parsed, use [member data] to retrieve the [Variant], and use [code]typeof[/code] to check if the Variant's type is what you expect. JSON Objects are converted into a [Dictionary], but JSON data can be used to store [Array]s, numbers, [String]s and even just a boolean. [b]Example[/b] [codeblock] var data_to_send = ["a", "b", "c"] @@ -16,7 +16,7 @@ # Retrieve data var error = json.parse(json_string) if error == OK: - var data_received = json.get_data() + var data_received = json.data if typeof(data_received) == TYPE_ARRAY: print(data_received) # Prints array else: @@ -32,13 +32,6 @@ <tutorials> </tutorials> <methods> - <method name="get_data" qualifiers="const"> - <return type="Variant" /> - <description> - Returns the [Variant] containing the data of a successful [method parse]. - [b]Note:[/b] It will return [code]Null[/code] if the last call to parse was unsuccessful or [method parse] has not yet been called. - </description> - </method> <method name="get_error_line" qualifiers="const"> <return type="int" /> <description> @@ -56,7 +49,7 @@ <param index="0" name="json_string" type="String" /> <description> Attempts to parse the [param json_string] provided. - Returns an [enum Error]. If the parse was successful, it returns [code]OK[/code] and the result can be retrieved using [method get_data]. If unsuccessful, use [method get_error_line] and [method get_error_message] for identifying the source of the failure. + Returns an [enum Error]. If the parse was successful, it returns [code]OK[/code] and the result can be retrieved using [member data]. If unsuccessful, use [method get_error_line] and [method get_error_message] for identifying the source of the failure. Non-static variant of [method parse_string], if you want custom error handling. </description> </method> @@ -118,4 +111,9 @@ </description> </method> </methods> + <members> + <member name="data" type="Variant" setter="set_data" getter="get_data" default="null"> + Contains the parsed JSON data in [Variant] form. + </member> + </members> </class> diff --git a/doc/classes/LightmapGI.xml b/doc/classes/LightmapGI.xml index dd8c7be489..53dae1a8e6 100644 --- a/doc/classes/LightmapGI.xml +++ b/doc/classes/LightmapGI.xml @@ -17,7 +17,7 @@ <member name="bias" type="float" setter="set_bias" getter="get_bias" default="0.0005"> The bias to use when computing shadows. Increasing [member bias] can fix shadow acne on the resulting baked lightmap, but can introduce peter-panning (shadows not connecting to their casters). Real-time [Light3D] shadows are not affected by this [member bias] property. </member> - <member name="bounces" type="int" setter="set_bounces" getter="get_bounces" default="1"> + <member name="bounces" type="int" setter="set_bounces" getter="get_bounces" default="3"> Number of light bounces that are taken into account during baking. Higher values result in brighter, more realistic lighting, at the cost of longer bake times. If set to [code]0[/code], only environment lighting, direct light and emissive lighting is baked. </member> <member name="camera_attributes" type="CameraAttributes" setter="set_camera_attributes" getter="get_camera_attributes"> @@ -36,10 +36,10 @@ <member name="environment_custom_sky" type="Sky" setter="set_environment_custom_sky" getter="get_environment_custom_sky"> The sky to use as a source of environment lighting. Only effective if [member environment_mode] is [constant ENVIRONMENT_MODE_CUSTOM_SKY]. </member> - <member name="environment_mode" type="int" setter="set_environment_mode" getter="get_environment_mode" enum="LightmapGI.EnvironmentMode" default="0"> + <member name="environment_mode" type="int" setter="set_environment_mode" getter="get_environment_mode" enum="LightmapGI.EnvironmentMode" default="1"> The environment mode to use when baking lightmaps. </member> - <member name="generate_probes_subdiv" type="int" setter="set_generate_probes" getter="get_generate_probes" enum="LightmapGI.GenerateProbes" default="0"> + <member name="generate_probes_subdiv" type="int" setter="set_generate_probes" getter="get_generate_probes" enum="LightmapGI.GenerateProbes" default="2"> The level of subdivision to use when automatically generating [LightmapProbe]s for dynamic object lighting. Higher values result in more accurate indirect lighting on dynamic objects, at the cost of longer bake times and larger file sizes. [b]Note:[/b] Automatically generated [LightmapProbe]s are not visible as nodes in the Scene tree dock, and cannot be modified this way after they are generated. [b]Note:[/b] Regardless of [member generate_probes_subdiv], direct lighting on dynamic objects is always applied using [Light3D] nodes in real-time. diff --git a/doc/classes/MultiMesh.xml b/doc/classes/MultiMesh.xml index bae2335cfb..ce2b5f2584 100644 --- a/doc/classes/MultiMesh.xml +++ b/doc/classes/MultiMesh.xml @@ -1,13 +1,15 @@ <?xml version="1.0" encoding="UTF-8" ?> <class name="MultiMesh" inherits="Resource" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> <brief_description> - Provides high-performance mesh instancing. + Provides high-performance drawing of a mesh multiple times using GPU instancing. </brief_description> <description> MultiMesh provides low-level mesh instancing. Drawing thousands of [MeshInstance3D] nodes can be slow, since each object is submitted to the GPU then drawn individually. MultiMesh is much faster as it can draw thousands of instances with a single draw call, resulting in less API overhead. As a drawback, if the instances are too far away from each other, performance may be reduced as every single instance will always render (they are spatially indexed as one, for the whole object). Since instances may have any behavior, the AABB used for visibility must be provided by the user. + [b]Note:[/b] A MultiMesh is a single object, therefore the same maximum lights per object restriction applies. This means, that once the maximum lights are consumed by one or more instances, the rest of the MultiMesh instances will [b]not[/b] receive any lighting. + [b]Note:[/b] Blend Shapes will be ignored if used in a MultiMesh. </description> <tutorials> <link title="Animating thousands of fish with MultiMeshInstance">$DOCS_URL/tutorials/performance/vertex_animation/animating_thousands_of_fish.html</link> @@ -24,7 +26,7 @@ <return type="Color" /> <param index="0" name="instance" type="int" /> <description> - Gets a specific instance's color. + Gets a specific instance's color multiplier. </description> </method> <method name="get_instance_custom_data" qualifiers="const"> @@ -53,8 +55,8 @@ <param index="0" name="instance" type="int" /> <param index="1" name="color" type="Color" /> <description> - Sets the color of a specific instance by [i]multiplying[/i] the mesh's existing vertex colors. - For the color to take effect, ensure that [member use_colors] is [code]true[/code] on the [MultiMesh] and [member BaseMaterial3D.vertex_color_use_as_albedo] is [code]true[/code] on the material. If the color doesn't look as expected, make sure the material's albedo color is set to pure white ([code]Color(1, 1, 1)[/code]). + Sets the color of a specific instance by [i]multiplying[/i] the mesh's existing vertex colors. This allows for different color tinting per instance. + For the color to take effect, ensure that [member use_colors] is [code]true[/code] on the [MultiMesh] and [member BaseMaterial3D.vertex_color_use_as_albedo] is [code]true[/code] on the material. If you intend to set an absolute color instead of tinting, make sure the material's albedo color is set to pure white ([code]Color(1, 1, 1)[/code]). </description> </method> <method name="set_instance_custom_data"> @@ -64,6 +66,7 @@ <description> Sets custom data for a specific instance. Although [Color] is used, it is just a container for 4 floating point numbers. For the custom data to be used, ensure that [member use_custom_data] is [code]true[/code]. + This custom instance data has to be manually accessed in your custom shader using [code]INSTANCE_CUSTOM[/code]. </description> </method> <method name="set_instance_transform"> @@ -87,28 +90,33 @@ <member name="buffer" type="PackedFloat32Array" setter="set_buffer" getter="get_buffer" default="PackedFloat32Array()"> </member> <member name="color_array" type="PackedColorArray" setter="_set_color_array" getter="_get_color_array"> + See [method set_instance_color]. </member> <member name="custom_data_array" type="PackedColorArray" setter="_set_custom_data_array" getter="_get_custom_data_array"> + See [method set_instance_custom_data]. </member> <member name="instance_count" type="int" setter="set_instance_count" getter="get_instance_count" default="0"> Number of instances that will get drawn. This clears and (re)sizes the buffers. Setting data format or flags afterwards will have no effect. By default, all instances are drawn but you can limit this with [member visible_instance_count]. </member> <member name="mesh" type="Mesh" setter="set_mesh" getter="get_mesh"> - Mesh to be drawn. + [Mesh] resource to be instanced. + The looks of the individual instances can be modified using [method set_instance_color] and [method set_instance_custom_data]. </member> <member name="transform_2d_array" type="PackedVector2Array" setter="_set_transform_2d_array" getter="_get_transform_2d_array"> + See [method set_instance_transform_2d]. </member> <member name="transform_array" type="PackedVector3Array" setter="_set_transform_array" getter="_get_transform_array"> + See [method set_instance_transform]. </member> <member name="transform_format" type="int" setter="set_transform_format" getter="get_transform_format" enum="MultiMesh.TransformFormat" default="0"> Format of transform used to transform mesh, either 2D or 3D. </member> <member name="use_colors" type="bool" setter="set_use_colors" getter="is_using_colors" default="false"> - If [code]true[/code], the [MultiMesh] will use color data (see [member color_array]). + If [code]true[/code], the [MultiMesh] will use color data (see [method set_instance_color]). Can only be set when [member instance_count] is [code]0[/code] or less. This means that you need to call this method before setting the instance count, or temporarily reset it to [code]0[/code]. </member> <member name="use_custom_data" type="bool" setter="set_use_custom_data" getter="is_using_custom_data" default="false"> - If [code]true[/code], the [MultiMesh] will use custom data (see [member custom_data_array]). + If [code]true[/code], the [MultiMesh] will use custom data (see [method set_instance_custom_data]). Can only be set when [member instance_count] is [code]0[/code] or less. This means that you need to call this method before setting the instance count, or temporarily reset it to [code]0[/code]. </member> <member name="visible_instance_count" type="int" setter="set_visible_instance_count" getter="get_visible_instance_count" default="-1"> Limits the number of instances drawn, -1 draws all instances. Changing this does not change the sizes of the buffers. diff --git a/doc/classes/Node.xml b/doc/classes/Node.xml index 92beefa5fc..d8ad65082f 100644 --- a/doc/classes/Node.xml +++ b/doc/classes/Node.xml @@ -514,7 +514,7 @@ <param index="0" name="child_node" type="Node" /> <param index="1" name="to_position" type="int" /> <description> - Moves a child node to a different position (order) among the other children. Since calls, signals, etc are performed by tree order, changing the order of children nodes may be useful. + Moves a child node to a different position (order) among the other children. Since calls, signals, etc are performed by tree order, changing the order of children nodes may be useful. If [param to_position] is negative, the index will be counted from the end. [b]Note:[/b] Internal children can only be moved within their expected "internal range" (see [code]internal[/code] parameter in [method add_child]). </description> </method> @@ -577,12 +577,6 @@ Queues a node for deletion at the end of the current frame. When deleted, all of its child nodes will be deleted as well. This method ensures it's safe to delete the node, contrary to [method Object.free]. Use [method Object.is_queued_for_deletion] to check whether a node will be deleted at the end of the frame. </description> </method> - <method name="remove_and_skip"> - <return type="void" /> - <description> - Removes a node and sets all its children as children of the parent node (if it exists). All event subscriptions that pass by the removed node will be unsubscribed. - </description> - </method> <method name="remove_child"> <return type="void" /> <param index="0" name="node" type="Node" /> diff --git a/doc/classes/Node3D.xml b/doc/classes/Node3D.xml index c8e2f1ac68..96ce10745d 100644 --- a/doc/classes/Node3D.xml +++ b/doc/classes/Node3D.xml @@ -331,6 +331,10 @@ <constant name="NOTIFICATION_VISIBILITY_CHANGED" value="43"> Node3D nodes receives this notification when their visibility changes. </constant> + <constant name="NOTIFICATION_LOCAL_TRANSFORM_CHANGED" value="44"> + Node3D nodes receives this notification when their local transform changes. This is not received when the transform of a parent node is changed. + In order for [constant NOTIFICATION_LOCAL_TRANSFORM_CHANGED] to work, users first need to ask for it, with [method set_notify_local_transform]. + </constant> <constant name="ROTATION_EDIT_MODE_EULER" value="0" enum="RotationEditMode"> </constant> <constant name="ROTATION_EDIT_MODE_QUATERNION" value="1" enum="RotationEditMode"> diff --git a/doc/classes/OS.xml b/doc/classes/OS.xml index 059766656f..d920c45de4 100644 --- a/doc/classes/OS.xml +++ b/doc/classes/OS.xml @@ -216,6 +216,15 @@ Not to be confused with [method get_user_data_dir], which returns the [i]project-specific[/i] user data path. </description> </method> + <method name="get_distribution_name" qualifiers="const"> + <return type="String" /> + <description> + Returns the name of the distribution for Linux and BSD platforms (e.g. Ubuntu, Manjaro, OpenBSD, etc.). + Returns the same value as [method get_name] for stock Android ROMs, but attempts to return the custom ROM name for popular Android derivatives such as LineageOS. + Returns the same value as [method get_name] for other platforms. + [b]Note:[/b] This method is not supported on the web platform. It returns an empty string. + </description> + </method> <method name="get_environment" qualifiers="const"> <return type="String" /> <param index="0" name="variable" type="String" /> @@ -430,6 +439,18 @@ Not to be confused with [method get_data_dir], which returns the [i]global[/i] (non-project-specific) user home directory. </description> </method> + <method name="get_version" qualifiers="const"> + <return type="String" /> + <description> + Returns the exact production and build version of the operating system. This is different from the branded version used in marketing. This helps to distinguish between different releases of operating systems, including minor versions, and insider and custom builds. + For Windows, the major and minor version are returned, as well as the build number. For example, the returned string can look like [code]10.0.9926[/code] for a build of Windows 10, and it can look like [code]6.1.7601[/code] for a build of Windows 7 SP1. + For rolling distributions, such as Arch Linux, an empty string is returned. + For macOS and iOS, the major and minor version are returned, as well as the patch number. + For UWP, the device family version is returned. + For Android, the SDK version and the incremental build number are returned. If it's a custom ROM, it attempts to return its version instead. + [b]Note:[/b] This method is not supported on the web platform. It returns an empty string. + </description> + </method> <method name="has_environment" qualifiers="const"> <return type="bool" /> <param index="0" name="variable" type="String" /> @@ -501,7 +522,7 @@ <return type="int" enum="Error" /> <param index="0" name="path" type="String" /> <description> - Moves the file or directory to the system's recycle bin. See also [method Directory.remove]. + Moves the file or directory to the system's recycle bin. See also [method DirAccess.remove]. The method takes only global paths, so you may need to use [method ProjectSettings.globalize_path]. Do not use it for files in [code]res://[/code] as it will not work in exported project. [b]Note:[/b] If the user has disabled the recycle bin on their system, the file will be permanently deleted instead. [codeblock] diff --git a/doc/classes/PackedByteArray.xml b/doc/classes/PackedByteArray.xml index efb559522a..ccf012f82c 100644 --- a/doc/classes/PackedByteArray.xml +++ b/doc/classes/PackedByteArray.xml @@ -65,7 +65,7 @@ <return type="PackedByteArray" /> <param index="0" name="compression_mode" type="int" default="0" /> <description> - Returns a new [PackedByteArray] with the data compressed. Set the compression mode using one of [enum File.CompressionMode]'s constants. + Returns a new [PackedByteArray] with the data compressed. Set the compression mode using one of [enum FileAccess.CompressionMode]'s constants. </description> </method> <method name="count" qualifiers="const"> @@ -173,7 +173,7 @@ <param index="0" name="buffer_size" type="int" /> <param index="1" name="compression_mode" type="int" default="0" /> <description> - Returns a new [PackedByteArray] with the data decompressed. Set [param buffer_size] to the size of the uncompressed data. Set the compression mode using one of [enum File.CompressionMode]'s constants. + Returns a new [PackedByteArray] with the data decompressed. Set [param buffer_size] to the size of the uncompressed data. Set the compression mode using one of [enum FileAccess.CompressionMode]'s constants. </description> </method> <method name="decompress_dynamic" qualifiers="const"> @@ -181,7 +181,7 @@ <param index="0" name="max_output_size" type="int" /> <param index="1" name="compression_mode" type="int" default="0" /> <description> - Returns a new [PackedByteArray] with the data decompressed. Set the compression mode using one of [enum File.CompressionMode]'s constants. [b]This method only accepts gzip and deflate compression modes.[/b] + Returns a new [PackedByteArray] with the data decompressed. Set the compression mode using one of [enum FileAccess.CompressionMode]'s constants. [b]This method only accepts gzip and deflate compression modes.[/b] This method is potentially slower than [code]decompress[/code], as it may have to re-allocate its output buffer multiple times while decompressing, whereas [code]decompress[/code] knows it's output buffer size from the beginning. GZIP has a maximal compression ratio of 1032:1, meaning it's very possible for a small compressed payload to decompress to a potentially very large output. To guard against this, you may provide a maximum size this function is allowed to allocate in bytes via [param max_output_size]. Passing -1 will allow for unbounded output. If any positive value is passed, and the decompression exceeds that amount in bytes, then an error will be returned. </description> diff --git a/doc/classes/PanoramaSkyMaterial.xml b/doc/classes/PanoramaSkyMaterial.xml index 21c7f29585..0c27037f28 100644 --- a/doc/classes/PanoramaSkyMaterial.xml +++ b/doc/classes/PanoramaSkyMaterial.xml @@ -4,9 +4,9 @@ A [Material] used with [Sky] to draw a background texture. </brief_description> <description> - A resource referenced in a [Sky] that is used to draw a background. The Panorama sky material functions similar to skyboxes in other engines, except it uses an equirectangular sky map instead of a cube map. + A resource referenced in a [Sky] that is used to draw a background. The Panorama sky material functions similar to skyboxes in other engines, except it uses an equirectangular sky map instead of a cubemap. Using an HDR panorama is strongly recommended for accurate, high-quality reflections. Godot supports the Radiance HDR ([code].hdr[/code]) and OpenEXR ([code].exr[/code]) image formats for this purpose. - You can use [url=https://danilw.github.io/GLSL-howto/cubemap_to_panorama_js/cubemap_to_panorama.html]this tool[/url] to convert a cube map to an equirectangular sky map. + You can use [url=https://danilw.github.io/GLSL-howto/cubemap_to_panorama_js/cubemap_to_panorama.html]this tool[/url] to convert a cubemap to an equirectangular sky map. </description> <tutorials> </tutorials> diff --git a/doc/classes/PhysicsBody2D.xml b/doc/classes/PhysicsBody2D.xml index e8d7ac9920..59660b4de5 100644 --- a/doc/classes/PhysicsBody2D.xml +++ b/doc/classes/PhysicsBody2D.xml @@ -28,11 +28,13 @@ <param index="0" name="distance" type="Vector2" /> <param index="1" name="test_only" type="bool" default="false" /> <param index="2" name="safe_margin" type="float" default="0.08" /> + <param index="3" name="recovery_as_collision" type="bool" default="false" /> <description> Moves the body along the vector [param distance]. In order to be frame rate independent in [method Node._physics_process] or [method Node._process], [param distance] should be computed using [code]delta[/code]. Returns a [KinematicCollision2D], which contains information about the collision when stopped, or when touching another body along the motion. If [param test_only] is [code]true[/code], the body does not move but the would-be collision information is given. [param safe_margin] is the extra margin used for collision recovery (see [member CharacterBody2D.safe_margin] for more details). + If [param recovery_as_collision] is [code]true[/code], any depenetration from the recovery phase is also reported as a collision; this is used e.g. by [CharacterBody2D] for improving floor detection during floor snapping. </description> </method> <method name="remove_collision_exception_with"> @@ -48,11 +50,13 @@ <param index="1" name="distance" type="Vector2" /> <param index="2" name="collision" type="KinematicCollision2D" default="null" /> <param index="3" name="safe_margin" type="float" default="0.08" /> + <param index="4" name="recovery_as_collision" type="bool" default="false" /> <description> Checks for collisions without moving the body. In order to be frame rate independent in [method Node._physics_process] or [method Node._process], [param distance] should be computed using [code]delta[/code]. Virtually sets the node's position, scale and rotation to that of the given [Transform2D], then tries to move the body along the vector [param distance]. Returns [code]true[/code] if a collision would stop the body from moving along the whole path. [param collision] is an optional object of type [KinematicCollision2D], which contains additional information about the collision when stopped, or when touching another body along the motion. [param safe_margin] is the extra margin used for collision recovery (see [member CharacterBody2D.safe_margin] for more details). + If [param recovery_as_collision] is [code]true[/code], any depenetration from the recovery phase is also reported as a collision; this is useful for checking whether the body would [i]touch[/i] any other bodies. </description> </method> </methods> diff --git a/doc/classes/PhysicsBody3D.xml b/doc/classes/PhysicsBody3D.xml index 310671274f..bf7882a1ea 100644 --- a/doc/classes/PhysicsBody3D.xml +++ b/doc/classes/PhysicsBody3D.xml @@ -35,12 +35,14 @@ <param index="0" name="distance" type="Vector3" /> <param index="1" name="test_only" type="bool" default="false" /> <param index="2" name="safe_margin" type="float" default="0.001" /> - <param index="3" name="max_collisions" type="int" default="1" /> + <param index="3" name="recovery_as_collision" type="bool" default="false" /> + <param index="4" name="max_collisions" type="int" default="1" /> <description> Moves the body along the vector [param distance]. In order to be frame rate independent in [method Node._physics_process] or [method Node._process], [param distance] should be computed using [code]delta[/code]. The body will stop if it collides. Returns a [KinematicCollision3D], which contains information about the collision when stopped, or when touching another body along the motion. If [param test_only] is [code]true[/code], the body does not move but the would-be collision information is given. [param safe_margin] is the extra margin used for collision recovery (see [member CharacterBody3D.safe_margin] for more details). + If [param recovery_as_collision] is [code]true[/code], any depenetration from the recovery phase is also reported as a collision; this is used e.g. by [CharacterBody3D] for improving floor detection during floor snapping. [param max_collisions] allows to retrieve more than one collision result. </description> </method> @@ -65,12 +67,14 @@ <param index="1" name="distance" type="Vector3" /> <param index="2" name="collision" type="KinematicCollision3D" default="null" /> <param index="3" name="safe_margin" type="float" default="0.001" /> - <param index="4" name="max_collisions" type="int" default="1" /> + <param index="4" name="recovery_as_collision" type="bool" default="false" /> + <param index="5" name="max_collisions" type="int" default="1" /> <description> Checks for collisions without moving the body. In order to be frame rate independent in [method Node._physics_process] or [method Node._process], [param distance] should be computed using [code]delta[/code]. Virtually sets the node's position, scale and rotation to that of the given [Transform3D], then tries to move the body along the vector [param distance]. Returns [code]true[/code] if a collision would stop the body from moving along the whole path. [param collision] is an optional object of type [KinematicCollision3D], which contains additional information about the collision when stopped, or when touching another body along the motion. [param safe_margin] is the extra margin used for collision recovery (see [member CharacterBody3D.safe_margin] for more details). + If [param recovery_as_collision] is [code]true[/code], any depenetration from the recovery phase is also reported as a collision; this is useful for checking whether the body would [i]touch[/i] any other bodies. [param max_collisions] allows to retrieve more than one collision result. </description> </method> diff --git a/doc/classes/PhysicsTestMotionParameters2D.xml b/doc/classes/PhysicsTestMotionParameters2D.xml index 4f2b62f2d9..d8f96511dd 100644 --- a/doc/classes/PhysicsTestMotionParameters2D.xml +++ b/doc/classes/PhysicsTestMotionParameters2D.xml @@ -29,8 +29,8 @@ Motion vector to define the length and direction of the motion to test. </member> <member name="recovery_as_collision" type="bool" setter="set_recovery_as_collision_enabled" getter="is_recovery_as_collision_enabled" default="false"> - If set to [code]true[/code], any depenetration from the recovery phase is reported as a collision; this is used e.g. by [method CharacterBody2D.move_and_slide] for improving floor detection when floor snapping is disabled. - If set to [code]false[/code], only collisions resulting from the motion are reported; this is used e.g. by [method PhysicsBody2D.move_and_collide]. + If set to [code]true[/code], any depenetration from the recovery phase is reported as a collision; this is used e.g. by [CharacterBody2D] for improving floor detection during floor snapping. + If set to [code]false[/code], only collisions resulting from the motion are reported, which is generally the desired behaviour. </member> </members> </class> diff --git a/doc/classes/PhysicsTestMotionParameters3D.xml b/doc/classes/PhysicsTestMotionParameters3D.xml index 5b07796a10..e8f80ae131 100644 --- a/doc/classes/PhysicsTestMotionParameters3D.xml +++ b/doc/classes/PhysicsTestMotionParameters3D.xml @@ -32,8 +32,8 @@ Motion vector to define the length and direction of the motion to test. </member> <member name="recovery_as_collision" type="bool" setter="set_recovery_as_collision_enabled" getter="is_recovery_as_collision_enabled" default="false"> - If set to [code]true[/code], any depenetration from the recovery phase is reported as a collision; this is used e.g. by [method CharacterBody3D.move_and_slide] for improving floor detection when floor snapping is disabled. - If set to [code]false[/code], only collisions resulting from the motion are detected; this is used e.g. by [method PhysicsBody3D.move_and_collide]. + If set to [code]true[/code], any depenetration from the recovery phase is reported as a collision; this is used e.g. by [CharacterBody3D] for improving floor detection during floor snapping. + If set to [code]false[/code], only collisions resulting from the motion are reported, which is generally the desired behaviour. </member> </members> </class> diff --git a/doc/classes/ProjectSettings.xml b/doc/classes/ProjectSettings.xml index 3dbf7c75e5..7c0ce656ab 100644 --- a/doc/classes/ProjectSettings.xml +++ b/doc/classes/ProjectSettings.xml @@ -159,6 +159,15 @@ Sets the order of a configuration value (influences when saved to the config file). </description> </method> + <method name="set_restart_if_changed"> + <return type="void" /> + <param index="0" name="name" type="String" /> + <param index="1" name="restart" type="bool" /> + <description> + Sets whether a setting requires restarting the editor to properly take effect. + [b]Note:[/b] This is just a hint to display to the user that the editor must be restarted for changes to take effect. Enabling [method set_restart_if_changed] does [i]not[/i] delay the setting being set when changed. + </description> + </method> <method name="set_setting"> <return type="void" /> <param index="0" name="name" type="String" /> @@ -640,10 +649,22 @@ If [code]true[/code], Blender 3D scene files with the [code].blend[/code] extension will be imported by converting them to glTF 2.0. This requires configuring a path to a Blender executable in the editor settings at [code]filesystem/import/blender/blender3_path[/code]. Blender 3.0 or later is required. </member> + <member name="filesystem/import/blender/enabled.android" type="bool" setter="" getter="" default="false"> + Override for [member filesystem/import/blender/enabled] on Android where Blender can't easily be accessed from Godot. + </member> + <member name="filesystem/import/blender/enabled.web" type="bool" setter="" getter="" default="false"> + Override for [member filesystem/import/blender/enabled] on the Web where Blender can't easily be accessed from Godot. + </member> <member name="filesystem/import/fbx/enabled" type="bool" setter="" getter="" default="true"> If [code]true[/code], Autodesk FBX 3D scene files with the [code].fbx[/code] extension will be imported by converting them to glTF 2.0. This requires configuring a path to a FBX2glTF executable in the editor settings at [code]filesystem/import/fbx/fbx2gltf_path[/code]. </member> + <member name="filesystem/import/fbx/enabled.android" type="bool" setter="" getter="" default="false"> + Override for [member filesystem/import/fbx/enabled] on Android where FBX2glTF can't easily be accessed from Godot. + </member> + <member name="filesystem/import/fbx/enabled.web" type="bool" setter="" getter="" default="false"> + Override for [member filesystem/import/fbx/enabled] on the Web where FBX2glTF can't easily be accessed from Godot. + </member> <member name="gui/common/default_scroll_deadzone" type="int" setter="" getter="" default="0"> Default value for [member ScrollContainer.scroll_deadzone], which will be used for all [ScrollContainer]s unless overridden. </member> @@ -1770,7 +1791,7 @@ Enables filtering of the volumetric fog effect prior to integration. This substantially blurs the fog which reduces fine details but also smooths out harsh edges and aliasing artifacts. Disable when more detail is required. </member> <member name="rendering/environment/volumetric_fog/volume_depth" type="int" setter="" getter="" default="64"> - Number of slices to use along the depth of the froxel buffer for volumetric fog. A lower number will be more efficient but may result in artifacts appearing during camera movement. + Number of slices to use along the depth of the froxel buffer for volumetric fog. A lower number will be more efficient but may result in artifacts appearing during camera movement. See also [member Environment.volumetric_fog_length]. </member> <member name="rendering/environment/volumetric_fog/volume_size" type="int" setter="" getter="" default="64"> Base size used to determine size of froxel buffer in the camera X-axis and Y-axis. The final size is scaled by the aspect ratio of the screen, so actual values may differ from what is set. Set a larger size for more detailed fog, set a smaller size for better performance. diff --git a/doc/classes/ResourceSaver.xml b/doc/classes/ResourceSaver.xml index b0c9056cbc..8cd701e0d8 100644 --- a/doc/classes/ResourceSaver.xml +++ b/doc/classes/ResourceSaver.xml @@ -62,10 +62,10 @@ Do not save editor-specific metadata (identified by their [code]__editor[/code] prefix). </constant> <constant name="FLAG_SAVE_BIG_ENDIAN" value="16" enum="SaverFlags" is_bitfield="true"> - Save as big endian (see [member File.big_endian]). + Save as big endian (see [member FileAccess.big_endian]). </constant> <constant name="FLAG_COMPRESS" value="32" enum="SaverFlags" is_bitfield="true"> - Compress the resource on save using [constant File.COMPRESSION_ZSTD]. Only available for binary resource types. + Compress the resource on save using [constant FileAccess.COMPRESSION_ZSTD]. Only available for binary resource types. </constant> <constant name="FLAG_REPLACE_SUBRESOURCE_PATHS" value="64" enum="SaverFlags" is_bitfield="true"> Take over the paths of the saved subresources (see [method Resource.take_over_path]). diff --git a/doc/classes/Skeleton3D.xml b/doc/classes/Skeleton3D.xml index 5a0766263a..3bd0e04b92 100644 --- a/doc/classes/Skeleton3D.xml +++ b/doc/classes/Skeleton3D.xml @@ -32,9 +32,10 @@ Removes the global pose override on all bones in the skeleton. </description> </method> - <method name="clear_bones_local_pose_override"> + <method name="clear_bones_local_pose_override" is_deprecated="true"> <return type="void" /> <description> + Deprecated. Local pose overrides will be removed. Removes the local pose override on all bones in the skeleton. </description> </method> @@ -43,7 +44,7 @@ <description> </description> </method> - <method name="execute_modifications"> + <method name="execute_modifications" is_deprecated="true"> <return type="void" /> <param index="0" name="delta" type="float" /> <param index="1" name="execution_mode" type="int" /> @@ -58,7 +59,7 @@ Returns the bone index that matches [param name] as its name. </description> </method> - <method name="force_update_all_bone_transforms"> + <method name="force_update_all_bone_transforms" is_deprecated="true"> <return type="void" /> <description> Force updates the bone transforms/poses for all bones in the skeleton. @@ -166,7 +167,7 @@ Returns the rest transform for a bone [param bone_idx]. </description> </method> - <method name="get_modification_stack"> + <method name="get_modification_stack" is_deprecated="true"> <return type="SkeletonModificationStack3D" /> <description> Returns the modification stack attached to this skeleton, if one exists. @@ -178,7 +179,7 @@ Returns an array with all of the bones that are parentless. Another way to look at this is that it returns the indexes of all the bones that are not dependent or modified by other bones in the Skeleton. </description> </method> - <method name="global_pose_to_local_pose"> + <method name="global_pose_to_local_pose" is_deprecated="true"> <return type="Transform3D" /> <param index="0" name="bone_idx" type="int" /> <param index="1" name="global_pose" type="Transform3D" /> @@ -187,15 +188,16 @@ This can be used to easily convert a global pose from [method get_bone_global_pose] to a global transform in [method set_bone_local_pose_override]. </description> </method> - <method name="global_pose_to_world_transform"> + <method name="global_pose_to_world_transform" is_deprecated="true"> <return type="Transform3D" /> <param index="0" name="global_pose" type="Transform3D" /> <description> + Deprecated. Use [Node3D] apis instead. Takes the passed-in global pose and converts it to a world transform. This can be used to easily convert a global pose from [method get_bone_global_pose] to a global transform usable with a node's transform, like [member Node3D.global_transform] for example. </description> </method> - <method name="global_pose_z_forward_to_bone_forward"> + <method name="global_pose_z_forward_to_bone_forward" is_deprecated="true"> <return type="Basis" /> <param index="0" name="bone_idx" type="int" /> <param index="1" name="basis" type="Basis" /> @@ -211,7 +213,7 @@ Returns whether the bone pose for the bone at [param bone_idx] is enabled. </description> </method> - <method name="local_pose_to_global_pose"> + <method name="local_pose_to_global_pose" is_deprecated="true"> <return type="Transform3D" /> <param index="0" name="bone_idx" type="int" /> <param index="1" name="local_pose" type="Transform3D" /> @@ -293,16 +295,17 @@ <description> Sets the global pose transform, [param pose], for the bone at [param bone_idx]. [param amount] is the interpolation strength that will be used when applying the pose, and [param persistent] determines if the applied pose will remain. - [b]Note:[/b] The pose transform needs to be a global pose! Use [method world_transform_to_global_pose] to convert a world transform, like one you can get from a [Node3D], to a global pose. + [b]Note:[/b] The pose transform needs to be a global pose! To convert a world transform from a [Node3D] to a global bone pose, multiply the [method Transform3D.affine_inverse] of the node's [member Node3D.global_transform] by the desired world transform </description> </method> - <method name="set_bone_local_pose_override"> + <method name="set_bone_local_pose_override" is_deprecated="true"> <return type="void" /> <param index="0" name="bone_idx" type="int" /> <param index="1" name="pose" type="Transform3D" /> <param index="2" name="amount" type="float" /> <param index="3" name="persistent" type="bool" default="false" /> <description> + Deprecated. Local pose overrides will be removed. Sets the local pose transform, [param pose], for the bone at [param bone_idx]. [param amount] is the interpolation strength that will be used when applying the pose, and [param persistent] determines if the applied pose will remain. [b]Note:[/b] The pose transform needs to be a local pose! Use [method global_pose_to_local_pose] to convert a global pose to a local pose. @@ -353,7 +356,7 @@ Sets the rest transform for bone [param bone_idx]. </description> </method> - <method name="set_modification_stack"> + <method name="set_modification_stack" is_deprecated="true"> <return type="void" /> <param index="0" name="modification_stack" type="SkeletonModificationStack3D" /> <description> @@ -367,10 +370,11 @@ Unparents the bone at [param bone_idx] and sets its rest position to that of its parent prior to being reset. </description> </method> - <method name="world_transform_to_global_pose"> + <method name="world_transform_to_global_pose" is_deprecated="true"> <return type="Transform3D" /> <param index="0" name="world_transform" type="Transform3D" /> <description> + Deprecated. Use [Node3D] apis instead. Takes the passed-in global transform and converts it to a global pose. This can be used to easily convert a global transform from [member Node3D.global_transform] to a global pose usable with [method set_bone_global_pose_override], for example. </description> diff --git a/doc/classes/SkeletonIK3D.xml b/doc/classes/SkeletonIK3D.xml index 788ba3e248..1d50a97954 100644 --- a/doc/classes/SkeletonIK3D.xml +++ b/doc/classes/SkeletonIK3D.xml @@ -1,8 +1,29 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="SkeletonIK3D" inherits="Node" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> +<class name="SkeletonIK3D" inherits="Node" is_deprecated="true" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> <brief_description> + SkeletonIK3D is used to place the end bone of a [Skeleton3D] bone chain at a certain point in 3D by rotating all bones in the chain accordingly. </brief_description> <description> + SkeletonIK3D is used to place the end bone of a [Skeleton3D] bone chain at a certain point in 3D by rotating all bones in the chain accordingly. A typical scenario for IK in games is to place a characters feet on the ground or a characters hands on a currently hold object. SkeletonIK uses FabrikInverseKinematic internally to solve the bone chain and applies the results to the [Skeleton3D] [code]bones_global_pose_override[/code] property for all affected bones in the chain. If fully applied this overwrites any bone transform from [Animation]s or bone custom poses set by users. The applied amount can be controlled with the [code]interpolation[/code] property. + [codeblock] + # Apply IK effect automatically on every new frame (not the current) + skeleton_ik_node.start() + + # Apply IK effect only on the current frame + skeleton_ik_node.start(true) + + # Stop IK effect and reset bones_global_pose_override on Skeleton + skeleton_ik_node.stop() + + # Apply full IK effect + skeleton_ik_node.set_interpolation(1.0) + + # Apply half IK effect + skeleton_ik_node.set_interpolation(0.5) + + # Apply zero IK effect (a value at or below 0.01 also removes bones_global_pose_override on Skeleton) + skeleton_ik_node.set_interpolation(0.0) + [/codeblock] </description> <tutorials> <link title="3D Inverse Kinematics Demo">https://godotengine.org/asset-library/asset/523</link> @@ -11,45 +32,59 @@ <method name="get_parent_skeleton" qualifiers="const"> <return type="Skeleton3D" /> <description> + Returns the parent [Skeleton3D] Node that was present when SkeletonIK entered the [SceneTree]. Returns null if the parent node was not a [Skeleton3D] Node when SkeletonIK3D entered the [SceneTree]. </description> </method> <method name="is_running"> <return type="bool" /> <description> + Returns [code]true[/code] if SkeletonIK is applying IK effects on continues frames to the [Skeleton3D] bones. Returns [code]false[/code] if SkeletonIK is stopped or [method start] was used with the [code]one_time[/code] parameter set to [code]true[/code]. </description> </method> <method name="start"> <return type="void" /> <param index="0" name="one_time" type="bool" default="false" /> <description> + Starts applying IK effects on each frame to the [Skeleton3D] bones but will only take effect starting on the next frame. If [code]one_time[/code] is [code]true[/code], this will take effect immediately but also reset on the next frame. </description> </method> <method name="stop"> <return type="void" /> <description> + Stops applying IK effects on each frame to the [Skeleton3D] bones and also calls [method Skeleton3D.clear_bones_global_pose_override] to remove existing overrides on all bones. </description> </method> </methods> <members> <member name="interpolation" type="float" setter="set_interpolation" getter="get_interpolation" default="1.0"> + Interpolation value for how much the IK results are applied to the current skeleton bone chain. A value of [code]1.0[/code] will overwrite all skeleton bone transforms completely while a value of [code]0.0[/code] will visually disable the SkeletonIK. A value at or below [code]0.01[/code] also calls [method Skeleton3D.clear_bones_global_pose_override]. </member> <member name="magnet" type="Vector3" setter="set_magnet_position" getter="get_magnet_position" default="Vector3(0, 0, 0)"> + Secondary target position (first is [member target] property or [member target_node]) for the IK chain. Use magnet position (pole target) to control the bending of the IK chain. Only works if the bone chain has more than 2 bones. The middle chain bone position will be linearly interpolated with the magnet position. </member> <member name="max_iterations" type="int" setter="set_max_iterations" getter="get_max_iterations" default="10"> + Number of iteration loops used by the IK solver to produce more accurate (and elegant) bone chain results. </member> <member name="min_distance" type="float" setter="set_min_distance" getter="get_min_distance" default="0.01"> + The minimum distance between bone and goal target. If the distance is below this value, the IK solver stops further iterations. </member> <member name="override_tip_basis" type="bool" setter="set_override_tip_basis" getter="is_override_tip_basis" default="true"> + If [code]true[/code] overwrites the rotation of the tip bone with the rotation of the [member target] (or [member target_node] if defined). </member> <member name="root_bone" type="StringName" setter="set_root_bone" getter="get_root_bone" default="&"""> + The name of the current root bone, the first bone in the IK chain. </member> <member name="target" type="Transform3D" setter="set_target_transform" getter="get_target_transform" default="Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0)"> + First target of the IK chain where the tip bone is placed and, if [member override_tip_basis] is [code]true[/code], how the tip bone is rotated. If a [member target_node] path is available the nodes transform is used instead and this property is ignored. </member> <member name="target_node" type="NodePath" setter="set_target_node" getter="get_target_node" default="NodePath("")"> + Target node [NodePath] for the IK chain. If available, the node's current [Transform3D] is used instead of the [member target] property. </member> <member name="tip_bone" type="StringName" setter="set_tip_bone" getter="get_tip_bone" default="&"""> + The name of the current tip bone, the last bone in the IK chain placed at the [member target] transform (or [member target_node] if defined). </member> <member name="use_magnet" type="bool" setter="set_use_magnet" getter="is_using_magnet" default="false"> + If [code]true[/code], instructs the IK solver to consider the secondary magnet target (pole target) when calculating the bone chain. Use the magnet position (pole target) to control the bending of the IK chain. </member> </members> </class> diff --git a/doc/classes/SkeletonModification2D.xml b/doc/classes/SkeletonModification2D.xml index 46d32aef41..77aaf0213b 100644 --- a/doc/classes/SkeletonModification2D.xml +++ b/doc/classes/SkeletonModification2D.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="SkeletonModification2D" inherits="Resource" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> +<class name="SkeletonModification2D" inherits="Resource" is_experimental="true" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> <brief_description> A resource that operates on [Bone2D] nodes in a [Skeleton2D]. </brief_description> diff --git a/doc/classes/SkeletonModification2DCCDIK.xml b/doc/classes/SkeletonModification2DCCDIK.xml index c8fee3f94d..0d80b1b914 100644 --- a/doc/classes/SkeletonModification2DCCDIK.xml +++ b/doc/classes/SkeletonModification2DCCDIK.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="SkeletonModification2DCCDIK" inherits="SkeletonModification2D" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> +<class name="SkeletonModification2DCCDIK" inherits="SkeletonModification2D" is_experimental="true" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> <brief_description> A modification that uses CCDIK to manipulate a series of bones to reach a target in 2D. </brief_description> diff --git a/doc/classes/SkeletonModification2DFABRIK.xml b/doc/classes/SkeletonModification2DFABRIK.xml index ff3a65fe1a..8d1cd4b4d4 100644 --- a/doc/classes/SkeletonModification2DFABRIK.xml +++ b/doc/classes/SkeletonModification2DFABRIK.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="SkeletonModification2DFABRIK" inherits="SkeletonModification2D" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> +<class name="SkeletonModification2DFABRIK" inherits="SkeletonModification2D" is_experimental="true" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> <brief_description> A modification that uses FABRIK to manipulate a series of [Bone2D] nodes to reach a target. </brief_description> diff --git a/doc/classes/SkeletonModification2DJiggle.xml b/doc/classes/SkeletonModification2DJiggle.xml index 7329b2d865..3321fffe1b 100644 --- a/doc/classes/SkeletonModification2DJiggle.xml +++ b/doc/classes/SkeletonModification2DJiggle.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="SkeletonModification2DJiggle" inherits="SkeletonModification2D" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> +<class name="SkeletonModification2DJiggle" inherits="SkeletonModification2D" is_experimental="true" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> <brief_description> A modification that jiggles [Bone2D] nodes as they move towards a target. </brief_description> diff --git a/doc/classes/SkeletonModification2DLookAt.xml b/doc/classes/SkeletonModification2DLookAt.xml index 4747b06056..136fed37de 100644 --- a/doc/classes/SkeletonModification2DLookAt.xml +++ b/doc/classes/SkeletonModification2DLookAt.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="SkeletonModification2DLookAt" inherits="SkeletonModification2D" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> +<class name="SkeletonModification2DLookAt" inherits="SkeletonModification2D" is_experimental="true" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> <brief_description> A modification that rotates a [Bone2D] node to look at a target. </brief_description> diff --git a/doc/classes/SkeletonModification2DPhysicalBones.xml b/doc/classes/SkeletonModification2DPhysicalBones.xml index d5f46b2ea0..209602e974 100644 --- a/doc/classes/SkeletonModification2DPhysicalBones.xml +++ b/doc/classes/SkeletonModification2DPhysicalBones.xml @@ -1,10 +1,11 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="SkeletonModification2DPhysicalBones" inherits="SkeletonModification2D" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> +<class name="SkeletonModification2DPhysicalBones" inherits="SkeletonModification2D" is_experimental="true" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> <brief_description> A modification that applies the transforms of [PhysicalBone2D] nodes to [Bone2D] nodes. </brief_description> <description> This modification takes the transforms of [PhysicalBone2D] nodes and applies them to [Bone2D] nodes. This allows the [Bone2D] nodes to react to physics thanks to the linked [PhysicalBone2D] nodes. + Experimental. Physical bones may be changed in the future to perform the position update of [Bone2D] on their own. </description> <tutorials> </tutorials> diff --git a/doc/classes/SkeletonModification2DStackHolder.xml b/doc/classes/SkeletonModification2DStackHolder.xml index 791dea2fb1..85df111c0d 100644 --- a/doc/classes/SkeletonModification2DStackHolder.xml +++ b/doc/classes/SkeletonModification2DStackHolder.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="SkeletonModification2DStackHolder" inherits="SkeletonModification2D" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> +<class name="SkeletonModification2DStackHolder" inherits="SkeletonModification2D" is_experimental="true" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> <brief_description> A modification that holds and executes a [SkeletonModificationStack2D]. </brief_description> diff --git a/doc/classes/SkeletonModification2DTwoBoneIK.xml b/doc/classes/SkeletonModification2DTwoBoneIK.xml index edd5431a0c..c476d71d44 100644 --- a/doc/classes/SkeletonModification2DTwoBoneIK.xml +++ b/doc/classes/SkeletonModification2DTwoBoneIK.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="SkeletonModification2DTwoBoneIK" inherits="SkeletonModification2D" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> +<class name="SkeletonModification2DTwoBoneIK" inherits="SkeletonModification2D" is_experimental="true" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> <brief_description> A modification that rotates two bones using the law of cosigns to reach the target. </brief_description> diff --git a/doc/classes/SkeletonModification3D.xml b/doc/classes/SkeletonModification3D.xml index 8457179651..25431ea96f 100644 --- a/doc/classes/SkeletonModification3D.xml +++ b/doc/classes/SkeletonModification3D.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="SkeletonModification3D" inherits="Resource" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> +<class name="SkeletonModification3D" inherits="Resource" is_deprecated="true" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> <brief_description> A resource that operates on bones in a [Skeleton3D]. </brief_description> diff --git a/doc/classes/SkeletonModification3DCCDIK.xml b/doc/classes/SkeletonModification3DCCDIK.xml index dec0fbe99f..90b2e78449 100644 --- a/doc/classes/SkeletonModification3DCCDIK.xml +++ b/doc/classes/SkeletonModification3DCCDIK.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="SkeletonModification3DCCDIK" inherits="SkeletonModification3D" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> +<class name="SkeletonModification3DCCDIK" inherits="SkeletonModification3D" is_deprecated="true" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> <brief_description> A modification that uses CCDIK to manipulate a series of bones to reach a target. </brief_description> diff --git a/doc/classes/SkeletonModification3DFABRIK.xml b/doc/classes/SkeletonModification3DFABRIK.xml index 325cc2a12e..a2bec2b559 100644 --- a/doc/classes/SkeletonModification3DFABRIK.xml +++ b/doc/classes/SkeletonModification3DFABRIK.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="SkeletonModification3DFABRIK" inherits="SkeletonModification3D" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> +<class name="SkeletonModification3DFABRIK" inherits="SkeletonModification3D" is_deprecated="true" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> <brief_description> A modification that uses FABRIK to manipulate a series of bones to reach a target. </brief_description> diff --git a/doc/classes/SkeletonModification3DJiggle.xml b/doc/classes/SkeletonModification3DJiggle.xml index ef469d42ea..304f08bb20 100644 --- a/doc/classes/SkeletonModification3DJiggle.xml +++ b/doc/classes/SkeletonModification3DJiggle.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="SkeletonModification3DJiggle" inherits="SkeletonModification3D" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> +<class name="SkeletonModification3DJiggle" inherits="SkeletonModification3D" is_deprecated="true" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> <brief_description> A modification that jiggles bones as they move towards a target. </brief_description> diff --git a/doc/classes/SkeletonModification3DLookAt.xml b/doc/classes/SkeletonModification3DLookAt.xml index 3602cfad95..aeed953ca9 100644 --- a/doc/classes/SkeletonModification3DLookAt.xml +++ b/doc/classes/SkeletonModification3DLookAt.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="SkeletonModification3DLookAt" inherits="SkeletonModification3D" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> +<class name="SkeletonModification3DLookAt" inherits="SkeletonModification3D" is_deprecated="true" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> <brief_description> A modification that rotates a bone to look at a target. </brief_description> diff --git a/doc/classes/SkeletonModification3DStackHolder.xml b/doc/classes/SkeletonModification3DStackHolder.xml index 24240236a4..9448e2c783 100644 --- a/doc/classes/SkeletonModification3DStackHolder.xml +++ b/doc/classes/SkeletonModification3DStackHolder.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="SkeletonModification3DStackHolder" inherits="SkeletonModification3D" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> +<class name="SkeletonModification3DStackHolder" inherits="SkeletonModification3D" is_deprecated="true" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> <brief_description> A modification that holds and executes a [SkeletonModificationStack3D]. </brief_description> diff --git a/doc/classes/SkeletonModification3DTwoBoneIK.xml b/doc/classes/SkeletonModification3DTwoBoneIK.xml index 6618ebbcfb..0e7ffd5c80 100644 --- a/doc/classes/SkeletonModification3DTwoBoneIK.xml +++ b/doc/classes/SkeletonModification3DTwoBoneIK.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="SkeletonModification3DTwoBoneIK" inherits="SkeletonModification3D" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> +<class name="SkeletonModification3DTwoBoneIK" inherits="SkeletonModification3D" is_deprecated="true" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> <brief_description> A modification that moves two bones to reach the target. </brief_description> diff --git a/doc/classes/SkeletonModificationStack2D.xml b/doc/classes/SkeletonModificationStack2D.xml index 950e52e622..d96833e335 100644 --- a/doc/classes/SkeletonModificationStack2D.xml +++ b/doc/classes/SkeletonModificationStack2D.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="SkeletonModificationStack2D" inherits="Resource" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> +<class name="SkeletonModificationStack2D" inherits="Resource" is_experimental="true" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> <brief_description> A resource that holds a stack of [SkeletonModification2D]s. </brief_description> diff --git a/doc/classes/SkeletonModificationStack3D.xml b/doc/classes/SkeletonModificationStack3D.xml index 34c7099bca..9eaeeefd8e 100644 --- a/doc/classes/SkeletonModificationStack3D.xml +++ b/doc/classes/SkeletonModificationStack3D.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="SkeletonModificationStack3D" inherits="Resource" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> +<class name="SkeletonModificationStack3D" inherits="Resource" is_deprecated="true" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> <brief_description> A resource that holds a stack of [SkeletonModification3D]s. </brief_description> diff --git a/doc/classes/StreamPeerBuffer.xml b/doc/classes/StreamPeerBuffer.xml index 4bef9f44b7..f33c38e595 100644 --- a/doc/classes/StreamPeerBuffer.xml +++ b/doc/classes/StreamPeerBuffer.xml @@ -4,7 +4,7 @@ Data buffer stream peer. </brief_description> <description> - Data buffer stream peer that uses a byte array as the stream. This object can be used to handle binary data from network sessions. To handle binary data stored in files, [File] can be used directly. + Data buffer stream peer that uses a byte array as the stream. This object can be used to handle binary data from network sessions. To handle binary data stored in files, [FileAccess] can be used directly. A [StreamPeerBuffer] object keeps an internal cursor which is the offset in bytes to the start of the buffer. Get and put operations are performed at the cursor position and will move the cursor accordingly. </description> <tutorials> diff --git a/doc/classes/TextServer.xml b/doc/classes/TextServer.xml index 0db16b491d..2e67c61e54 100644 --- a/doc/classes/TextServer.xml +++ b/doc/classes/TextServer.xml @@ -1720,6 +1720,7 @@ </constant> <constant name="HINTING_NORMAL" value="2" enum="Hinting"> Use the default font hinting mode (crisper but less smooth). + [b]Note:[/b] This hinting mode changes both horizontal and vertical glyph metrics. If applied to monospace font, some glyphs might have different width. </constant> <constant name="SUBPIXEL_POSITIONING_DISABLED" value="0" enum="SubpixelPositioning"> Glyph horizontal position is rounded to the whole pixel size, each glyph is rasterized once. diff --git a/doc/classes/Texture2DArray.xml b/doc/classes/Texture2DArray.xml index 6f059b5fbf..113f37f974 100644 --- a/doc/classes/Texture2DArray.xml +++ b/doc/classes/Texture2DArray.xml @@ -1,8 +1,11 @@ <?xml version="1.0" encoding="UTF-8" ?> <class name="Texture2DArray" inherits="ImageTextureLayered" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> <brief_description> + A single texture resource which consists of multiple, separate images. Each image has the same dimensions and number of mipmap levels. </brief_description> <description> + A Texture2DArray is different from a Texture3D: The Texture2DArray does not support trilinear interpolation between the [Image]s, i.e. no blending. + A Texture2DArray is also different from an [AtlasTexture]: In a Texture2DArray, all images are treated separately. In an atlas, the regions (i.e. the single images) can be of different sizes. Furthermore, you usually need to add a padding around the regions, to prevent accidental UV mapping to more than one region. The same goes for mipmapping: Mipmap chains are handled separately for each layer. In an atlas, the slicing has to be done manually in the fragment shader. </description> <tutorials> </tutorials> diff --git a/doc/classes/TextureLayered.xml b/doc/classes/TextureLayered.xml index 7b528e2082..5e6afcbc5c 100644 --- a/doc/classes/TextureLayered.xml +++ b/doc/classes/TextureLayered.xml @@ -1,10 +1,15 @@ <?xml version="1.0" encoding="UTF-8" ?> <class name="TextureLayered" inherits="Texture" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> <brief_description> - Base class for 3D texture types. + Base class for texture types which contain the data of multiple [Image]s. Each image is of the same size and format. </brief_description> <description> - Base class for [Texture2DArray], [Cubemap] and [CubemapArray]. Cannot be used directly, but contains all the functions necessary for accessing the derived resource types. Data is set on a per-layer basis. For [Texture2DArray]s, the layer specifies the array layer. + Base class for [Texture2DArray], [Cubemap] and [CubemapArray]. Cannot be used directly, but contains all the functions necessary for accessing the derived resource types. + Data is set on a per-layer basis. For [Texture2DArray]s, the layer specifies the array layer. + All images need to have the same width, height and number of mipmap levels. + A [TextureLayered] can be loaded with [code]method ResourceFormatLoader.load[/code]. + To create such a texture file yourself, re-import your image files using the Godot Editor import presets. + Internally, Godot maps these files to their respective counterparts in the target rendering driver (GLES3, Vulkan). </description> <tutorials> </tutorials> @@ -72,6 +77,7 @@ <method name="get_layers" qualifiers="const"> <return type="int" /> <description> + Returns the number of referenced [Image]s. </description> </method> <method name="get_width" qualifiers="const"> @@ -83,6 +89,7 @@ <method name="has_mipmaps" qualifiers="const"> <return type="bool" /> <description> + Returns [code]true[/code] if the layers have generated mipmaps. </description> </method> </methods> diff --git a/doc/classes/Time.xml b/doc/classes/Time.xml index cdbe30c444..1abe017a4d 100644 --- a/doc/classes/Time.xml +++ b/doc/classes/Time.xml @@ -17,7 +17,7 @@ <return type="Dictionary" /> <param index="0" name="utc" type="bool" default="false" /> <description> - Returns the current date as a dictionary of keys: [code]year[/code], [code]month[/code], [code]day[/code], [code]weekday[/code], and [code]dst[/code] (Daylight Savings Time). + Returns the current date as a dictionary of keys: [code]year[/code], [code]month[/code], [code]day[/code], and [code]weekday[/code]. The returned values are in the system's local time when [param utc] is [code]false[/code], otherwise they are in UTC. </description> </method> @@ -57,7 +57,7 @@ <return type="Dictionary" /> <param index="0" name="utc" type="bool" default="false" /> <description> - Returns the current date as a dictionary of keys: [code]year[/code], [code]month[/code], [code]day[/code], [code]weekday[/code], [code]hour[/code], [code]minute[/code], and [code]second[/code]. + Returns the current date as a dictionary of keys: [code]year[/code], [code]month[/code], [code]day[/code], [code]weekday[/code], [code]hour[/code], [code]minute[/code], [code]second[/code], and [code]dst[/code] (Daylight Savings Time). </description> </method> <method name="get_datetime_dict_from_unix_time" qualifiers="const"> diff --git a/doc/classes/Tween.xml b/doc/classes/Tween.xml index c7fc78c1d3..5186972477 100644 --- a/doc/classes/Tween.xml +++ b/doc/classes/Tween.xml @@ -36,9 +36,18 @@ tween.tween_property(sprite, "position", Vector2(0, 0), 1) [/codeblock] In the example above, all children of a node are moved one after another to position (0, 0). + You should avoid using more than one [Tween] per object's property. If two or more tweens animate one property at the same time, the last one created will take priority and assign the final value. If you want to interrupt and restart an animation, consider assigning the [Tween] to a variable: + [codeblock] + var tween + func animate(): + if tween: + tween.kill() # Abort the previous animation. + tween = create_tween() + [/codeblock] Some [Tweener]s use transitions and eases. The first accepts a [enum TransitionType] constant, and refers to the way the timing of the animation is handled (see [url=https://easings.net/]easings.net[/url] for some examples). The second accepts an [enum EaseType] constant, and controls where the [code]trans_type[/code] is applied to the interpolation (in the beginning, the end, or both). If you don't know which transition and easing to pick, you can try different [enum TransitionType] constants with [constant EASE_IN_OUT], and use the one that looks best. [url=https://raw.githubusercontent.com/godotengine/godot-docs/master/img/tween_cheatsheet.png]Tween easing and transition types cheatsheet[/url] [b]Note:[/b] All [Tween]s will automatically start by default. To prevent a [Tween] from autostarting, you can call [method stop] immediately after it is created. + [b]Note:[/b] [Tween]s are processing after all of nodes in the current frame, i.e. after [method Node._process] or [method Node._physics_process] (depending on [enum TweenProcessMode]). </description> <tutorials> </tutorials> diff --git a/doc/classes/UndoRedo.xml b/doc/classes/UndoRedo.xml index 3ef59b1c39..7258efbdda 100644 --- a/doc/classes/UndoRedo.xml +++ b/doc/classes/UndoRedo.xml @@ -62,12 +62,11 @@ <tutorials> </tutorials> <methods> - <method name="add_do_method" qualifiers="vararg"> + <method name="add_do_method"> <return type="void" /> - <param index="0" name="object" type="Object" /> - <param index="1" name="method" type="StringName" /> + <param index="0" name="callable" type="Callable" /> <description> - Register a [param method] that will be called when the action is committed. + Register a [Callable] that will be called when the action is committed. </description> </method> <method name="add_do_property"> @@ -86,12 +85,11 @@ Register a reference for "do" that will be erased if the "do" history is lost. This is useful mostly for new nodes created for the "do" call. Do not use for resources. </description> </method> - <method name="add_undo_method" qualifiers="vararg"> + <method name="add_undo_method"> <return type="void" /> - <param index="0" name="object" type="Object" /> - <param index="1" name="method" type="StringName" /> + <param index="0" name="callable" type="Callable" /> <description> - Register a [param method] that will be called when the action is undone. + Register a [Callable] that will be called when the action is undone. </description> </method> <method name="add_undo_property"> |