Commit graph

919 commits

Author SHA1 Message Date
Rémi Verschelde
25c87e99cf
Merge pull request #61578 from YuriSizov/core-fix-events-for-moved-nodes-3.x 2022-08-05 19:33:25 +02:00
Rémi Verschelde
818f1eed31 Code quality: Fix header guards consistency
Adds `header_guards.sh` bash script, used in CI to validate future
changes. Can be run locally to fix invalid header guards.
2022-07-25 14:53:37 +02:00
Marcel Admiraal
fb4e1d2d02 Set initial SceneTree processes times to 0.0 2022-07-17 09:02:20 +01:00
Marcel Admiraal
0992621200 Fix mouse_over not dropped when mouse leaves window 2022-07-03 09:49:56 +01:00
reduz
995281ca90 Fix editor-only visibility for lights
* Update visibility again for editor-only lights if owner changes.

Fixes #26399, supersedes #52327

(cherry picked from commit d69e3791bf)
2022-07-03 03:21:51 +02:00
Rémi Verschelde
df70aa1772
Merge pull request #57566 from Calinou/viewport-shadow-atlas-clamp-sizes 2022-07-03 03:08:03 +02:00
Rémi Verschelde
3d19f21576
Merge pull request #49967 from Calinou/viewport-2d-hdr-print-warning 2022-07-03 02:41:26 +02:00
hilfazer
fe21fb175c print_stray_nodes() also prints node's script 2022-07-03 01:00:58 +02:00
Rémi Verschelde
0cb897421a Node: Rename child_exited_tree to child_exiting_tree
The name was confusing as this signal is emitted around the same time as
`tree_exiting` and `NOTIFICATION_EXIT_TREE`, i.e. while the child node is
still in tree.

Fixes #59210.

(cherry picked from commit 3e6de687b8)
2022-06-20 15:00:09 +02:00
lawnjelly
ba74643594 Force unsigned behaviour for bitfield enums
Some compilers (notably MSVC) were using signed values for bitfield enums. This was causing problems where 2 bits were used to store 4 or less enum values, where they were being treated as negative numbers.

This PR explicitly requests these enums to be treated as unsigned values.
2022-06-06 16:58:21 +01:00
Haoyu Qiu
d043f91b79 Fix Viewport.own_world documentation
Also fixed the naming of the setter's parameter and made an `if` block
straightforward.
2022-06-06 21:34:36 +08:00
Rémi Verschelde
a6b27b526f
Merge pull request #60822 from lawnjelly/fti_add_child_reset 2022-06-03 14:56:19 +02:00
Yuri Sizov
6d53c60bf7 Mark node groups as dirty for every children if parent is moved 2022-05-31 21:23:16 +03:00
Rémi Verschelde
67208ae80b
Merge pull request #60402 from Calinou/httprequest-timeout-float 2022-05-20 15:27:29 +02:00
Haoyu Qiu
58650af062 Make auto_accept_quit and quit_on_go_back properties 2022-05-14 18:24:43 +08:00
Hugo Locurcio
069c955af7
Use a floating-point number for the timeout property in HTTPRequest
This allows for greater precision when specifying a timeout in
HTTPRequest in `3.x`, similar to what is already possible in `master`.
2022-05-11 08:41:40 +02:00
lawnjelly
328866ee6a Physics Interpolation - Reset on adding child to SceneTree
For convenience, branches added to the SceneTree now have physics interpolation reset after the first update of the transform to the VisualServer.
2022-05-10 11:09:20 +01:00
lawnjelly
0ab077fcef Physics Interpolation - add interpolation mode property to node
Exposes the "interpolated" flag on nodes via a property, physics_interpolation_mode.

Mode can be INHERIT, OFF and ON. This makes it easy to turn off interpolation for nodes in the editor, versus via code.
2022-05-07 13:51:49 +01:00
lawnjelly
df7fab51a3 Physics Interpolation - Flush transforms after physics tick
Leftover transforms from the physics tick were being flushed during idle, which was causing problems for physics interpolation.

