Commit graph

927 commits

Author SHA1 Message Date
PouleyKetchoupp c4b116cff7 Added option in project settings to draw Shape2D outlines
Disabling collision outlines can be useful for performance when the game
is running and many collision shapes are displayed.
2021-02-25 07:52:50 -07:00
reduz d6a9cff8b7 Add preview Sun and Environment
* Adds both a preview sun and preview environment to the 3D editor.
* They are valid as long as a DirectionalLight3D and WorldEnvironment are not in the scene.
* If any is added to the scene, the respective preview is disabled.
* Changed WorldEnvironment to better handle multiple node versions.
* Added a function in SceneTree to get the first node in a group.
* Fixed button minimum size to also consider font height if no text is there, this broke with the TextSever PR.
2021-02-22 16:56:29 -03:00
Rémi Verschelde 8c5d4770e9
Merge pull request #46243 from Calinou/improve-get-node-error-message
Improve the `get_node()` error message to be more descriptive
2021-02-22 13:02:48 +01:00
Hugo Locurcio e6abdc943d
Improve the get_node() error message to be more descriptive
- Mention the origin of the `get_node()` call.
- Mention whether the attempted path is absolute or relative.

See #46214.
2021-02-22 12:19:23 +01:00
hilfazer 442e550114 Prevent selecting hidden nodes in 3D and Canvas Item editors 2021-02-21 11:58:31 +01:00
Hugo Locurcio 23a1f616fd
Draw an outline for 2D debug collision shapes
This makes them easier to distinguish, especially when used
in a TileMap.

The default color's opacity has been slightly decreased to account
for the new outline.
2021-02-20 00:00:03 +01:00
Aaron Franke 78de8a762b
Update documentation for the new ProcessMode 2021-02-19 10:22:09 -05:00
Rémi Verschelde 0d1d719178 doc: Sync classref with current source
And fix various bogus bindings following previous PRs.
2021-02-19 14:39:14 +01:00
Rémi Verschelde 04cb7e638c
Merge pull request #46191 from reduz/refactor-process-mode
Refactor Process Mode
2021-02-19 13:46:50 +01:00
Eric M 3db45ff198 New ActionMapEditor to replace InputMapEditor. Used in ProjectSettings.
Renamed to ActionMapEditor as it is more generic and can be used for more than just the InputMapEditor if required.
This also includes a new Event Configuration dialog (previously "Press A key...") which can be used to create and edit InputEvents for any use - like the Project Settings input map, or the Editor Settings shortcuts.
2021-02-19 19:36:42 +10:00
reduz 083aa9b95e Refactor Process Mode
Implements https://github.com/godotengine/godot-proposals/issues/1835#issuecomment-727186192

* PauseMode is now ProcessMode, containing the following states:
	```
	PROCESS_MODE_INHERIT, // same as parent node
	PROCESS_MODE_NORMAL, // process only if not paused
	PROCESS_MODE_PAUSE_ONLY, // process only if paused
	PROCESS_MODE_ALWAYS, // process always
	PROCESS_MODE_DISABLED, // never process
	```
* NOTIFICATION_PAUSED and NOTIFICATION_UNPAUSED are received effectively when the node is paused and unpaused (not any longer when pause mode is set in SceneTree).
* Renamed some nodes that used ProcessMode/process_mode to specify a callback type to ProcessCallback to avoid clashes.
2021-02-18 20:39:55 -03:00
Rémi Verschelde 310496a89f
Merge pull request #45617 from RandomShaper/modernize_atomics
Modernize atomics (and fix `volatile`)
2021-02-18 19:40:31 +01:00
Pedro J. Estébanez 8e128726f0 Modernize atomics
- Based on C++11's `atomic`
- Reworked `SafeRefCount` (based on the rewrite by @hpvb)
- Replaced free atomic functions by the new `SafeNumeric<T>`
- Replaced wrong cases of `volatile bool` by the new `SafeFlag`
- Platform-specific implementations no longer needed

