Commit graph

2348 commits

Author SHA1 Message Date
Rémi Verschelde 70ae90e0e8
Core: Drop custom copymem/zeromem defines
We've been using standard C library functions `memcpy`/`memset` for these since
2016 with 67f65f6639.

There was still the possibility for third-party platform ports to override the
definitions with a custom header, but this doesn't seem useful anymore.

Backport of #48239.
2021-04-29 12:34:11 +02:00
Rafał Mikrut 06976c3e84 [3.x] Fix crashes when using _input functions 2021-04-27 16:51:29 +02:00
ray90514 bf645099a1
Fix multi-selection doesn't correctly show in the inspector
(cherry picked from commit 16decbc0ee)
2021-04-26 13:15:29 +02:00
Hugo Locurcio e2934a04e2
Allow Center Selection to work without any selection in 2D/3D editors
When there is no selection, the camera will center around the
world origin.

This helps people get back to the world center if they haven't added
any nodes yet.

(cherry picked from commit fc055e1993)
2021-04-26 13:15:28 +02:00
Kyle cc419fcf8f
Fixes ctrl-click function line centering
When ctrl-clicking in the code editor, the view will now be centered on the function result.

Also replaces a circumstance where goto_line_centered should be used.

(cherry picked from commit 2b775bd698)
2021-04-26 13:07:59 +02:00
Rémi Verschelde 32c1bada99
Merge pull request #47827 from Chaosus/vs_fix_default_input_overriding_3.2
[3.x] Prevents default values of VSNodeCustom from overriding by a script
2021-04-23 22:06:08 +02:00
Hugo Locurcio 47f869b731
Tweak lightmapper warning message to mention Rosetta emulation on macOS 2021-04-22 15:57:52 +02:00
Yuri Roubinsky ac91e2ca0d [3.2] Prevents default values of VSNodeCustom from overriding by a script 2021-04-12 14:52:19 +03:00
Aaron Franke 9b928cbd9e
Show a message when trying to zoom farther than the limit
(cherry picked from commit b8f66d58b6)
2021-04-12 00:23:43 +02:00
Haoyu Qiu 14cea66f23
Fixes Node3D rotation in select mode on macOS
(cherry picked from commit 879a290ed9)
2021-04-12 00:23:43 +02:00
Haoyu Qiu bfa5adb84f Fix 3D selection box size for Spatial 2021-04-11 19:01:37 +08:00
megalobyte 724a18cf72
Use double when setting the default step size
Casting it as a float was causing issues with the progress bar

(cherry picked from commit d0f3817876)
2021-04-05 12:01:18 +02:00
AndreaCatania bd5663e2cf
Fixes editor crash on closing
Fixes editor crash when the gizmo is destroyed and the `SceneTree` is already freed.

(cherry picked from commit 79f55fcded)
2021-03-31 12:47:54 +02:00
Rémi Verschelde 015973df04
doc: Make all tutorial links point to 3.3 branch of docs 2021-03-26 10:43:43 +01:00
Hugo Locurcio fed17afe7d
Tweak the 3D editor grid default to not go below subdivisions of 1 meter
Small subdivisions aren't useful that often and make it difficult for
people to get a sense of scale in 3D.

(cherry picked from commit 3472c3f6ea)
2021-03-21 01:19:37 +01:00
andybarcia f8a1801fbc
Fixes TileMap editor copy bug.
(cherry picked from commit 558b08e6d9)
2021-03-20 23:08:03 +01:00
kobewi ba70958b29
Fix audio player not resetting after wav finishes
(cherry picked from commit daa62ccaa3)
2021-03-20 22:59:33 +01:00
Haoyu Qiu 966c89657b
Fix AnimationTree editor crash when renaming node
(cherry picked from commit eac806547f)
2021-03-16 11:38:29 +01:00
Dominik 'dreamsComeTrue' Jasiński ac4cedc596
Reset ruler tool when switching tools with shortcuts
Fixes: #37056
(cherry picked from commit a99a671034)
2021-03-16 11:11:27 +01:00
jmb462 b674d934c4
Fix Asset Library URL not updating after been changed in editor settings
The changes made in this commit refresh the URL OptionButton when editor settings are modified.