This PR flushes the transforms at the end of the physics tick when physics interpolation is active.
2022-05-04 20:30:46 +01:00
Rémi Verschelde
6ee64331db
Merge pull request #60527 from KoBeWi/unique_names_demastered 2022-05-02 10:48:27 +02:00
Haoyu Qiu
153dc4d57e Backport the new Tween system as SceneTreeTween
Co-authored-by: Tomasz Chabora <kobewi4e@gmail.com>
2022-04-29 20:01:12 +08:00
Haoyu Qiu
d088128b43 Remove duplicate editor settings definitions 2022-04-27 15:26:46 +08:00
kobewi
e1c74ae83f Implement Scene Unique Nodes 2022-04-26 13:55:48 +02:00
Rémi Verschelde
e1eb3c2fb1
Merge pull request #60147 from lawnjelly/interpolation_out_of_scenario 2022-04-13 17:08:08 +02:00
Hugo Locurcio
cd1432eb12
Hide Viewport properties not applicable to the current rendering backend
This also adds a missing property range hint for the Sharpen Intensity
property (similar to the project setting).
2022-04-12 18:11:45 +02:00
lawnjelly
d2b1d29634 Physics interpolation - Move out of Scenario
Move VisualServer interpolation data out of Scenario and into VisualServerScene, so the interpolation data and enabled status is now common to all Scenarios.

Fix physics interpolation in multithreaded mode by ensuring tick and pre-draw are called.
2022-04-11 15:04:24 +01:00
Rémi Verschelde
21c3048397 Add missing argument names in bindings 2022-04-04 12:56:59 +02:00
Fredy Huya-Kouadio
cb0b2aefc3 Android port of the Godot Editor
These set of changes focus primarily on getting the core logic and overall Godot Editor UI and functionality up and running natively on Android devices.
UI tweaks / cleanup / polish, as well configuration for Android specific functionality / restrictions will be addressed in follow-up PRs iteratively based on feedback.

Co-authored-by: thebestnom <shoval.arad@gmail.com>
2022-03-28 07:54:10 -07:00
Markus Sauermann
62fa80afd7 Cleanup internal GUI state, if event is accepted in _input. 2022-03-14 18:36:31 +01:00
Rémi Verschelde
fdaf0de3f0
Merge pull request #59100 from RandomShaper/mouse_drop_on_disable_3.x 2022-03-14 11:25:12 +01:00
Pedro J. Estébanez
3d7821bf1f Drop mouse focus and over when gui input is globally disabled
Since some porjects may be relying on the former behavior, this is opt-in via a new project setting, disabled by default, but enabled for new projects, since it's the new standard behavior (and the only one in 4.0).
2022-03-14 11:06:26 +01:00
Rémi Verschelde
08c3e00b95
Merge pull request #55355 from ConteZero/drag_and_drop_3.x 2022-03-14 08:43:22 +01:00
ConteZero
4167e98088 Add drag and drop to TextEdit, LineEdit, RichTextLabel 2022-03-14 08:15:25 +01:00
Pedro J. Estébanez
0b650b3e41 Clear owners when pruning even out of the tree 2022-03-12 12:48:15 +01:00
Rémi Verschelde
85b4848ca8
Merge pull request #54188 from Rubonnek/increase_var_arg_max_3x 2022-03-08 13:10:48 +01:00
Haoyu Qiu
b76147ec16 Fix top level CanvasItem visibility
The editor gizmo fix from previously reverted
642591b6a9 is kept here.
2022-03-08 01:29:24 +08:00
Haoyu Qiu
ba0a17a458 Revert "Fix CanvasItem visibility propagation"
This reverts commit 642591b6a9.
2022-03-08 01:06:14 +08:00
Wilson E. Alvarez
424dbf70af
Increase VARIANT_ARG_MAX to 8 2022-03-07 10:03:49 -05:00
lawnjelly
688dc534e5 Fix get_global_transform_interpolated() with multiple ticks per frame
The previous and current transforms in the interpolation data were not being correctly updated in cases where two or more physics ticks occurred on a frame. This PR introduces a simple mechanism to ensure updates on interpolated spatials.
2022-02-25 11:22:00 +00:00
Rémi Verschelde
4e44a15176
Merge pull request #58386 from KoBeWi/fix3bility 2022-02-21 12:33:28 +01:00
lawnjelly
b90f1a3ec0 Disable jitter fix when physics interpolation is enabled. 2022-02-21 10:32:42 +00:00
kobewi
642591b6a9 Fix CanvasItem visibility propagation 2022-02-21 11:11:03 +01:00
Wagner Scholl Lemos
2ed43f940b
Added show and hide methods and updated doc API.
(cherry picked from commit 160ee4ef8e)
2022-02-17 09:52:47 +01:00
lawnjelly
522bce1159 Fixed Timestep Interpolation (3D)
Adds fixed timestep interpolation to the visual server.
Switchable on and off with project setting.