Co-authored-by: Hein-Pieter van Braam-Stewart <hp@tmm.cx>
2021-02-18 17:12:46 +01:00
reduz 64140eaf42 Reorganize Project Settings
-Advanced Settings toggle also hides advanced properties when disabled
-Simplified Advanced Bar (errors were just plain redundant)
-Reorganized rendering quality settings.
-Reorganized miscelaneous settings for clean up.
2021-02-18 11:23:34 -03:00
bruvzg d78336c65e
[CTL] Add missing font outline drawing routines and theme constants. 2021-02-14 14:11:44 +02:00
Rémi Verschelde e7ab3a4132
Merge pull request #34892 from KoBeWi/copy-pasta_v7
Yet another node copy-paste PR
2021-02-12 23:16:31 +01:00
kobewi 36494e8526 Duplicate resources pasted to other scenes 2021-02-12 22:38:38 +01:00
MarvinFF 4c528e76e7 Fix Node::rpc_config return error
Fix StringName type checks in other `_rpc*_bind` methods.
2021-02-11 11:52:52 +01:00
reduz 1aa2823fa3 Removed _change_notify
-For inspector refresh, the inspector now detects if a property change by polling a few times per second and then does update the control if so. This process is very cheap.
-For property list refresh, a new signal (property_list_changed) was added to Object. _change_notify() is replaced by notify_property_list_changed()
-Changed all objects using the old method to the signal, or just deleted the calls to _change_notify(<property>) since they are unnecesary now.
2021-02-10 19:31:24 -03:00
Rémi Verschelde e8f73124a7
Merge pull request #45845 from qarmin/cppcheck_scene_2
Initialize class variables with default values in scene/ [2/2]
2021-02-10 20:06:12 +01:00
reduz 8b19ffd810 Make Servers truly Thread Safe
-Rendering server now uses a split RID allocate/initialize internally, this allows generating RIDs immediately but initialization to happen later on the proper thread (as rendering APIs generally requiere to call on the right thread).
-RenderingServerWrapMT is no more, multithreading is done in RenderingServerDefault.
-Some functions like texture or mesh creation, when renderer supports it, can register and return immediately (so no waiting for server API to flush, and saving staging and command buffer memory).
-3D physics server changed to be made multithread friendly.
-Added PhysicsServer3DWrapMT to use 3D physics server from multiple threads.
-Disablet Bullet (too much effort to make multithread friendly, this needs to be fixed eventually).
2021-02-10 13:21:46 -03:00
PouleyKetchoupp e5e9be8355 Fix contact points debug for 3D Physics
Setting each point's position was missing for 3D. Now enabling collision
render debug will display contact points for 3D physics, the same way it
does for 2D physics.

Note: Multimesh rendering seems not to work in this scenario on master,
but it's working fine on 3.2.
2021-02-09 18:36:38 -07:00
Rafał Mikrut 7961a1dea3 Initialize class variables with default values in scene/ [2/2] 2021-02-09 18:24:36 +01:00
Pedro J. Estébanez a63996ac95 Implement pause-aware picking
This changes the way 2D & 3D physics picking behaves in relation to pause:
- When pause is set, every collision object that is hovered or captured (3D only) is released from that condition, getting the relevant mouse-exit callback., unless its pause mode makes it immune from pause.
- During the pause. picking only considers collision objects immune from pause, sending input events and enter/exit callbacks to them as expected.
- When pause is left, nothing happens. This is a big difference with the classic behavior, which at this point would process all the input events that have been queued against the current state of the 2D/3D world (in other words, checking them against the current position of the objects instead of those at the time of the events).
2021-02-07 00:50:16 +01:00
nemerle 022c2952fc Node::replace_by was not copying node properties - removed the dead code.
The code to copy node properties to the new node never worked, so there is no reason to keep the useless bits in there
2021-02-01 16:47:27 +01:00
Rémi Verschelde 5525cd85c6
Merge pull request #45315 from RandomShaper/modernize_thread
Modernize Thread
2021-01-31 15:24:56 +01:00
Pedro J. Estébanez 99fe462452 Modernize Thread
- Based on C++11's `thread` and `thread_local`
- No more need to allocate-deallocate or check for null
- No pointer anymore, just a member variable
- Platform-specific implementations no longer needed (except for the few cases of non-portable functions)
- Simpler for `NO_THREADS`
- Thread ids are now the same across platforms (main is 1; others follow)
2021-01-29 12:02:13 +01:00
reduz a9beb7aa8c Shadow map rendering optimization
-All shadow rendering is done with raster now (no compute)
-All shadow rendering is done by rendering directly to the shadow atlas
-Improved how buffer clearing is done to optimize the above.
-Ability to set shadows as 16 bits.
2021-01-24 20:17:28 -03:00
reduz 099dee35f4 Added GPU based cluster builder
Clustering is now GPU based, uses an implementation based on the Activision algorithm.
2021-01-19 23:31:06 +01:00
kobewi 05f29b16b6 Change how editable children data is stored
Co-authored-by: hilfazer <az13337@gmail.com>
2021-01-17 23:37:40 +01:00
AberrantWolf cff0352b3d Make tooltips appear on the same display as the editor
The `current_screen` field was never being set on tooptip windows, leading to scenarios where, if the editor wasn't on screen 0, tooltips may not appear in the right place, especially when your screens have different resolutions.
2021-01-07 12:16:55 +03:00
reduz cdb216f4e4 Added ability to visualize native shaders 2021-01-06 09:40:09 -03:00
Rémi Verschelde a4af94068a
Tooltips: Fix unassigned strip_edges() call on text
Fixes #43940, was a regression from #43280.
2021-01-05 15:14:27 +01:00
Rémi Verschelde b5334d14f7
Update copyright statements to 2021
Happy new year to the wonderful Godot community!