No need to restart any more for the changes to appear in the Asset Library.

Fix #46977

(cherry picked from commit 6525d74623)
2021-03-14 00:20:54 +01:00
jmb462 b73a97b110
Fix hardcoded Maya style navigation pan key modifier
ALT key modifier was hardcoded is node_3d_editor_plugin.cpp and didn't take editor settings into account.

Fix #46973

(cherry picked from commit 31077d875e)
2021-03-13 22:04:55 +01:00
mujpao f2739b3f52
Update viewport after Polygon2D deselected
(cherry picked from commit 030703dd30)
2021-03-13 21:56:31 +01:00
Rafał Mikrut 1435e2c0f9 Fix crashes when manipulating nodes in editor
(cherry picked from commit f81ecb498b)
2021-03-12 10:12:16 +01:00
gatalskii f60d27fe16 mod: pop-up usability enhancement for support button
Now after choosing support level pop-up doesn't hide after each click

(cherry picked from commit efe05a166e)
2021-03-08 17:37:13 +01:00
Hugo Locurcio 266282813a Make the pagination buttons wider in the asset library browser
This makes the page number buttons easier to click.

(cherry picked from commit 25c6acb702)
2021-03-08 17:37:13 +01:00
kobewi bc56681b0b Don't save unchanged script upon closing
(cherry picked from commit 12f5a5a701)
2021-03-07 22:51:06 +01:00
Yuri Roubinsky 9517b6e4ce Check before connecting TileMapEditor::settings_changed
(cherry picked from commit 1e7662f972)
2021-03-02 10:26:14 +01:00
hilfazer 84a9efcebc Prevent crash when clicking Mesh in MeshInstance when is scene root 2021-02-26 18:58:05 +01:00
Rémi Verschelde fb301a0c43
Merge pull request #38351 from avril-gh/remember-scripts-panel-visibility-in-project-metadata
preserve scripts panel visibility state between sessions in project metadata
2021-02-25 21:17:02 +01:00
trollodel 2da6d82f3b Allow CollisionObject to show collision shape meshes
Add an editor gizmo to CollisionObject.
CollisionShape no longer shows collision shapes directly.
2021-02-24 21:33:40 +01:00
hilfazer 28fa0f5d13 Prevent selecting hidden nodes in Canvas Item Editor 2021-02-20 20:30:16 +01:00
Rémi Verschelde 48936dda8a
Merge pull request #38388 from mashumafi/3.2-tileset-use-path
TileSet use texture Path instead of RID to prevent name conflicts.
2021-02-18 22:36:23 +01:00
Hein-Pieter van Braam 220f24c191
Merge pull request #45618 from RandomShaper/modernize_mt_3.2
Backport of all the multi-threading modernization (3.2)
2021-02-18 20:47:24 +01:00
Rémi Verschelde 59f807fb4a
Merge pull request #46141 from hilfazer/fix_select_hidden_nodes
prevent selecting hidden editable children in spatial editor
2021-02-18 14:45:07 +01:00
hilfazer 68438b4abc Prevent selecting hidden editable children in spatial editor 2021-02-18 12:36:52 +01:00
Pedro J. Estébanez 4485b43a57 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` by the new `SafeFlag`
- Platform-specific implementations no longer needed

Co-authored-by: Hein-Pieter van Braam-Stewart <hp@tmm.cx>
2021-02-18 12:23:25 +01:00
Hugo Locurcio 972e7bd27c
Only display the assetlib Retry button if the download failed
(cherry picked from commit 508011a57f)
2021-02-18 00:35:57 +01:00
Andrii Doroshenko (Xrayez) 329dcebc83
Fix sprite editor conversion tools to handle compressed textures
(cherry picked from commit 1cd7a16c10)
2021-02-16 14:27:38 +01:00
Aaron Franke 751036ff87
[3.2] Limit max zoom to 1/2 of far plane instead of 1/4 2021-02-14 18:17:35 -05:00
Michael Alexsander d31ee25882 Make margins obey the snap option in the TextureRegion editor
(cherry picked from commit 2d4cda89e1)
2021-02-05 09:27:55 +01:00
Tom Langwaldt 67d80e6f73 Fix swapped front/rear view
(cherry picked from commit f995d6cd17)
2021-02-05 09:26:09 +01:00
Rémi Verschelde 3115ac4b60
Merge pull request #45663 from akien-mga/3.2-cherrypicks
Cherry-picks for the 3.2 branch (future 3.2.4) - 19th batch
2021-02-02 19:19:31 +01:00
Rémi Verschelde 25bc4891d9
Merge pull request #40908 from Chaosus/vs_fix_preview_3.2
[3.2] Fix port previews for uniforms in visual shaders
2021-02-02 16:58:19 +01:00
Hugo Locurcio c10c6cfad9
Add viewport resolution to the 3D editor's View Information pane
(cherry picked from commit 85ed695836)
2021-02-02 13:30:54 +01:00
jfons 16bbe8ddf4
3D editor grid improvements
This commit adds a view-dependant fade to the 3D viewport grid. It fades out
at steep view angles to hide the solid regions that appear far from the camera.
I also included a fade to hide the grid borders.

I added some improvements to the dynamic grid when the camera is in orthogonal mode.
It properly handles zoom now, and the grid center is now set to the intersection point
between the grid plane and the camera forward ray, keeping the grid
always visible.

(cherry picked from commit 73e62dffb9)
2021-02-02 13:30:50 +01:00
Yuri Roubinsky 8689c1178d
Adds Metallic to spatial light input of visual shaders
(cherry picked from commit f4eef287f9)
2021-02-02 13:02:46 +01:00
Aaron Franke 0e45fb9798
Move the asset library API URLs to the Editor Settings
(cherry picked from commit 925d28e822)
2021-01-26 17:00:17 +01:00
Hugo Locurcio 250f921522
Hide the rotation gizmo when editor cinematic preview is enabled
Cinematic preview enables the Camera3D preview automatically.

When previewing a Camera3D, the rotation gizmo isn't displayed as
it can't be used.

(cherry picked from commit fa1d853eeb)
2021-01-26 17:00:15 +01:00
Addmix 58f038d1fa
Create physical skeleton collider orientation fix
(cherry picked from commit 177e62a7e4)
2021-01-26 17:00:14 +01:00
Yuri Sizov a9552cefa2 Fix minimap capturing events and improve its theme
Add an editor setting for minimap opacity in visual editors
2021-01-25 21:49:34 +03:00
Rémi Verschelde 7e207cfd48
i18n: Sync translations with Weblate 2021-01-15 16:49:47 +01:00
Hugo Locurcio ba04de6893
Draw a "background" line behind the dashed line in TextureRegion editor
This makes the dashed line visible on any background.

(cherry picked from commit 656aba1273)
2021-01-15 16:49:46 +01:00
dankan1890 32a0a50fcf
Create spritesheet for SpriteFrames by drag and dropping.
Close godotengine/godot-proposals#378

(cherry picked from commit 390ff22a8c)
2021-01-15 16:49:45 +01:00
JFonS 112b416056 Implement new CPU lightmapper
Completely re-write the lightmap generation code:
- Follow the general lightmapper code structure from 4.0.
- Use proper path tracing to compute the global illumination.
- Use atlassing to merge all lightmaps into a single texture (done by @RandomShaper)
- Use OpenImageDenoiser to improve the generated lightmaps.
- Take into account alpha transparency in material textures.
- Allow baking environment lighting.
- Add bicubic lightmap filtering.

There is some minor compatibility breakage in some properties and methods
in BakedLightmap, but lightmaps generated in previous engine versions
should work fine out of the box.

The scene importer has been changed to generate `.unwrap_cache` files
next to the imported scene files. These files *SHOULD* be added to any
version control system as they guarantee there won't be differences when
re-importing the scene from other OSes or engine versions.

This work started as a Google Summer of Code project; Was later funded by IMVU for a good amount of progress;
Was then finished and polished by me on my free time.

Co-authored-by: Pedro J. Estébanez <pedrojrulez@gmail.com>
2021-01-14 18:05:56 +01:00
Michael Alexsander 975a6194e7
Fix script list only showing their names regardless of display option
(cherry picked from commit 4194447a21)
2021-01-13 16:17:10 +01:00
jeffuntildeath 64cbff7e7d
Snap To Floor improperly offsets node
fix for issue #44282

AABB for collision geometry was being calculated based on parent nodes transform without consideration for collision geometries translation.
Also hopefully clarified logic for selecting starting point for ray cast

(cherry picked from commit 4f171afecc)
2021-01-13 16:17:07 +01:00
Rémi Verschelde 49646383f1
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 🎆

(cherry picked from commit b5334d14f7)
2021-01-13 16:17:06 +01:00
Rémi Verschelde 188609e5ab
CI: Update to clang-format 11 and apply ternary operator changes
(cherry picked from commit af878716f2)
2021-01-13 16:14:35 +01:00
Hugo Locurcio cec16357ef
Document the requirement to update GPU particle visibility
This also updates some option names in the editor for consistency
and accuracy.

See #44955.
2021-01-06 19:17:57 +01:00
kobewi 3785b091e4
Commit CanvasItem state only if it changed
(cherry picked from commit 036f6a3fa8)
2021-01-05 21:33:33 +01:00
Hugo Locurcio 1062bedaaa
Add an editor setting for the 3D selection box color
A restart is required to apply the setting change.

(cherry picked from commit 8221037be0)
2020-12-29 16:02:03 +01:00
Michael Alexsander 58b2d669a0
Fix filename disambiguation on scripts in certain occasions
(cherry picked from commit ed488b72a6)
2020-12-29 16:02:01 +01:00
Michael Alexsander 01e1369ab7
Disable "Commit" button in VCS plugin if there's no commit message
(cherry picked from commit 221738fb81)
2020-12-29 16:02:01 +01:00
janglee 23280293d4
Removed default commit message
(cherry picked from commit 718227df6b)
2020-12-29 16:02:01 +01:00
Hugo Locurcio 3addea0057
Move the brightness factor for highlighted 3D gizmos to a variable
See
8522ac7711 (r45230326).

(cherry picked from commit 507e9b12a4)
2020-12-29 16:02:00 +01:00
Marcus Brummer 9248ee39ca
Changed the rotation gizmo handle to use the active axis color
(cherry picked from commit ec97962261)
2020-12-29 16:02:00 +01:00
Hugo Locurcio 2753cc5264
Increase the default 3D manipulator gizmo opacity for better visibility
- Brighten gizmos when highlighted to make the difference between a
  non-highlighted and a highlighted gizmo more visible.
- Tweak the manipulator gizmo size property hint.

(cherry picked from commit 8522ac7711)
2020-12-29 16:01:59 +01:00
Yuri Roubinsky 8f5bdf6a63
Changes 'always show grid' hotkey to prevent conflict with 'pan mode'
(cherry picked from commit 1c546fdaea)
2020-12-29 13:49:59 +01:00
Nick Swoboda e08af90c90
Fix scene being modified when arrows are pressed with no node selected
(cherry picked from commit 66827337fd)
2020-12-10 13:13:18 +01:00
jeffuntildeath de7b5006cc
fix for snap to floor editor crash bug
fix for issue #44231: snap_selected_nodes_to_floor() results in an editor
crash when a child collisionshape has invalid shape object

(cherry picked from commit 52f6e0b5ad)
2020-12-10 13:12:39 +01:00
Marcus Brummer 8ad61f6669
Asset Library: Scroll up the ScrollContainer after page load
(cherry picked from commit 0e4f2ca860)
2020-12-10 13:09:02 +01:00
Aaron Franke 4267f40e88
Fix trying to set grid visibility on an invalid instance
(cherry picked from commit 8c1d94ebae)
2020-12-09 13:04:07 +01:00
Nick Swoboda 956477f4a2
Change minimum snap step of Tile Set to 1
(cherry picked from commit 70c946f82d)
2020-12-09 11:22:05 +01:00
Rémi Verschelde 9962fa6975
Merge pull request #42313 from kurinoku/fix-tileset-editor-3.2
Fixed tile_set_editor_plugin.cpp selection issue where it wouldn't cycle through all subtiles of an autotile.
2020-12-03 14:45:37 +01:00
Rémi Verschelde 9df3d06d1f
Merge pull request #43897 from RandomShaper/fix_refl_probe_vis_3.2
Put misc. 3D tool visible instances on their own layer (3.2)
2020-12-03 13:29:36 +01:00
Aaron Franke 80c72a529f
Limit the zoom and freelook speed based on camera settings
(cherry picked from commit 896a297c1f)
2020-12-02 16:02:39 +01:00
volzhs a1f63bac0e Fix editor locked by generating preview of dynamic font 2020-12-01 01:09:00 +09:00
Pedro J. Estébanez 08a46bbacd Put misc. 3D tool visible instances on their own layer
This makes that visible stuff invisible to ReflectionProbes, whose preview in the editor shouldn't involve them.
2020-11-26 20:08:30 +01:00
jfons bdc6f2fd95
Fix binding of default value in EditorSpatialGizmoPlugin::get_material()
It was commented for some reason I can't remember.

(cherry picked from commit e6949dae72)
2020-11-26 09:38:47 +01:00
David Kennedy 473cb79cc1 Fix duplicates entries in script editor menu
This was a regression from #40461.

Fixes #43707.
2020-11-23 11:33:59 -03:00
GryphonClaw 27eaf357fc
added shortcuts/hotkeys for tileset editor plugin collision buttons, with suggested changes.
(cherry picked from commit cf582262c2)
2020-11-19 17:17:23 +01:00
Aaron Franke b9641efc5c
Update the 3D grid when the "View Grid" checkbox is changed
(cherry picked from commit 71d1909b39)
2020-11-19 17:15:28 +01:00
Haoyu Qiu c0fb16a512
Fixes rotation in select mode on macOS
(cherry picked from commit 381ba7d554)
2020-11-19 17:15:27 +01:00
Rémi Verschelde 4816317bbc
Debugger: Save options in project metadata
Fixes #19542.

(cherry picked from commit 090361f3c9)
2020-11-17 16:42:42 +01:00
Hugo Locurcio 4b1de5be45
Add a dynamic infinite grid to the 3D editor
- The grid is now infinite, it follows the camera.
- The grid is now dynamic, if you zoom in and out, the grid subdivides,
  expands, and fades.
- You can now enable grid planes for the XY and YZ planes. Only the flat
  XZ plane is enabled by default. Each plane is independently dynamic
  of the others.
- The default grid size has been increased to 200, and the maximum
  has been increased to 2000. At 1000, the grid mostly looks edgeless.
- If you set the division level max and min to the same value then
  the grid does not expand or subdivide, but instead stays the same size
  and just follows the camera. Also, if these values are the same,
  the bias value does nothing.
- If you want to have Blender-like behavior, set max to 1, min to 0,
  and set the bias to a really low value. You may also wish to increase
  the grid size if you have a small bias.

Co-authored-by: Aaron Franke <arnfranke@yahoo.com>
2020-11-17 10:16:53 +01:00
Michael Alexsander 5e6af913de
Fix "Move Points" button sometimes not showing up on UV mode in the Polygon2D editor
(cherry picked from commit 4b74019ca3)
2020-11-11 15:30:56 +01:00
Eric Tuvesson be72285c70
fix(editor): TileMap floodfill with same tile ID and different variation
Closes https://github.com/godotengine/godot/issues/40435

(cherry picked from commit cefca25796)
2020-11-11 15:30:55 +01:00
Hugo Locurcio ed3f0a3950
Improve the 3D editor selection box appearance
- Draw two boxes slightly offset from each other to give the illustion
  of a thicker outline.
- Decrease the offset compared to the 3D node's AABB to give a more
  accurate representation of its size.
- Make the box fully visible instead of only displaying the corners.
- Draw a x-ray version of the box that's more translucent, but visible
  through walls. This helps make the box more visible while still
  having a sense of depth.
- Use an orange color similar to the 2D editor.
2020-11-09 21:55:56 +01:00
Rémi Verschelde c43b2ab603
Merge pull request #42942 from Calinou/add-viewport-debanding-3.2
Add a debanding property to Viewport for GLES3
2020-10-30 11:47:57 +01:00
Rémi Verschelde 4325c54335
Merge pull request #43016 from mbrlabs/rotation-gizmo-32
[3.2] Improve rotation gizmo
2020-10-30 11:46:05 +01:00
Hugo Locurcio 94cf0dced2
Improve undo log messages in the 2D editor for additional context
Undo/redo log messages will now specify the modified node's
name (or number of modified nodes if several were modified).
On top of that, the new position/rotation/scale/pivot offset
will also be mentioned in the message.

(cherry picked from commit 996740de43)
2020-10-28 14:05:41 +01:00
Pleto 203d6375fc
Enhancement for tileset sorting
(cherry picked from commit 0e392bd177)
2020-10-28 14:05:41 +01:00
Michael Alexsander 5c129c7a05
Minor improvements to the Polygon 2D UV editor
(cherry picked from commit c26b49fc17)
2020-10-28 14:05:39 +01:00
Rémi Verschelde 7c27e37997
Merge pull request #42705 from Calinou/tilemap-editor-fix-osx-tooltip
Fix rectangle paint tooltip for the tilemap editor on macOS
2020-10-27 14:43:50 +01:00
Marcus Brummer 69b99ba9cb Improve rotation gizmo
Hide the back sides of the rotation gizmo circles and add a white
outline for better visualization of the rotation "sphere".

This is a 3.2 backport of @JFons work on the master branch; all credit
goes to him.
2020-10-22 22:05:50 +02:00
Hugo Locurcio 2dbc329704
Add a debanding property to Viewport for GLES3
It can be enabled in the Project Settings
(`rendering/quality/filters/use_debanding`). It's disabled
by default as it has a small performance impact and can make
PNG screenshots much larger (due to how dithering works).

As a result, it should be enabled only when banding is noticeable enough.

Since debanding requires a HDR viewport to work, it's only supported
in the GLES3 backend.
2020-10-20 19:07:15 +02:00
Hugo Locurcio af45c97652
Add fast approximate antialiasing (FXAA) to Viewport
This backports FXAA from the `master` branch.

Co-authored-by: Clay John <claynjohn@gmail.com>
2020-10-20 14:54:52 +02:00
Haoyu Qiu 0c1f88c769
Adds pan gesture to StateMachine editor
(cherry picked from commit e9bec0d76b)
2020-10-19 16:09:59 +02:00
David Sichma f601e15b92
aabb change updates bounding box
spatial editor will now update the bounding box if aabb or transform
changes

(cherry picked from commit 7701889048)
2020-10-19 16:09:57 +02:00
Michael Auderer 9f4dc87739
Reset TileMapEditor painting on application refocus
Treats application unfocus as a mouse release for
TOOL_PAINTING, by finishing the undo state and
resetting the tool. Also sets a flag to prevent extra
lines from being drawn when the application is refocused.

fixes #42398, fixes #24970

(cherry picked from commit 70a4cd1afe)
2020-10-19 16:09:55 +02:00