This version does not add new API for set_transform etc, when nodes have the interpolated flag set they will always use interpolation.
2022-02-16 09:41:23 +00:00
Rémi Verschelde
7a16bb2ee4
Fix typos with codespell
Using codespell 2.2-dev from current git.

Added `misc/scripts/codespell.sh` to make it easier to run it once in a
while and update the skip and ignore lists.

(cherry picked from commit 1bdb82c64e)
2022-02-11 09:50:59 +01:00
reduz
e4e3f7d157
Add a signal to notify when children nodes enter or exit tree
-Allows more fine grained notifications (hence better performance) than using the global scene tree signals (node added and removed).
-Required for #55950

(cherry picked from commit fbd9599b04)
2022-02-11 09:50:58 +01:00
Haoyu Qiu
f49ffe4bb0 Backport CanvasLayer visibility 2022-02-11 01:00:35 +08:00
Nathan Franke
c27b05febb
use exact match when checking focus next / previous 2022-02-09 10:18:58 -06:00
lawnjelly
f0af29346b ProjectSettings add dirty flag and project_settings_changed signal
Most frames there will be no change in project settings, and it makes no sense to read settings every frame in case of changes, as a large number of string compares are involved.

This PR adds a signal to ProjectSettings that can be subscribed to in order to keep local settings up to date with ProjectSettings.

In addition a function `ProjectSettings::has_changes()` is provided for objects outside the signal system (e.g. Rasterizers).
2022-02-09 11:20:25 +00:00
Hugo Locurcio
92376633f3
Clamp Viewport shadow atlas sizes to improve usability
- Add a range hint to the Viewport `shadow_atlas_size` property.
- Add range steps to the shadow resolution project settings that
  match the lowest allowed values (since lower increments don't
  make sense).