2020 has been a tough year for most of us personally, but a good year for
Godot development nonetheless with a huge amount of work done towards Godot
4.0 and great improvements backported to the long-lived 3.2 branch.

We've had close to 400 contributors to engine code this year, authoring near
7,000 commit! (And that's only for the `master` branch and for the engine code,
there's a lot more when counting docs, demos and other first-party repos.)

Here's to a great year 2021 for all Godot users 🎆
2021-01-01 20:19:21 +01:00
Rémi Verschelde a6b869988f
Merge pull request #44276 from YeldhamDev/tooltip_position_embedded_fix
Fix tooltip position in main embedded window
2021-01-01 16:28:59 +01:00
Rémi Verschelde e4c0572385
Merge pull request #44593 from madmiraal/rename-mainloop-methods
Rename MainLoop methods to match Node methods
2020-12-28 14:44:28 +01:00
Marcel Admiraal 5b937d493f Rename empty() to is_empty() 2020-12-28 10:39:56 +00:00
Marcel Admiraal 4b8b803931 Rename Control margin to offset 2020-12-23 06:25:56 +00:00
Marcel Admiraal d9e9eb8d04 Rename MainLoop methods to match Node methods 2020-12-22 12:34:57 +00:00
Rémi Verschelde 153c132a7e
Merge pull request #44300 from KoBeWi/🧹🧹
Move initialization of some classes to headers
2020-12-21 00:24:36 +01:00
reduz d2302f53d6 Implement automatic LOD (Level of Detail)
-Happens on import by default for all models
-Just works (tm)
-Biasing can be later adjusted per node or per viewport (as well as globally)
-Disabled AABB.get_support test because its broken
2020-12-18 15:48:03 +01:00
Daniel Ting aea7fde241 Rename neighbour in Control to neighbor
This keeps things consistent with the rest of Godot, which uses the
American English spelling of Color.
2020-12-15 16:42:21 -06:00
Tomasz Chabora 31cb04fbdd Move initialization of some classes to headers 2020-12-11 18:20:03 +01:00
Michael Alexsander 48027448bf Fix tooltip position in embedded window 2020-12-10 16:11:57 -03:00
Marcel Admiraal 284642be01 Rename Viewport::ClearMode::CLEAR_MODE_ONLY_NEXT_FRAME to CLEAR_MODE_ONCE 2020-12-10 12:24:49 +00:00
Rémi Verschelde 114f97ff11
Merge pull request #44128 from KoBeWi/🧹
Cleanup unused engine code
2020-12-09 13:01:50 +01:00
Tomasz Chabora 2c048ea164 Cleanup unused engine code 2020-12-09 12:12:36 +01:00
bruvzg 644f739660
Static analyzer fixes:
Removes unused code in OS.
Fixes return types.
Fixes few typos.
2020-12-09 10:17:53 +02:00
Marcel Admiraal 43302837eb Rename CanvasItem's hide signal to hidden 2020-12-08 12:14:15 +00:00
Yuri Roubinsky 4a3588a51a
Merge pull request #43828 from Chaosus/restore_line_antialiasing
Restored antialiased lines by emulation using triangle strips
2020-11-28 11:32:16 +03:00