Merge pull request #56535 from akien-mga/3.4-cherrypicks

Cherry-picks for the 3.4 branch (future 3.4.3) - 1st batch
This commit is contained in:
Rémi Verschelde 2022-01-06 01:59:20 +01:00 committed by GitHub
commit 4a299aa73b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
54 changed files with 231 additions and 130 deletions

View File

@ -491,7 +491,7 @@ Error HTTPClient::poll() {
continue;
}
if (s.begins_with("content-length:")) {
body_size = s.substr(s.find(":") + 1, s.length()).strip_edges().to_int();
body_size = s.substr(s.find(":") + 1, s.length()).strip_edges().to_int64();
body_left = body_size;
} else if (s.begins_with("transfer-encoding:")) {

View File

@ -174,8 +174,8 @@ private:
Vector<uint8_t> chunk;
int chunk_left;
bool chunk_trailer_part;
int body_size;
int body_left;
int64_t body_size;
int64_t body_left;
bool read_until_eof;
Ref<StreamPeerTCP> tcp_connection;

View File

@ -4,7 +4,7 @@
A camera feed gives you access to a single physical camera attached to your device.
</brief_description>
<description>
A camera feed gives you access to a single physical camera attached to your device. When enabled, Godot will start capturing frames from the camera which can then be used.
A camera feed gives you access to a single physical camera attached to your device. When enabled, Godot will start capturing frames from the camera which can then be used. See also [CameraServer].
[b]Note:[/b] Many cameras will return YCbCr images which are split into two textures and need to be combined in a shader. Godot does this automatically for you if you set the environment to show the camera image in the background.
</description>
<tutorials>

View File

@ -6,6 +6,7 @@
<description>
The [CameraServer] keeps track of different cameras accessible in Godot. These are external cameras such as webcams or the cameras on your phone.
It is notably used to provide AR modules with a video feed from the camera.
[b]Note:[/b] This class is currently only implemented on macOS and iOS. On other platforms, no [CameraFeed]s will be available.
</description>
<tutorials>
</tutorials>
@ -14,7 +15,7 @@
<return type="void" />
<argument index="0" name="feed" type="CameraFeed" />
<description>
Adds a camera feed to the camera server.
Adds the camera [code]feed[/code] to the camera server.
</description>
</method>
<method name="feeds">
@ -27,7 +28,7 @@
<return type="CameraFeed" />
<argument index="0" name="index" type="int" />
<description>
Returns the [CameraFeed] with this id.
Returns the [CameraFeed] corresponding to the camera with the given [code]index[/code].
</description>
</method>
<method name="get_feed_count">
@ -40,7 +41,7 @@
<return type="void" />
<argument index="0" name="feed" type="CameraFeed" />
<description>
Removes a [CameraFeed].
Removes the specified camera [code]feed[/code].
</description>
</method>
</methods>
@ -48,13 +49,13 @@
<signal name="camera_feed_added">
<argument index="0" name="id" type="int" />
<description>
Emitted when a [CameraFeed] is added (e.g. webcam is plugged in).
Emitted when a [CameraFeed] is added (e.g. a webcam is plugged in).
</description>
</signal>
<signal name="camera_feed_removed">
<argument index="0" name="id" type="int" />
<description>
Emitted when a [CameraFeed] is removed (e.g. webcam is unplugged).
Emitted when a [CameraFeed] is removed (e.g. a webcam is unplugged).
</description>
</signal>
</signals>
@ -63,7 +64,7 @@
The RGBA camera image.
</constant>
<constant name="FEED_YCBCR_IMAGE" value="0" enum="FeedImage">
The YCbCr camera image.
The [url=https://en.wikipedia.org/wiki/YCbCr]YCbCr[/url] camera image.
</constant>
<constant name="FEED_Y_IMAGE" value="0" enum="FeedImage">
The Y component camera image.

View File

@ -34,7 +34,7 @@
<argument index="6" name="width" type="float" default="1.0" />
<argument index="7" name="antialiased" type="bool" default="false" />
<description>
Draws an arc between the given angles. The larger the value of [code]point_count[/code], the smoother the curve.
Draws a unfilled arc between the given angles. The larger the value of [code]point_count[/code], the smoother the curve. See also [method draw_circle].
</description>
</method>
<method name="draw_char">
@ -54,7 +54,7 @@
<argument index="1" name="radius" type="float" />
<argument index="2" name="color" type="Color" />
<description>
Draws a colored circle.
Draws a colored, unfilled circle. See also [method draw_arc], [method draw_polyline] and [method draw_polygon].
</description>
</method>
<method name="draw_colored_polygon">
@ -66,7 +66,7 @@
<argument index="4" name="normal_map" type="Texture" default="null" />
<argument index="5" name="antialiased" type="bool" default="false" />
<description>
Draws a colored polygon of any amount of points, convex or concave.
Draws a colored polygon of any amount of points, convex or concave. Unlike [method draw_polygon], a single color must be specified for the whole polygon.
</description>
</method>
<method name="draw_line">
@ -77,7 +77,7 @@
<argument index="3" name="width" type="float" default="1.0" />
<argument index="4" name="antialiased" type="bool" default="false" />
<description>
Draws a line from a 2D point to another, with a given color and width. It can be optionally antialiased.
Draws a line from a 2D point to another, with a given color and width. It can be optionally antialiased. See also [method draw_multiline] and [method draw_polyline].
</description>
</method>
<method name="draw_mesh">
@ -98,7 +98,7 @@
<argument index="2" name="width" type="float" default="1.0" />
<argument index="3" name="antialiased" type="bool" default="false" />
<description>
Draws multiple, parallel lines with a uniform [code]color[/code].
Draws multiple disconnected lines with a uniform [code]color[/code]. When drawing large amounts of lines, this is faster than using individual [method draw_line] calls. To draw interconnected lines, use [method draw_polyline] instead.
[b]Note:[/b] [code]width[/code] and [code]antialiased[/code] are currently not implemented and have no effect.
</description>
</method>
@ -109,7 +109,7 @@
<argument index="2" name="width" type="float" default="1.0" />
<argument index="3" name="antialiased" type="bool" default="false" />
<description>
Draws multiple, parallel lines with a uniform [code]width[/code] and segment-by-segment coloring. Colors assigned to line segments match by index between [code]points[/code] and [code]colors[/code].
Draws multiple disconnected lines with a uniform [code]width[/code] and segment-by-segment coloring. Colors assigned to line segments match by index between [code]points[/code] and [code]colors[/code]. When drawing large amounts of lines, this is faster than using individual [method draw_line] calls. To draw interconnected lines, use [method draw_polyline_colors] instead.
[b]Note:[/b] [code]width[/code] and [code]antialiased[/code] are currently not implemented and have no effect.
</description>
</method>
@ -131,7 +131,7 @@
<argument index="4" name="normal_map" type="Texture" default="null" />
<argument index="5" name="antialiased" type="bool" default="false" />
<description>
Draws a polygon of any amount of points, convex or concave.
Draws a solid polygon of any amount of points, convex or concave. Unlike [method draw_colored_polygon], each point's color can be changed individually. See also [method draw_polyline] and [method draw_polyline_colors].
</description>
</method>
<method name="draw_polyline">
@ -141,7 +141,7 @@
<argument index="2" name="width" type="float" default="1.0" />
<argument index="3" name="antialiased" type="bool" default="false" />
<description>
Draws interconnected line segments with a uniform [code]color[/code] and [code]width[/code] and optional antialiasing.
Draws interconnected line segments with a uniform [code]color[/code] and [code]width[/code] and optional antialiasing. When drawing large amounts of lines, this is faster than using individual [method draw_line] calls. To draw disconnected lines, use [method draw_multiline] instead. See also [method draw_polygon].
</description>
</method>
<method name="draw_polyline_colors">
@ -151,7 +151,7 @@
<argument index="2" name="width" type="float" default="1.0" />
<argument index="3" name="antialiased" type="bool" default="false" />
<description>
Draws interconnected line segments with a uniform [code]width[/code], segment-by-segment coloring, and optional antialiasing. Colors assigned to line segments match by index between [code]points[/code] and [code]colors[/code].
Draws interconnected line segments with a uniform [code]width[/code] and segment-by-segment coloring, and optional antialiasing. Colors assigned to line segments match by index between [code]points[/code] and [code]colors[/code]. When drawing large amounts of lines, this is faster than using individual [method draw_line] calls. To draw disconnected lines, use [method draw_multiline_colors] instead. See also [method draw_polygon].
</description>
</method>
<method name="draw_primitive">
@ -163,7 +163,7 @@
<argument index="4" name="width" type="float" default="1.0" />
<argument index="5" name="normal_map" type="Texture" default="null" />
<description>
Draws a custom primitive. 1 point for a point, 2 points for a line, 3 points for a triangle and 4 points for a quad.
Draws a custom primitive. 1 point for a point, 2 points for a line, 3 points for a triangle, and 4 points for a quad. If 0 points or more than 4 points are specified, nothing will be drawn and an error message will be printed. See also [method draw_line], [method draw_polyline], [method draw_polygon], and [method draw_rect].
</description>
</method>
<method name="draw_rect">
@ -332,7 +332,7 @@
<method name="hide">
<return type="void" />
<description>
Hide the [CanvasItem] if it's currently visible.
Hide the [CanvasItem] if it's currently visible. This is equivalent to setting [member visible] to [code]false[/code].
</description>
</method>
<method name="is_local_transform_notification_enabled" qualifiers="const">
@ -397,7 +397,7 @@
<method name="show">
<return type="void" />
<description>
Show the [CanvasItem] if it's currently hidden. For controls that inherit [Popup], the correct way to make them visible is to call one of the multiple [code]popup*()[/code] functions instead.
Show the [CanvasItem] if it's currently hidden. This is equivalent to setting [member visible] to [code]true[/code]. For controls that inherit [Popup], the correct way to make them visible is to call one of the multiple [code]popup*()[/code] functions instead.
</description>
</method>
<method name="update">

View File

@ -14,7 +14,7 @@
</methods>
<members>
<member name="absolute_index" type="int" setter="set_absolute_index" getter="get_absolute_index" default="0">
The index of the current character (starting from 0). Setting this property won't affect drawing.
The index of the current character (starting from 0) for the [RichTextLabel]'s BBCode text. Setting this property won't affect drawing.
</member>
<member name="character" type="int" setter="set_character" getter="get_character" default="0">
The Unicode codepoint the character will use. This only affects non-whitespace characters. [method @GDScript.ord] can be useful here. For example, the following will replace all characters with asterisks:
@ -42,7 +42,7 @@
The position offset the character will be drawn with (in pixels).
</member>
<member name="relative_index" type="int" setter="set_relative_index" getter="get_relative_index" default="0">
The index of the current character (starting from 0). Setting this property won't affect drawing.
The index of the current character (starting from 0) for this [RichTextEffect] custom block. Setting this property won't affect drawing.
</member>
<member name="visible" type="bool" setter="set_visibility" getter="is_visible" default="true">
If [code]true[/code], the character will be drawn. If [code]false[/code], the character will be hidden. Characters around hidden characters will reflow to take the space of hidden characters. If this is not desired, set their [member color] to [code]Color(1, 1, 1, 0)[/code] instead.

View File

@ -4,7 +4,7 @@
Color in RGBA format using floats on the range of 0 to 1.
</brief_description>
<description>
A color represented by red, green, blue, and alpha (RGBA) components. The alpha component is often used for transparency. Values are in floating-point and usually range from 0 to 1. Some properties (such as CanvasItem.modulate) may accept values greater than 1 (overbright or HDR colors).
A color represented by red, green, blue, and alpha (RGBA) components. The alpha component is often used for opacity. Values are in floating-point and usually range from 0 to 1. Some properties (such as CanvasItem.modulate) may accept values greater than 1 (overbright or HDR colors).
You can also create a color from standardized color names by using [method @GDScript.ColorN] or directly using the color constants defined here. The standardized color set is based on the [url=https://en.wikipedia.org/wiki/X11_color_names]X11 color names[/url].
If you want to supply values in a range of 0 to 255, you should use [method @GDScript.Color8].
[b]Note:[/b] In a boolean context, a Color will evaluate to [code]false[/code] if it's equal to [code]Color(0, 0, 0, 1)[/code] (opaque black). Otherwise, a Color will always evaluate to [code]true[/code].
@ -239,7 +239,7 @@
</methods>
<members>
<member name="a" type="float" setter="" getter="" default="1.0">
The color's alpha (transparency) component, typically on the range of 0 to 1.
The color's alpha component, typically on the range of 0 to 1. A value of 0 means that the color is fully transparent. A value of 1 means that the color is fully opaque.
</member>
<member name="a8" type="int" setter="" getter="" default="255">
Wrapper for [member a] that uses the range 0 to 255 instead of 0 to 1.

View File

@ -41,7 +41,7 @@
If [code]true[/code], the color will apply only after the user releases the mouse button, otherwise it will apply immediately even in mouse motion event (which can cause performance issues).
</member>
<member name="edit_alpha" type="bool" setter="set_edit_alpha" getter="is_editing_alpha" default="true">
If [code]true[/code], shows an alpha channel slider (transparency).
If [code]true[/code], shows an alpha channel slider (opacity).
</member>
<member name="hsv_mode" type="bool" setter="set_hsv_mode" getter="is_hsv_mode" default="false">
If [code]true[/code], allows editing the color with Hue/Saturation/Value sliders.

View File

@ -20,7 +20,7 @@
</methods>
<members>
<member name="points" type="PoolVector2Array" setter="set_points" getter="get_points" default="PoolVector2Array( )">
The polygon's list of vertices. Can be in either clockwise or counterclockwise order.
The polygon's list of vertices. Can be in either clockwise or counterclockwise order. Only set this property with convex hull points, use [method set_point_cloud] to generate a convex hull shape from concave shape points.
</member>
</members>
<constants>

View File

@ -4,7 +4,8 @@
A script that is executed when exporting the project.
</brief_description>
<description>
Editor export plugins are automatically activated whenever the user exports the project. Their most common use is to determine what files are being included in the exported project. For each plugin, [method _export_begin] is called at the beginning of the export process and then [method _export_file] is called for each exported file.
[EditorExportPlugin]s are automatically invoked whenever the user exports the project. Their most common use is to determine what files are being included in the exported project. For each plugin, [method _export_begin] is called at the beginning of the export process and then [method _export_file] is called for each exported file.
To use [EditorExportPlugin], register it using the [method EditorPlugin.add_export_plugin] method first.
</description>
<tutorials>
</tutorials>

View File

@ -4,7 +4,7 @@
Registers a custom resource importer in the editor. Use the class to parse any file and import it as a new resource type.
</brief_description>
<description>
EditorImportPlugins provide a way to extend the editor's resource import functionality. Use them to import resources from custom files or to provide alternatives to the editor's existing importers. Register your [EditorPlugin] with [method EditorPlugin.add_import_plugin].
[EditorImportPlugin]s provide a way to extend the editor's resource import functionality. Use them to import resources from custom files or to provide alternatives to the editor's existing importers.
EditorImportPlugins work by associating with specific file extensions and a resource type. See [method get_recognized_extensions] and [method get_resource_type]. They may optionally specify some import presets that affect the import process. EditorImportPlugins are responsible for creating the resources and saving them in the [code].import[/code] directory (see [member ProjectSettings.application/config/use_hidden_project_data_directory]).
Below is an example EditorImportPlugin that imports a [Mesh] from a file with the extension ".special" or ".spec":
[codeblock]
@ -46,6 +46,7 @@
var filename = save_path + "." + get_save_extension()
return ResourceSaver.save(filename, mesh)
[/codeblock]
To use [EditorImportPlugin], register it using the [method EditorPlugin.add_import_plugin] method first.
</description>
<tutorials>
<link>https://docs.godotengine.org/en/3.4/tutorials/plugins/editor/import_plugins.html</link>

View File

@ -4,13 +4,13 @@
Plugin for adding custom property editors on inspector.
</brief_description>
<description>
These plugins allow adding custom property editors to [EditorInspector].
Plugins are registered via [method EditorPlugin.add_inspector_plugin].
[EditorInspectorPlugin] allows adding custom property editors to [EditorInspector].
When an object is edited, the [method can_handle] function is called and must return [code]true[/code] if the object type is supported.
If supported, the function [method parse_begin] will be called, allowing to place custom controls at the beginning of the class.
Subsequently, the [method parse_category] and [method parse_property] are called for every category and property. They offer the ability to add custom controls to the inspector too.
Finally, [method parse_end] will be called.
On each of these calls, the "add" functions can be called.
To use [EditorInspectorPlugin], register it using the [method EditorPlugin.add_inspector_plugin] method first.
</description>
<tutorials>
<link title="Inspector plugins">https://docs.godotengine.org/en/3.4/tutorials/plugins/editor/inspector_plugins.html</link>

View File

@ -4,6 +4,8 @@
Imports scenes from third-parties' 3D files.
</brief_description>
<description>
[EditorSceneImporter] allows to define an importer script for a third-party 3D format.
To use [EditorSceneImporter], register it using the [method EditorPlugin.add_scene_import_plugin] method first.
</description>
<tutorials>
</tutorials>

View File

@ -4,7 +4,8 @@
Used by the editor to define Spatial gizmo types.
</brief_description>
<description>
EditorSpatialGizmoPlugin allows you to define a new type of Gizmo. There are two main ways to do so: extending [EditorSpatialGizmoPlugin] for the simpler gizmos, or creating a new [EditorSpatialGizmo] type. See the tutorial in the documentation for more info.
[EditorSpatialGizmoPlugin] allows you to define a new type of Gizmo. There are two main ways to do so: extending [EditorSpatialGizmoPlugin] for the simpler gizmos, or creating a new [EditorSpatialGizmo] type. See the tutorial in the documentation for more info.
To use [EditorSpatialGizmoPlugin], register it using the [method EditorPlugin.add_spatial_gizmo_plugin] method first.
</description>
<tutorials>
<link>https://docs.godotengine.org/en/3.4/tutorials/plugins/editor/spatial_gizmos.html</link>

View File

@ -159,7 +159,7 @@
</member>
<member name="print_error_messages" type="bool" setter="set_print_error_messages" getter="is_printing_error_messages" default="true">
If [code]false[/code], stops printing error and warning messages to the console and editor Output log. This can be used to hide error and warning messages during unit test suite runs. This property is equivalent to the [member ProjectSettings.application/run/disable_stderr] project setting.
[b]Warning:[/b] If you set this to [code]false[/code] anywhere in the project, important error messages may be hidden even if they are emitted from other scripts. If this is set to [code]false[/code] in a [code]@tool[/code] script, this will also impact the editor itself. Do [i]not[/i] report bugs before ensuring error messages are enabled (as they are by default).
[b]Warning:[/b] If you set this to [code]false[/code] anywhere in the project, important error messages may be hidden even if they are emitted from other scripts. If this is set to [code]false[/code] in a [code]tool[/code] script, this will also impact the editor itself. Do [i]not[/i] report bugs before ensuring error messages are enabled (as they are by default).
[b]Note:[/b] This property does not impact the editor's Errors tab when running a project from the editor.
</member>
<member name="target_fps" type="int" setter="set_target_fps" getter="get_target_fps" default="0">

View File

@ -215,6 +215,7 @@
Returns [code]true[/code] when the user starts pressing the action event, meaning it's [code]true[/code] only on the frame that the user pressed down the button.
This is useful for code that needs to run only once when an action is pressed, instead of every frame while it's pressed.
If [code]exact[/code] is [code]false[/code], it ignores the input modifiers for [InputEventKey] and [InputEventMouseButton] events, and the direction for [InputEventJoypadMotion] events.
[b]Note:[/b] Due to keyboard ghosting, [method is_action_just_pressed] may return [code]false[/code] even if one of the action's keys is pressed. See [url=$DOCS_URL/tutorials/inputs/input_examples.html#keyboard-events]Input examples[/url] in the documentation for more information.
</description>
</method>
<method name="is_action_just_released" qualifiers="const">
@ -233,6 +234,7 @@
<description>
Returns [code]true[/code] if you are pressing the action event. Note that if an action has multiple buttons assigned and more than one of them is pressed, releasing one button will release the action, even if some other button assigned to this action is still pressed.
If [code]exact[/code] is [code]false[/code], it ignores the input modifiers for [InputEventKey] and [InputEventMouseButton] events, and the direction for [InputEventJoypadMotion] events.
[b]Note:[/b] Due to keyboard ghosting, [method is_action_pressed] may return [code]false[/code] even if one of the action's keys is pressed. See [url=$DOCS_URL/tutorials/inputs/input_examples.html#keyboard-events]Input examples[/url] in the documentation for more information.
</description>
</method>
<method name="is_joy_button_pressed" qualifiers="const">
@ -254,7 +256,9 @@
<return type="bool" />
<argument index="0" name="scancode" type="int" />
<description>
Returns [code]true[/code] if you are pressing the key. You can pass a [enum KeyList] constant.
Returns [code]true[/code] if you are pressing the key in the current keyboard layout. You can pass a [enum KeyList] constant.
[method is_key_pressed] is only recommended over [method is_physical_key_pressed] in non-game applications. This ensures that shortcut keys behave as expected depending on the user's keyboard layout, as keyboard shortcuts are generally dependent on the keyboard layout in non-game applications. If in doubt, use [method is_physical_key_pressed].
[b]Note:[/b] Due to keyboard ghosting, [method is_key_pressed] may return [code]false[/code] even if one of the action's keys is pressed. See [url=$DOCS_URL/tutorials/inputs/input_examples.html#keyboard-events]Input examples[/url] in the documentation for more information.
</description>
</method>
<method name="is_mouse_button_pressed" qualifiers="const">
@ -269,6 +273,8 @@
<argument index="0" name="scancode" type="int" />
<description>
Returns [code]true[/code] if you are pressing the key in the physical location on the 101/102-key US QWERTY keyboard. You can pass a [enum KeyList] constant.
[method is_physical_key_pressed] is recommended over [method is_key_pressed] for in-game actions, as it will make W/A/S/D layouts work regardless of the user's keyboard layout. [method is_physical_key_pressed] will also ensure that the top row number keys work on any keyboard layout. If in doubt, use [method is_physical_key_pressed].
[b]Note:[/b] Due to keyboard ghosting, [method is_physical_key_pressed] may return [code]false[/code] even if one of the action's keys is pressed. See [url=$DOCS_URL/tutorials/inputs/input_examples.html#keyboard-events]Input examples[/url] in the documentation for more information.
</description>
</method>
<method name="joy_connection_changed">

View File

@ -53,6 +53,7 @@
<description>
Returns [code]true[/code] if the given action is being pressed (and is not an echo event for [InputEventKey] events, unless [code]allow_echo[/code] is [code]true[/code]). Not relevant for events of type [InputEventMouseMotion] or [InputEventScreenDrag].
If [code]exact_match[/code] is [code]false[/code], it ignores the input modifiers for [InputEventKey] and [InputEventMouseButton] events, and the direction for [InputEventJoypadMotion] events.
[b]Note:[/b] Due to keyboard ghosting, [method is_action_pressed] may return [code]false[/code] even if one of the action's keys is pressed. See [url=$DOCS_URL/tutorials/inputs/input_examples.html#keyboard-events]Input examples[/url] in the documentation for more information.
</description>
</method>
<method name="is_action_released" qualifiers="const">
@ -80,6 +81,7 @@
<return type="bool" />
<description>
Returns [code]true[/code] if this input event is pressed. Not relevant for events of type [InputEventMouseMotion] or [InputEventScreenDrag].
[b]Note:[/b] Due to keyboard ghosting, [method is_action_pressed] may return [code]false[/code] even if one of the action's keys is pressed. See [url=$DOCS_URL/tutorials/inputs/input_examples.html#keyboard-events]Input examples[/url] in the documentation for more information.
</description>
</method>
<method name="shortcut_match" qualifiers="const">

View File

@ -16,10 +16,10 @@
The mouse button mask identifier, one of or a bitwise combination of the [enum ButtonList] button masks.
</member>
<member name="global_position" type="Vector2" setter="set_global_position" getter="get_global_position" default="Vector2( 0, 0 )">
The global mouse position relative to the current [Viewport] when used in [method Control._gui_input], otherwise is at 0,0.
The global mouse position relative to the current [Viewport]. If used in [method Control._gui_input] and if the current [Control] is not under the mouse, moving it will not update this value.
</member>
<member name="position" type="Vector2" setter="set_position" getter="get_position" default="Vector2( 0, 0 )">
The local mouse position relative to the [Viewport]. If used in [method Control._gui_input], the position is relative to the current [Control] which is under the mouse.
The local mouse position relative to the [Viewport]. If used in [method Control._gui_input], the position is relative to the current [Control] which is under the mouse. If the current [Control] is not under the mouse, moving it will not update this value.
</member>
</members>
<constants>

View File

@ -121,7 +121,7 @@
<method name="get_v_scroll">
<return type="VScrollBar" />
<description>
Returns the [Object] ID associated with the list.
Returns the vertical scrollbar.
[b]Warning:[/b] This is a required internal node, removing and freeing it may cause a crash. If you wish to hide it or any of its children, use their [member CanvasItem.visible] property.
</description>
</method>

View File

@ -410,7 +410,7 @@
<method name="get_static_memory_usage" qualifiers="const">
<return type="int" />
<description>
Returns the amount of static memory being used by the program in bytes.
Returns the amount of static memory being used by the program in bytes (only works in debug).
</description>
</method>
<method name="get_system_dir" qualifiers="const">

View File

@ -5,7 +5,7 @@
</brief_description>
<description>
[i]Root motion[/i] refers to an animation technique where a mesh's skeleton is used to give impulse to a character. When working with 3D animations, a popular technique is for animators to use the root skeleton bone to give motion to the rest of the skeleton. This allows animating characters in a way where steps actually match the floor below. It also allows precise interaction with objects during cinematics. See also [AnimationTree].
[b]Note:[/b] [RootMotionView] is only visible in the editor. It will be hidden automatically in the running project, and will also be converted to a plain [Node] in the running project. This means a script attached to a [RootMotionView] node [i]must[/i] have [code]extends Node[/code] instead of [code]extends RootMotionView[/code]. Additionally, it must not be a [code]@tool[/code] script.
[b]Note:[/b] [RootMotionView] is only visible in the editor. It will be hidden automatically in the running project, and will also be converted to a plain [Node] in the running project. This means a script attached to a [RootMotionView] node [i]must[/i] have [code]extends Node[/code] instead of [code]extends RootMotionView[/code]. Additionally, it must not be a [code]tool[/code] script.
</description>
<tutorials>
<link title="Using AnimationTree - Root motion">https://docs.godotengine.org/en/latest/tutorials/animation/animation_tree.html#root-motion</link>

View File

@ -64,13 +64,16 @@
Texture to multiply by [member albedo_color]. Used for basic texturing of objects.
</member>
<member name="anisotropy" type="float" setter="set_anisotropy" getter="get_anisotropy">
The strength of the anisotropy effect.
The strength of the anisotropy effect. This is multiplied by [member anisotropy_flowmap]'s alpha channel if a texture is defined there and the texture contains an alpha channel.
</member>
<member name="anisotropy_enabled" type="bool" setter="set_feature" getter="get_feature" default="false">
If [code]true[/code], anisotropy is enabled. Changes the shape of the specular blob and aligns it to tangent space. Mesh tangents are needed for this to work. If the mesh does not contain tangents the anisotropy effect will appear broken.
If [code]true[/code], anisotropy is enabled. Anisotropy changes the shape of the specular blob and aligns it to tangent space. This is useful for brushed aluminium and hair reflections.
[b]Note:[/b] Mesh tangents are needed for anisotropy to work. If the mesh does not contain tangents, the anisotropy effect will appear broken.
[b]Note:[/b] Material anisotropy should not to be confused with anisotropic texture filtering. Anisotropic texture filtering can be enabled by selecting a texture in the FileSystem dock, going to the Import dock, checking the [b]Anisotropic[/b] checkbox then clicking [b]Reimport[/b].
</member>
<member name="anisotropy_flowmap" type="Texture" setter="set_texture" getter="get_texture">
Texture that offsets the tangent map for anisotropy calculations.
Texture that offsets the tangent map for anisotropy calculations and optionally controls the anisotropy effect (if an alpha channel is present). The flowmap texture is expected to be a derivative map, with the red channel representing distortion on the X axis and green channel representing distortion on the Y axis. Values below 0.5 will result in negative distortion, whereas values above 0.5 will result in positive distortion.
If present, the texture's alpha channel will be used to multiply the strength of the [member anisotropy] effect. Fully opaque pixels will keep the anisotropy effect's original strength while fully transparent pixels will disable the anisotropy effect entirely. The flowmap texture's blue channel is ignored.
</member>
<member name="ao_enabled" type="bool" setter="set_feature" getter="get_feature" default="false">
If [code]true[/code], ambient occlusion is enabled. Ambient occlusion darkens areas based on the [member ao_texture].

View File

@ -133,7 +133,7 @@
<argument index="5" name="transpose" type="bool" default="false" />
<argument index="6" name="autotile_coord" type="Vector2" default="Vector2( 0, 0 )" />
<description>
Sets the tile index for the cell given by a Vector2.
Sets the tile index for the given cell.
An index of [code]-1[/code] clears the cell.
Optionally, the tile can also be flipped, transposed, or given autotile coordinates. The autotile coordinate refers to the column and row of the subtile.
[b]Note:[/b] Data such as navigation polygons and collision shapes are not immediately updated for performance reasons.
@ -155,7 +155,7 @@
<argument index="3" name="flip_y" type="bool" default="false" />
<argument index="4" name="transpose" type="bool" default="false" />
<description>
Sets the tile index for the given cell.
Sets the tile index for the cell given by a Vector2.
An index of [code]-1[/code] clears the cell.
Optionally, the tile can also be flipped or transposed.
[b]Note:[/b] Data such as navigation polygons and collision shapes are not immediately updated for performance reasons.

View File

@ -209,7 +209,7 @@
<return type="Vector2" />
<argument index="0" name="n" type="Vector2" />
<description>
Returns the vector reflected from a plane defined by the given normal.
Returns the vector reflected (i.e. mirrored, or symmetric) over a line defined by the given direction vector [code]n[/code].
</description>
</method>
<method name="rotated">

View File

@ -5264,6 +5264,7 @@ void RasterizerStorageGLES2::_render_target_clear(RenderTarget *rt) {
// clean up our texture
Texture *t = texture_owner.get(rt->external.texture);
t->tex_id = 0;
t->alloc_height = 0;
t->alloc_width = 0;
t->width = 0;
@ -5428,6 +5429,7 @@ void RasterizerStorageGLES2::render_target_set_external_texture(RID p_render_tar
// clean up our texture
Texture *t = texture_owner.get(rt->external.texture);
t->tex_id = 0;
t->alloc_height = 0;
t->alloc_width = 0;
t->width = 0;

View File

@ -1268,6 +1268,8 @@ void RasterizerSceneGLES3::_setup_geometry(RenderList::Element *e, const Transfo
if (s->blend_shapes.size() && e->instance->blend_values.size()) {
//blend shapes, use transform feedback
storage->mesh_render_blend_shapes(s, e->instance->blend_values.read().ptr());
//disable octahedral compression as the result of blend shapes is always uncompressed cartesian coordinates
state.scene_shader.set_conditional(SceneShaderGLES3::ENABLE_OCTAHEDRAL_COMPRESSION, false);
//rebind shader
state.scene_shader.bind();
#ifdef DEBUG_ENABLED

View File

@ -4273,6 +4273,7 @@ void RasterizerStorageGLES3::mesh_render_blend_shapes(Surface *s, const float *p
shaders.blend_shapes.set_conditional(BlendShapeShaderGLES3::ENABLE_BLEND, false); //first pass does not blend
shaders.blend_shapes.set_conditional(BlendShapeShaderGLES3::USE_2D_VERTEX, s->format & VS::ARRAY_FLAG_USE_2D_VERTICES); //use 2D vertices if needed
shaders.blend_shapes.set_conditional(BlendShapeShaderGLES3::ENABLE_OCTAHEDRAL_COMPRESSION, s->format & VS::ARRAY_FLAG_USE_OCTAHEDRAL_COMPRESSION); //use octahedral normal compression
shaders.blend_shapes.bind();
@ -6441,6 +6442,7 @@ void RasterizerStorageGLES3::_particles_process(Particles *p_particles, float p_
glBindVertexArray(p_particles->particle_vaos[0]);
glBindBuffer(GL_ARRAY_BUFFER, 0); // ensure this is unbound per WebGL2 spec
glBindBufferBase(GL_TRANSFORM_FEEDBACK_BUFFER, 0, p_particles->particle_buffers[1]);
// GLint size = 0;
@ -6823,6 +6825,7 @@ void RasterizerStorageGLES3::_render_target_clear(RenderTarget *rt) {
// clean up our texture
Texture *t = texture_owner.get(rt->external.texture);
t->tex_id = 0;
t->alloc_height = 0;
t->alloc_width = 0;
t->width = 0;
@ -7332,6 +7335,7 @@ void RasterizerStorageGLES3::render_target_set_external_texture(RID p_render_tar
// clean up our texture
Texture *t = texture_owner.get(rt->external.texture);
t->tex_id = 0;
t->alloc_height = 0;
t->alloc_width = 0;
t->width = 0;

View File

@ -25,11 +25,19 @@ ARRAY_INDEX=8,
layout(location = 0) in highp VFORMAT vertex_attrib;
/* clang-format on */
#ifdef ENABLE_OCTAHEDRAL_COMPRESSION
layout(location = 2) in vec4 normal_tangent_attrib;
#else
layout(location = 1) in vec3 normal_attrib;
#endif
#ifdef ENABLE_TANGENT
#ifdef ENABLE_OCTAHEDRAL_COMPRESSION
// packed into normal_attrib zw component
#else
layout(location = 2) in vec4 tangent_attrib;
#endif
#endif
#ifdef ENABLE_COLOR
layout(location = 3) in vec4 color_attrib;
@ -109,20 +117,37 @@ out vec4 weight_out; //tfb:ENABLE_SKELETON
uniform float blend_amount;
#ifdef ENABLE_OCTAHEDRAL_COMPRESSION
vec3 oct_to_vec3(vec2 e) {
vec3 v = vec3(e.xy, 1.0 - abs(e.x) - abs(e.y));
float t = max(-v.z, 0.0);
v.xy += t * -sign(v.xy);
return normalize(v);
}
#endif
void main() {
#ifdef ENABLE_BLEND
vertex_out = vertex_attrib_blend + vertex_attrib * blend_amount;
#ifdef ENABLE_NORMAL
#ifdef ENABLE_OCTAHEDRAL_COMPRESSION
normal_out = normal_attrib_blend + oct_to_vec3(normal_tangent_attrib.xy) * blend_amount;
#else
normal_out = normal_attrib_blend + normal_attrib * blend_amount;
#endif
#endif
#ifdef ENABLE_TANGENT
#ifdef ENABLE_OCTAHEDRAL_COMPRESSION
tangent_out.xyz = tangent_attrib_blend.xyz + oct_to_vec3(vec2(normal_tangent_attrib.z, abs(normal_tangent_attrib.w) * 2.0 - 1.0)) * blend_amount;
tangent_out.w = sign(tangent_attrib_blend.w);
#else
tangent_out.xyz = tangent_attrib_blend.xyz + tangent_attrib.xyz * blend_amount;
tangent_out.w = tangent_attrib_blend.w; //just copy, no point in blending his
#endif
#endif
#ifdef ENABLE_COLOR
@ -150,14 +175,22 @@ void main() {
vertex_out = vertex_attrib * blend_amount;
#ifdef ENABLE_NORMAL
#ifdef ENABLE_OCTAHEDRAL_COMPRESSION
normal_out = oct_to_vec3(normal_tangent_attrib.xy) * blend_amount;
#else
normal_out = normal_attrib * blend_amount;
#endif
#endif
#ifdef ENABLE_TANGENT
#ifdef ENABLE_OCTAHEDRAL_COMPRESSION
tangent_out.xyz = oct_to_vec3(vec2(normal_tangent_attrib.z, abs(normal_tangent_attrib.w) * 2.0 - 1.0)) * blend_amount;
tangent_out.w = sign(normal_tangent_attrib.w);
#else
tangent_out.xyz = tangent_attrib.xyz * blend_amount;
tangent_out.w = tangent_attrib.w; //just copy, no point in blending his
#endif
#endif
#ifdef ENABLE_COLOR

View File

@ -124,7 +124,7 @@ void EditorAssetInstaller::open(const String &p_path, int p_depth) {
char fname[16384];
unzGetCurrentFileInfo(pkg, &info, fname, 16384, nullptr, 0, nullptr, 0);
String name = fname;
String name = String::utf8(fname);
files_sorted.insert(name);
ret = unzGoToNextFile(pkg);
@ -304,7 +304,7 @@ void EditorAssetInstaller::ok_pressed() {
char fname[16384];
ret = unzGetCurrentFileInfo(pkg, &info, fname, 16384, nullptr, 0, nullptr, 0);
String name = fname;
String name = String::utf8(fname);
if (status_map.has(name) && status_map[name]->is_checked(0)) {
String path = status_map[name]->get_metadata(0);

View File

@ -232,12 +232,12 @@ void EditorAtlasPacker::chart_pack(Vector<Chart> &charts, int &r_width, int &r_h
const int *top_heights = bitmaps[i].top_heights.ptr();
const int *bottom_heights = bitmaps[i].bottom_heights.ptr();
for (int j = 0; j < atlas_w - w; j++) {
for (int j = 0; j <= atlas_w - w; j++) {
int height = 0;
for (int k = 0; k < w; k++) {
int pixmap_h = bottom_heights[k];
if (pixmap_h == -1) {
if (pixmap_h == 0x7FFFFFFF) {
continue; //no pixel here, anything is fine
}

View File

@ -399,7 +399,7 @@ bool ExportTemplateManager::_install_file_selected(const String &p_file, bool p_
char fname[16384];
ret = unzGetCurrentFileInfo(pkg, &info, fname, 16384, nullptr, 0, nullptr, 0);
String file = fname;
String file = String::utf8(fname);
if (file.ends_with("version.txt")) {
Vector<uint8_t> data;
data.resize(info.uncompressed_size);
@ -460,7 +460,7 @@ bool ExportTemplateManager::_install_file_selected(const String &p_file, bool p_
char fname[16384];
unzGetCurrentFileInfo(pkg, &info, fname, 16384, nullptr, 0, nullptr, 0);
String file_path(String(fname).simplify_path());
String file_path(String::utf8(fname).simplify_path());
String file = file_path.get_file();
@ -706,7 +706,7 @@ Error ExportTemplateManager::install_android_template_from_file(const String &p_
char fpath[16384];
ret = unzGetCurrentFileInfo(pkg, &info, fpath, 16384, nullptr, 0, nullptr, 0);
String path = fpath;
String path = String::utf8(fpath);
String base_dir = path.get_base_dir();
if (!path.ends_with("/")) {

View File

@ -3639,6 +3639,35 @@ AABB SpatialEditorViewport::_calculate_spatial_bounds(const Spatial *p_parent, b
return bounds;
}
Node *SpatialEditorViewport::_sanitize_preview_node(Node *p_node) const {
Spatial *spatial = Object::cast_to<Spatial>(p_node);
if (spatial == nullptr) {
Spatial *replacement_node = memnew(Spatial);
replacement_node->set_name(p_node->get_name());
p_node->replace_by(replacement_node);
memdelete(p_node);
p_node = replacement_node;
} else {
VisualInstance *visual_instance = Object::cast_to<VisualInstance>(spatial);
if (visual_instance == nullptr) {
Spatial *replacement_node = memnew(Spatial);
replacement_node->set_name(spatial->get_name());
replacement_node->set_visible(spatial->is_visible());
replacement_node->set_transform(spatial->get_transform());
replacement_node->set_as_toplevel(spatial->is_set_as_toplevel());
p_node->replace_by(replacement_node);
memdelete(p_node);
p_node = replacement_node;
}
}
for (int i = 0; i < p_node->get_child_count(); i++) {
_sanitize_preview_node(p_node->get_child(i));
}
return p_node;
}
void SpatialEditorViewport::_create_preview(const Vector<String> &files) const {
for (int i = 0; i < files.size(); i++) {
String path = files[i];
@ -3655,6 +3684,7 @@ void SpatialEditorViewport::_create_preview(const Vector<String> &files) const {
if (scene.is_valid()) {
Node *instance = scene->instance();
if (instance) {
instance = _sanitize_preview_node(instance);
preview_node->add_child(instance);
}
}

View File

@ -443,6 +443,9 @@ private:
Vector3 _get_instance_position(const Point2 &p_pos) const;
static AABB _calculate_spatial_bounds(const Spatial *p_parent, bool p_exclude_toplevel_transform = true);
Node *_sanitize_preview_node(Node *p_node) const;
void _create_preview(const Vector<String> &files) const;
void _remove_preview();
bool _cyclical_dependency_exists(const String &p_target_scene_path, Node *p_desired_node);

View File

@ -36,6 +36,8 @@
#include "editor/editor_scale.h"
constexpr double REFRESH_TIMER = 1.5;
void ThemeEditorPreview::set_preview_theme(const Ref<Theme> &p_theme) {
preview_content->set_theme(p_theme);
}
@ -66,7 +68,7 @@ void ThemeEditorPreview::_refresh_interval() {
}
void ThemeEditorPreview::_preview_visibility_changed() {
set_process(is_visible());
set_process(is_visible_in_tree());
}
void ThemeEditorPreview::_picker_button_cbk() {
@ -192,7 +194,7 @@ void ThemeEditorPreview::_notification(int p_what) {
case NOTIFICATION_PROCESS: {
time_left -= get_process_delta_time();
if (time_left < 0) {
time_left = 1.5;
time_left = REFRESH_TIMER;
_refresh_interval();
}
} break;

View File

@ -203,7 +203,7 @@ private:
char fname[16384];
ret = unzGetCurrentFileInfo(pkg, &info, fname, 16384, nullptr, 0, nullptr, 0);
if (String(fname).ends_with("project.godot")) {
if (String::utf8(fname).ends_with("project.godot")) {
break;
}
@ -513,7 +513,7 @@ private:
char fname[16384];
unzGetCurrentFileInfo(pkg, &info, fname, 16384, nullptr, 0, nullptr, 0);
String name = fname;
String name = String::utf8(fname);
if (name.ends_with("project.godot")) {
zip_root = name.substr(0, name.rfind("project.godot"));
break;
@ -533,7 +533,7 @@ private:
char fname[16384];
ret = unzGetCurrentFileInfo(pkg, &info, fname, 16384, nullptr, 0, nullptr, 0);
String path = fname;
String path = String::utf8(fname);
if (path == String() || path == zip_root || !zip_root.is_subsequence_of(path)) {
//

View File

@ -295,7 +295,7 @@
<br />
<button class="btn" onclick="clearPersistence()" style="margin-bottom: 1.5rem">Clear persistent data</button>
<br />
<a href="https://docs.godotengine.org/en/3.4/getting_started/editor/using_the_web_editor.html">Web editor documentation</a>
<a href="https://docs.godotengine.org/en/3.4/tutorials/editor/using_the_web_editor.html">Web editor documentation</a>
</div>
</div>
<div id="tab-editor" style="display: none;">

View File

@ -7,8 +7,8 @@
A GDNative library can implement [NativeScript]s, global functions to call with the [GDNative] class, or low-level engine extensions through interfaces such as [ARVRInterfaceGDNative]. The library must be compiled for each platform and architecture that the project will run on.
</description>
<tutorials>
<link>https://docs.godotengine.org/en/3.4/tutorials/plugins/gdnative/gdnative-c-example.html</link>
<link>https://docs.godotengine.org/en/3.4/tutorials/plugins/gdnative/gdnative-cpp-example.html</link>
<link>https://docs.godotengine.org/en/3.4/tutorials/scripting/gdnative/gdnative-c-example.html</link>
<link>https://docs.godotengine.org/en/3.4/tutorials/scripting/gdnative/gdnative-cpp-example.html</link>
</tutorials>
<methods>
<method name="get_current_dependencies" qualifiers="const">

View File

@ -412,14 +412,16 @@
<argument index="1" name="to" type="float" />
<argument index="2" name="weight" type="float" />
<description>
Returns a normalized value considering the given range. This is the opposite of [method lerp].
Returns an interpolation or extrapolation factor considering the range specified in [code]from[/code] and [code]to[/code], and the interpolated value specified in [code]weight[/code]. The returned value will be between [code]0.0[/code] and [code]1.0[/code] if [code]weight[/code] is between [code]from[/code] and [code]to[/code] (inclusive). If [code]weight[/code] is located outside this range, then an extrapolation factor will be returned (return value lower than [code]0.0[/code] or greater than [code]1.0[/code]).
[codeblock]
# The interpolation ratio in the `lerp()` call below is 0.75.
var middle = lerp(20, 30, 0.75)
# `middle` is now 27.5.
# Now, we pretend to have forgotten the original ratio and want to get it back.
var ratio = inverse_lerp(20, 30, 27.5)
# `ratio` is now 0.75.
[/codeblock]
See also [method lerp] which performs the reverse of this operation.
</description>
</method>
<method name="is_equal_approx">
@ -479,13 +481,14 @@
<argument index="1" name="to" type="Variant" />
<argument index="2" name="weight" type="float" />
<description>
Linearly interpolates between two values by a normalized value. This is the opposite of [method inverse_lerp].
Linearly interpolates between two values by the factor defined in [code]weight[/code]. To perform interpolation, [code]weight[/code] should be between [code]0.0[/code] and [code]1.0[/code] (inclusive). However, values outside this range are allowed and can be used to perform [i]extrapolation[/i].
If the [code]from[/code] and [code]to[/code] arguments are of type [int] or [float], the return value is a [float].
If both are of the same vector type ([Vector2], [Vector3] or [Color]), the return value will be of the same type ([code]lerp[/code] then calls the vector type's [code]linear_interpolate[/code] method).
[codeblock]
lerp(0, 4, 0.75) # Returns 3.0
lerp(Vector2(1, 5), Vector2(3, 2), 0.5) # Returns Vector2(2, 3.5)
[/codeblock]
See also [method inverse_lerp] which performs the reverse of this operation. To perform eased interpolation with [method lerp], combine it with [method ease] or [method smoothstep].
</description>
</method>
<method name="lerp_angle">
@ -495,7 +498,7 @@
<argument index="2" name="weight" type="float" />
<description>
Linearly interpolates between two angles (in radians) by a normalized value.
Similar to [method lerp], but interpolates correctly when the angles wrap around [constant @GDScript.TAU].
Similar to [method lerp], but interpolates correctly when the angles wrap around [constant @GDScript.TAU]. To perform eased interpolation with [method lerp_angle], combine it with [method ease] or [method smoothstep].
[codeblock]
extends Sprite
var elapsed = 0.0

View File

@ -8,7 +8,7 @@
[method new] creates a new instance of the script. [method Object.set_script] extends an existing object, if that object's class matches one of the script's base classes.
</description>
<tutorials>
<link>https://docs.godotengine.org/en/3.4/getting_started/scripting/gdscript/index.html</link>
<link>https://docs.godotengine.org/en/3.4/tutorials/scripting/gdscript/index.html</link>
</tutorials>
<methods>
<method name="get_as_byte_code" qualifiers="const">

View File

@ -3391,30 +3391,33 @@ Error GLTFDocument::_serialize_materials(Ref<GLTFState> state) {
tex.instance();
{
Ref<Texture> normal_texture = material->get_texture(SpatialMaterial::TEXTURE_NORMAL);
// Code for uncompressing RG normal maps
Ref<Image> img = normal_texture->get_data();
Ref<ImageTexture> img_tex = img;
if (img_tex.is_valid()) {
img = img_tex->get_data();
}
img->decompress();
img->convert(Image::FORMAT_RGBA8);
img->lock();
for (int32_t y = 0; y < img->get_height(); y++) {
for (int32_t x = 0; x < img->get_width(); x++) {
Color c = img->get_pixel(x, y);
Vector2 red_green = Vector2(c.r, c.g);
red_green = red_green * Vector2(2.0f, 2.0f) - Vector2(1.0f, 1.0f);
float blue = 1.0f - red_green.dot(red_green);
blue = MAX(0.0f, blue);
c.b = Math::sqrt(blue);
img->set_pixel(x, y, c);
if (normal_texture.is_valid()) {
// Code for uncompressing RG normal maps
Ref<Image> img = normal_texture->get_data();
if (img.is_valid()) {
Ref<ImageTexture> img_tex = img;
if (img_tex.is_valid()) {
img = img_tex->get_data();
}
img->decompress();
img->convert(Image::FORMAT_RGBA8);
img->lock();
for (int32_t y = 0; y < img->get_height(); y++) {
for (int32_t x = 0; x < img->get_width(); x++) {
Color c = img->get_pixel(x, y);
Vector2 red_green = Vector2(c.r, c.g);
red_green = red_green * Vector2(2.0f, 2.0f) - Vector2(1.0f, 1.0f);
float blue = 1.0f - red_green.dot(red_green);
blue = MAX(0.0f, blue);
c.b = Math::sqrt(blue);
img->set_pixel(x, y, c);
}
}
img->unlock();
tex->create_from_image(img);
}
}
img->unlock();
tex->create_from_image(img);
}
Ref<Texture> normal_texture = material->get_texture(SpatialMaterial::TEXTURE_NORMAL);
GLTFTextureIndex gltf_texture_index = -1;
if (tex.is_valid() && tex->get_data().is_valid()) {
tex->set_name(material->get_name() + "_normal");

View File

@ -1570,9 +1570,19 @@ void CSharpInstance::get_properties_state_for_reloading(List<Pair<StringName, Va
ManagedType managedType;
GDMonoField *field = script->script_class->get_field(state_pair.first);
if (!field)
GDMonoField *field = nullptr;
GDMonoClass *top = script->script_class;
while (top && top != script->native) {
field = top->get_field(state_pair.first);
if (field) {
break;
}
top = top->get_parent_class();
}
if (!field) {
continue; // Properties ignored. We get the property baking fields instead.
}
managedType = field->get_type();

View File

@ -8,7 +8,7 @@
See also [GodotSharp].
</description>
<tutorials>
<link>https://docs.godotengine.org/en/3.4/getting_started/scripting/c_sharp/index.html</link>
<link>https://docs.godotengine.org/en/3.4/tutorials/scripting/c_sharp/index.html</link>
</tutorials>
<methods>
<method name="new" qualifiers="vararg">

View File

@ -236,10 +236,8 @@ int32_t godot_icall_Dictionary_KeyValuePairs(Dictionary *ptr, Array **keys, Arra
}
void godot_icall_Dictionary_KeyValuePairAt(Dictionary *ptr, int index, MonoObject **key, MonoObject **value) {
Array *keys = godot_icall_Dictionary_Keys(ptr);
Array *values = godot_icall_Dictionary_Values(ptr);
*key = GDMonoMarshal::variant_to_mono_object(keys->get(index));
*value = GDMonoMarshal::variant_to_mono_object(values->get(index));
*key = GDMonoMarshal::variant_to_mono_object(ptr->get_key_at_index(index));
*value = GDMonoMarshal::variant_to_mono_object(ptr->get_value_at_index(index));
}
void godot_icall_Dictionary_Add(Dictionary *ptr, MonoObject *key, MonoObject *value) {

View File

@ -9,7 +9,7 @@
You are most likely to use this class via the Visual Script editor or when writing plugins for it.
</description>
<tutorials>
<link>https://docs.godotengine.org/en/3.4/getting_started/scripting/visual_script/index.html</link>
<link>https://docs.godotengine.org/en/3.4/tutorials/scripting/visual_script/index.html</link>
</tutorials>
<methods>
<method name="add_custom_signal">

View File

@ -3120,7 +3120,7 @@ Error EditorExportPlatformAndroid::export_project_helper(const Ref<EditorExportP
bool skip = false;
String file = fname;
String file = String::utf8(fname);
Vector<uint8_t> data;
data.resize(info.uncompressed_size);
@ -3303,7 +3303,7 @@ Error EditorExportPlatformAndroid::export_project_helper(const Ref<EditorExportP
char extra[16384];
ret = unzGetCurrentFileInfo(tmp_unaligned, &info, fname, 16384, extra, 16384 - ZIP_ALIGNMENT, nullptr, 0);
String file = fname;
String file = String::utf8(fname);
Vector<uint8_t> data;
data.resize(info.compressed_size);

View File

@ -1755,7 +1755,7 @@ Error EditorExportPlatformIOS::export_project(const Ref<EditorExportPreset> &p_p
char fname[16384];
ret = unzGetCurrentFileInfo(src_pkg_zip, &info, fname, 16384, nullptr, 0, nullptr, 0);
String file = fname;
String file = String::utf8(fname);
print_line("READ: " + file);
Vector<uint8_t> data;

View File

@ -375,7 +375,7 @@ Error EditorExportPlatformJavaScript::_extract_template(const String &p_template
char fname[16384];
unzGetCurrentFileInfo(pkg, &info, fname, 16384, nullptr, 0, nullptr, 0);
String file = fname;
String file = String::utf8(fname);
// Skip service worker and offline page if not exporting pwa.
if (!pwa && (file == "godot.service.worker.js" || file == "godot.offline.html")) {

View File

@ -657,7 +657,7 @@ Error EditorExportPlatformOSX::export_project(const Ref<EditorExportPreset> &p_p
char fname[16384];
ret = unzGetCurrentFileInfo(src_pkg_zip, &info, fname, 16384, nullptr, 0, nullptr, 0);
String file = fname;
String file = String::utf8(fname);
Vector<uint8_t> data;
data.resize(info.uncompressed_size);

View File

@ -1265,10 +1265,10 @@ public:
while (ret == UNZ_OK) {
// get file name
unz_file_info info;
char fname[16834];
ret = unzGetCurrentFileInfo(pkg, &info, fname, 16834, nullptr, 0, nullptr, 0);
char fname[16384];
ret = unzGetCurrentFileInfo(pkg, &info, fname, 16384, nullptr, 0, nullptr, 0);
String path = fname;
String path = String::utf8(fname);
if (path.ends_with("/")) {
// Ignore directories

View File

@ -683,7 +683,7 @@ bool OS_X11::refresh_device_info() {
if (class_info->number == VALUATOR_ABSX && class_info->mode == XIModeAbsolute) {
resolution_x = class_info->resolution;
abs_x_min = class_info->min;
abs_y_max = class_info->max;
abs_x_max = class_info->max;
absolute_mode = true;
} else if (class_info->number == VALUATOR_ABSY && class_info->mode == XIModeAbsolute) {
resolution_y = class_info->resolution;
@ -697,8 +697,8 @@ bool OS_X11::refresh_device_info() {
tilt_x_min = class_info->min;
tilt_x_max = class_info->max;
} else if (class_info->number == VALUATOR_TILTY && class_info->mode == XIModeAbsolute) {
tilt_x_min = class_info->min;
tilt_x_max = class_info->max;
tilt_y_min = class_info->min;
tilt_y_max = class_info->max;
}
}
}
@ -2422,8 +2422,10 @@ void OS_X11::process_xevents() {
Map<int, Vector2>::Element *pen_tilt_x = xi.pen_tilt_x_range.find(device_id);
if (pen_tilt_x) {
Vector2 pen_tilt_x_range = pen_tilt_x->value();
if (pen_tilt_x_range != Vector2()) {
xi.tilt.x = ((*values - pen_tilt_x_range[0]) / (pen_tilt_x_range[1] - pen_tilt_x_range[0])) * 2 - 1;
if (pen_tilt_x_range[0] != 0 && *values < 0) {
xi.tilt.x = *values / -pen_tilt_x_range[0];
} else if (pen_tilt_x_range[1] != 0) {
xi.tilt.x = *values / pen_tilt_x_range[1];
}
}
@ -2434,8 +2436,10 @@ void OS_X11::process_xevents() {
Map<int, Vector2>::Element *pen_tilt_y = xi.pen_tilt_y_range.find(device_id);
if (pen_tilt_y) {
Vector2 pen_tilt_y_range = pen_tilt_y->value();
if (pen_tilt_y_range != Vector2()) {
xi.tilt.y = ((*values - pen_tilt_y_range[0]) / (pen_tilt_y_range[1] - pen_tilt_y_range[0])) * 2 - 1;
if (pen_tilt_y_range[0] != 0 && *values < 0) {
xi.tilt.y = *values / -pen_tilt_y_range[0];
} else if (pen_tilt_y_range[1] != 0) {
xi.tilt.y = *values / pen_tilt_y_range[1];
}
}

View File

@ -472,7 +472,7 @@ void Control::_notification(int p_notification) {
} break;
case NOTIFICATION_EXIT_TREE: {
ERR_FAIL_COND(!get_viewport());
release_focus();
get_viewport()->_gui_remove_control(this);
} break;

View File

@ -557,28 +557,16 @@ void TabContainer::add_child_notify(Node *p_child) {
return;
}
bool first = false;
call_deferred("_repaint");
update();
if (get_tab_count() != 1) {
c->hide();
} else {
c->show();
//call_deferred("set_current_tab",0);
first = true;
bool first = (get_tab_count() == 1);
if (first) {
current = 0;
previous = 0;
}
c->set_anchors_and_margins_preset(Control::PRESET_WIDE);
if (tabs_visible) {
c->set_margin(MARGIN_TOP, _get_top_margin());
}
Ref<StyleBox> sb = get_stylebox("panel");
c->set_margin(MARGIN_TOP, c->get_margin(MARGIN_TOP) + sb->get_margin(MARGIN_TOP));
c->set_margin(MARGIN_LEFT, c->get_margin(MARGIN_LEFT) + sb->get_margin(MARGIN_LEFT));
c->set_margin(MARGIN_RIGHT, c->get_margin(MARGIN_RIGHT) - sb->get_margin(MARGIN_RIGHT));
c->set_margin(MARGIN_BOTTOM, c->get_margin(MARGIN_BOTTOM) - sb->get_margin(MARGIN_BOTTOM));
update();
p_child->connect("renamed", this, "_child_renamed_callback");
if (first) {
emit_signal("tab_changed", current);
@ -1069,6 +1057,7 @@ void TabContainer::_bind_methods() {
ClassDB::bind_method(D_METHOD("get_use_hidden_tabs_for_min_size"), &TabContainer::get_use_hidden_tabs_for_min_size);
ClassDB::bind_method(D_METHOD("_child_renamed_callback"), &TabContainer::_child_renamed_callback);
ClassDB::bind_method(D_METHOD("_repaint"), &TabContainer::_repaint);
ClassDB::bind_method(D_METHOD("_on_theme_changed"), &TabContainer::_on_theme_changed);
ClassDB::bind_method(D_METHOD("_on_mouse_exited"), &TabContainer::_on_mouse_exited);
ClassDB::bind_method(D_METHOD("_update_current_tab"), &TabContainer::_update_current_tab);

View File

@ -1870,6 +1870,7 @@ void Animation::value_track_set_update_mode(int p_track, UpdateMode p_mode) {
ValueTrack *vt = static_cast<ValueTrack *>(t);
vt->update_mode = p_mode;
emit_changed();
}
Animation::UpdateMode Animation::value_track_get_update_mode(int p_track) const {

View File

@ -463,7 +463,7 @@ Error StreamTexture::_load_data(const String &p_path, int &tw, int &th, int &tw_
ERR_FAIL_COND_V(image.is_null(), ERR_INVALID_PARAMETER);
FileAccess *f = FileAccess::open(p_path, FileAccess::READ);
ERR_FAIL_COND_V(!f, ERR_CANT_OPEN);
ERR_FAIL_COND_V_MSG(!f, ERR_CANT_OPEN, vformat("Unable to open file: %s.", p_path));
uint8_t header[4];
f->get_buffer(header, 4);