2022-02-04 18:01:16 +01:00
Rémi Verschelde
80306cc88a
EditorProperty: Fix range hint parsing with optional step
This could lead to have a step of 0 when parsing e.g. "1,10,is_greater".
2022-02-03 12:33:37 +01:00
kobewi
621cf7d8d5 Update the minimum size of ViewportContainer 2022-02-02 13:21:03 +01:00
Bartłomiej T. Listwon
94ddd4168d Simplify usage of OS::get_window_size() in SceneTree methods 2022-01-28 23:02:48 +01:00
Bartłomiej T. Listwon
d3473b2a95
Rework Node::get_node to omit is_absolute() check in best case scenario
(cherry picked from commit e2792cc71c)
2022-01-25 18:13:42 +01:00
Haoyu Qiu
08af6e0407
Replicate load-as-placeholder state on node duplication
(cherry picked from commit 6aecf91e4f)
2022-01-19 16:01:04 +01:00
Rémi Verschelde
a627cdafc5
Update copyright statements to 2022
Happy new year to the wonderful Godot community!
2022-01-13 15:54:13 +01:00
Jake Young
09bc9eb101
Backport NavigationServer with RVO2 to 3.x
Change the entire navigation system.
Remove editor prefix from nav mesh generator class. It is now used for baking
at runtime as well.
Navigation supports obstacle avoidance now with the RVO2 library.
Nav system will also automatically link all nav meshes together to form one
overall complete nav map.
2022-01-05 16:00:56 +01:00
Pedro J. Estébanez
571e05d3d3
Clear only owners that are no longer in the same tree
(cherry picked from commit 2db9397fb9)
2022-01-05 15:51:18 +01:00
Rémi Verschelde
e22f7ea3c0
Merge pull request #55514 from RandomShaper/better_node_delete_3.x 2022-01-05 10:25:33 +01:00
Rémi Verschelde
25369acff9
Merge pull request #51708 from Calinou/viewport-add-32bpc-color-depth 2022-01-04 14:30:24 +01:00
vitika9
e88f387958
Added check for SceneTree being null
(cherry picked from commit 51501dadcc)
2021-12-21 11:27:33 +01:00
Haoyu Qiu
1cada6bfa9 Add proxy support for HTTPClient and the editor
* Adds proxy related methods for `HTTPClient` and `HTTPRequest`
* Adds `network/http_proxy/{host,port}` editor settings
* Makes AssetLib and Export Template Manager proxy aware
2021-12-16 19:38:53 +08:00
Rémi Verschelde
35b79284cc
SceneTree: Document font oversampling, remove warnings 2021-12-07 14:15:09 +01:00
Rémi Verschelde
98e0ebfc4b
Merge pull request #55480 from univeous/fix-joystick-focus-3.x 2021-12-07 12:15:42 +01:00
lawnjelly
3d981b8265 Add option to use handles to RID
Adds an option to compile an alternative implementation for RIDs, which allows checks for erroneous usage patterns as well as providing leak tests.
2021-12-06 14:43:34 +00:00
Rémi Verschelde
cd4a08ada3
Viewport: Fixup dragging code after a0fb66d
The check was removed by mistake while cherry-picking.
2021-12-03 13:19:59 +01:00
Haoyu Qiu
a0fb66d802
Fix mouse cursor and notification for force dragging
(cherry picked from commit 86a47c6540)
2021-12-03 12:51:15 +01:00
Pedro J. Estébanez
b4998e7e1b Rationalize Node removals and deletions
- Regarding preservation of owner, `free()` and `remove_child()` now behave the same: owner is kept during `tree_exiting` signal and `null` during `tree_exited`.
- Superfluous code to handle cancelation of ownership is removed.
2021-12-01 14:43:36 +01:00
Univeous
cf788ae684 Fix UI navigation with joysticks 2021-12-01 00:19:17 +08:00
kobewi
fe28e823c5 Don't show tooltips for paused controls 2021-11-29 16:44:32 +01:00
kobewi
5b55599211 Show tooltips even when paused or time_scale is 0 2021-11-22 12:54:05 +01:00
Marcel Admiraal
4d3690eba5 Remove unimplemented methods 2021-11-18 12:47:36 +00:00
vdyotte
30f359ee3c
fix hardcoded raycast distance with viewport object picking
having the raycast distance hardcoded to `10000` caused input events
to not be registered in very large 3D scenes.

This resolves the issue by using the cameras far distance instead.
Creating the more predictable behavior of if an object is visible,
it will be picked by the viewport.

resolves: #49735
(cherry picked from commit 02b6bbc5df)
2021-11-15 16:31:25 +01:00
Rémi Verschelde
6f4858f184
Modules: Make sure to include modules_enabled.gen.h where needed
Fixes #51677.

Co-authored-by: Arkadiusz Marcin Kołek <aksoftware91@gmail.com>
2021-11-12 13:45:33 +01:00
Rémi Verschelde
bee67513fb
Merge pull request #54033 from nekomatata/fix-collision-mouse-exit-error-3.x 2021-11-09 00:00:47 +01:00
Pedro J. Estébanez
4dba25b3ff Add property value pinning 2021-11-08 17:42:27 +01:00
Josh Jones
7df8bd6b85 Fix request headers being included in response. 2021-11-06 12:56:25 -07:00
Rémi Verschelde
42d385b312
clang-format: Disable alignment of operands, too unreliable
Sets `AlignOperands` to `DontAlign`.

`clang-format` developers seem to mostly care about space-based indentation and
every other version of clang-format breaks the bad mismatch of tabs and spaces
that it seems to use for operand alignment. So it's better without, so that it
respects our two-tabs `ContinuationIndentWidth`.
2021-10-28 13:23:38 +02:00
kobewi
cef504b955
Fix multiple definitions of Listener2D
(cherry picked from commit 6b68445e4d)
2021-10-26 13:34:33 +02:00
Sean Kim
378ca68dc1
Fix potential nullptr dereference in CanvasLayer
* Changed another instance of ERR_FAIL_COND in the same file to
  ERR_FAIL_NULL_MSG instead.
* Checked for potential access of the viewport pointer elsewhere in same
  file.

Fixes #54098

(cherry picked from commit 497b00a937)
2021-10-23 11:57:52 +02:00
PouleyKetchoupp
b4b94ac8a0 Fix errors in mouse detection when removing collision object from tree
Now behaves the same way as ui elements, mouse exit is skipped when the
object is removed from the tree.
2021-10-20 09:01:26 -07:00
Fabio Alessandrelli
6c4bb3fc4a Revert HTTPRequest gzip compression support.
Partial revert of commit c1135cf006.
2021-10-14 12:51:37 +02:00
Hugo Locurcio
7dcefa7c1b
Add a warning for Timer nodes with very low wait times
Very low wait times behave in unpredictable ways depending on the
rendered frame rate. This is because the timeout signal is only emitted
once per rendered frame (or physics frame, depending on the timer's
process mode).
2021-10-09 11:36:03 +02:00
Rémi Verschelde
c00848ae03
Merge pull request #53572 from kleonc/scene-tree-free-objects-queued-during-destruction-3x 2021-10-08 18:10:45 +02:00
kleonc
ae96da28d8 Delete objects enqueued for deletion during SceneTree destruction 2021-10-08 16:38:38 +02:00
Rémi Verschelde
77f52bdf99
Merge pull request #52137 from Ansraer/3.x-2d-scale-factor 2021-10-05 19:12:19 +02:00
Rémi Verschelde
d35fccb651
Merge pull request #52365 from jitspoe/3.x.viewport_error_fix
[3.x] Fix ViewportTexture error when viewport is used from a child scene
2021-10-05 18:51:51 +02:00
Ansraer
d44aa61735 implement better ui scaling 2021-10-05 14:30:38 +02:00
kobewi
f9720a9bf2 Add Listener2D 2021-10-05 13:29:59 +02:00
jitspoe
d2637ca950
Fix ViewportTexture error when viewport is used from a child scene
Fix invalid errors when a separate child scene file contains a viewport and
that viewport is used for a texture in the current scene.

Fixes #27790.
2021-10-05 12:17:42 +02:00
Hugo Locurcio
c6617e956c
Tweak the Viewport configuration warning to mention 2×2 size requirement 2021-10-01 16:43:33 +02:00
Rémi Verschelde
b37776fa2f
Merge pull request #52591 from timothyqiu/error-macros
[3.x] Remove do{ } while(0) wrapper around error macros
2021-09-21 10:38:34 +02:00
Haoyu Qiu
70853fd669 Remove do{ } while(0) wrapper around error macros 2021-09-12 15:04:53 +08:00
Hugo Locurcio
1c63e335b3
Improve the error message about SCREEN_TEXTURE being unavailable
This also tweaks the Viewport `usage` property hint to match the
project setting used for the root viewport.
2021-09-11 23:17:07 +02:00
Hugo Locurcio
5335a0368c
Add a Viewport property to use full floating-point precision in HDR
This is only available on the GLES3 backend.

This can be useful for advanced shaders, but it should generally
not be enabled otherwise as full precision has a performance cost.
For general-purpose rendering, the built-in debanding filter should
be used to reduce banding instead.
2021-08-16 03:16:01 +02:00
Rémi Verschelde
7c6bdea33c
Merge pull request #47416 from Calinou/add-contrast-adaptive-sharpening-3.x
Add support for contrast-adaptive sharpening in 3D (GLES3 only)
2021-08-10 10:08:24 +02:00
foxydevloper
f807c7e569
Name nodes added from drag & drop by name_casing
(cherry picked from commit 07a8f0fe38)
2021-08-03 10:18:04 +02:00
Aaron Franke
e47018ffa4
[3.x] Fix building with the FreeType module disabled 2021-07-29 21:47:40 -05:00
Eric M
7b6b402a0c
Added Node name to print() when printing Nodes.
(cherry picked from commit 3ca25ffe8a)
2021-07-20 13:05:09 +02:00
kleonc
6d48b67f14
Node::add_child Check for cyclic dependency
Node Replace string addition with vformat()

Co-authored-by: Rémi Verschelde <rverschelde@gmail.com>
(cherry picked from commit 81388db8a7)
2021-07-15 10:52:33 +02:00