Commit graph

6419 commits

Author SHA1 Message Date
Hugo Locurcio
aacaad5066
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-21 17:55:54 +01:00
hilfazer
28fa0f5d13 Prevent selecting hidden nodes in Canvas Item Editor 2021-02-20 20:30:16 +01:00
Ellen Poe
8ac22bdae4 Don't fade out after pausing unless stream is running
(cherry picked from commit eb5566f5c5)
2021-02-19 15:55:41 +01:00
Ellen Poe
d55501505c Initialize fadeout to false in AudioStreamPlayer
(cherry picked from commit b8a13a4968)
2021-02-19 15:55:34 +01:00
Delf Neumärker
4065fa0bcf Fix crash when calling connect_nodes_forced with invalid params
(cherry picked from commit 4a468171e5)
2021-02-19 15:54:00 +01:00
Eoin O'Neill
2fb221e79a Collision Shape 2D 'Disabled' Visualization Correction
Having white or strongly desaturated debug collision shape color
setting would make it harder to visualize enabled / disabled state.
This change makes it easier to visualize enabled / disabled state
by reducing the alpha color by half when disabled.

(cherry picked from commit 0c4594f6c9)
2021-02-19 15:51:43 +01:00
Delf Neumärker
fd90fc2c9b Fix handling of negative indices in SurfaceTool
(cherry picked from commit 735f75a16b)
2021-02-18 23:47:35 +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
7af8da32b1
Merge pull request #45933 from nekomatata/cylinder-support-3.2
[3.2] Cylinder support in Godot Physics 3D
2021-02-18 19:36:42 +01:00
PouleyKetchoupp
c6fbd55ca9 Cylinder support in Godot Physics 3D
Backport of cylinder support from Master.
2021-02-18 08:44:23 -07:00
Rémi Verschelde
0176cc4fca
Merge pull request #46162 from gongpha/jr-_-avoid-get_tree-when-flying-colorpicker
[3.2] Avoid signal methods in ColorPicker to access the tree when it isn't in the tree
2021-02-18 13:15:12 +01:00
Rémi Verschelde
3374f84a2f
Merge pull request #46165 from angad-k/fix-mesh-instance-crash
add null check in MeshInstance::_mesh_changed()
2021-02-18 13:00:17 +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
Angad Kambli
013fc360d7 add null check in MeshInstance::_mesh_changed() 2021-02-18 16:36:27 +05:30
Rémi Verschelde
f30d827448
Merge pull request #45951 from KoBeWi/copy_of_3.2
[3.2] Add node copy-paste
2021-02-18 12:06:17 +01:00
Pedro J. Estébanez
6d89f675b1 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-02-18 11:58:08 +01:00
Pedro J. Estébanez
4ddcdc031b Modernize Mutex
- Based on C++11's `mutex`
- No more need to allocate-deallocate or check for null
- No pointer anymore, just a member variable
- Platform-specific implementations no longer needed
- Simpler for `NO_THREADS`
- `BinaryMutex` added for special cases as the non-recursive version
- `MutexLock` now takes a reference. At this point the cases of null `Mutex`es are rare. If you ever need that, just don't use `MutexLock`.
- `ScopedMutexLock` is dropped and replaced by `MutexLock`, because they were pretty much the same.
2021-02-18 11:58:08 +01:00
Pedro J. Estébanez
b450036120 Modernize RWLock
- Based on C++14's `shared_time_mutex`
- No more need to allocate-deallocate or check for null
- No pointer anymore, just a member variable
- Platform-specific implementations no longer needed
- Simpler for `NO_THREADS`
2021-02-18 11:41:07 +01:00
Kongfa Waroros
5ec1eee6b1 Avoid function signals in ColorPicker to access the tree when it isn't in the tree 2021-02-18 16:57:47 +07:00
Ellen Poe
8a426923c2
Fix pops in play() of both spatial audio players
(cherry picked from commit 5e1442ad55)
2021-02-18 10:33:46 +01:00
Angad Kambli
bba67729ca
add null check in _update_particle_data_buffer()
add check to see if p_order is in range for CPUParticles3D::set_draw_order'

(cherry picked from commit c97fffdc59)
2021-02-18 00:36:20 +01:00
Jitesh
d968a03cbc
Add animation_finished signal and fix frame_changed signal for AnimatedSprite3D
Fixes #40301.
Fixes #45947.

(cherry picked from commit c3be0c2c04)
2021-02-18 00:36:20 +01:00
andybarcia
61c00938a2
Fixes crash when calling VisualShader::set_mode
(cherry picked from commit f455f873c7)
2021-02-18 00:35:57 +01:00
Angad Kambli
1ca1b78a09 add checks for node type range in add_node function 2021-02-17 14:22:50 +05:30
Michael Alexsander
c67c3e0a46
Fix StyleBoxLine's incorrect style margin values
(cherry picked from commit ddf05a7c3c)
2021-02-16 14:27:40 +01:00
kobewi
6440b7fcae
Select TreeItem if none is selected
(cherry picked from commit 282639d653)
2021-02-16 14:27:40 +01:00
Ellen Poe
3d34803edc
Return setseek position if one exists in get_playback_position.
(cherry picked from commit 15b8480b2c)
2021-02-16 14:27:40 +01:00
kleonc
e40682c32d
RichTextLabel::add_image Fail if passed image has no area
(cherry picked from commit a4afdd4a77)
2021-02-16 14:27:39 +01:00
kleonc
31744577b3
VisualShader::_input_type_changed Fix index out of bounds crash.
(cherry picked from commit 7d451c0040)
2021-02-16 14:27:39 +01:00
hoontee
d91a5e7883
Implement CollisionPolygon3D margin
(cherry picked from commit fbb1ef759c)
2021-02-16 14:27:39 +01:00
PouleyKetchoupp
ac9e5d9c60
Fix TextEdit autoscroll with wrapped lines
Index to find the last line wrap index was off by one, which prevented the first wrapped line to trigger autoscroll.

(cherry picked from commit 121030940c)
2021-02-16 14:27:38 +01:00
Rémi Verschelde
77438f7a45
Merge pull request #46054 from JFonS/cpu_lightmapper_disk
[3.2] Reduce lightmaps file size.
2021-02-16 13:37:09 +01:00
JFonS
56bf256d76 Add options to reduce lightmaps disk usage.
Added BakedLightmap.use_hdr and BakedLightmap.use_color properties
that can reduce the flie size of lightmap texture at the expense of quality.

Changed the denoiser to work in a single buffer, reducing RAM
usage. Also added the `-mstackrealign` flag in the denoiser compilation
for MinGW builds. This flag helped fix a bug in Embree, so I want to see
if it will help fix GH #45296.
2021-02-16 13:20:27 +01:00
Rémi Verschelde
1611d3dc17
Merge pull request #46008 from akien-mga/3.2-fix-camera-align-crash-45976
Camera2D: Fix crash calling align when not in tree
2021-02-16 12:18:38 +01:00
PouleyKetchoupp
018008ce81 TextEdit respects content margin from StyleBox
Backport from PR #45858 on master.
2021-02-15 10:47:38 -07:00
bruvzg
56fccb1ec1
[3.2] Fix SPACING_SPACE not used for drawing characters. 2021-02-15 18:03:26 +02:00
Rémi Verschelde
5a22bd2b3e
Camera2D: Fix crash calling align when not in tree
Fixes #45976.
2021-02-15 10:54:16 +01:00
kobewi
637117c8d1 [3.2] Add node copy-paste 2021-02-13 14:27:36 +01:00
Rémi Verschelde
e71510097d
Merge pull request #45837 from Kayomn/3.2
Accomodate blend shape ranges of -1 to +1 for GLES
2021-02-12 09:28:19 +01:00
Kongfa Waroros
adb93d7120
Update GraphEdit when GraphNode's slot is updated
(cherry picked from commit fe6c8d48e6)
2021-02-11 13:14:33 +01:00
PouleyKetchoupp
5e978d1df5
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.

(cherry picked from commit e5e9be8355)
2021-02-11 13:12:06 +01:00
Filip
9c4f16f4c1 Fixed completion box not showing properly [3.2] 2021-02-10 20:40:00 +01:00
Rémi Verschelde
398a625a9f
Merge pull request #39421 from RandomShaper/pause_aware_picking_3.2
Implement pause-aware picking (3.2)
2021-02-09 10:43:48 +01:00
Rémi Verschelde
daa0fe101e
Merge pull request #45813 from RandomShaper/keep_selected_visible_3.2
Keep selected node visible after filter change (3.2)
2021-02-09 10:43:37 +01:00
kobewi
2863c6117e
Set selected Tree item to null when deselected
Co-authored-by: Brody Eller <wviper3@gmail.com>
(cherry picked from commit ef8ec59f2f)
2021-02-08 22:36:37 +01:00
Kanabenki
dad0d4a8ee
Update ColorPicker controls when entering tree
(cherry picked from commit 03d4ebf129)
2021-02-08 22:36:37 +01:00
Rafał Mikrut
24d03afc9b
Fix nan errors when using VehicleBody
(cherry picked from commit 1b8cbcf946)
2021-02-08 22:36:36 +01:00
Oliver Dick
db57f32194
TextEdit: When left mouse is pressed to place the cursor, do not immediately adjust the viewport when cursor_set_line is called, but afterwards on cursor_set_column (effectively when the cursor reached its final position)
Fixes #45770

(cherry picked from commit 8d598693fc)
2021-02-08 22:36:36 +01:00
Rémi Verschelde
b060b2e68f
Merge pull request #45750 from revilo/3.2
[3.2] Bugfix: Update transform of collision shape on NOTIFICATION_PARENTED
2021-02-08 21:33:21 +01:00
Pedro J. Estébanez
745c711289 Implement pause-aware picking
This adds a new project setting (`physics/common/enable_pause_aware_picking`). It's disabled by default.

When enabled, it 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-08 20:48:13 +01:00
Yuri Roubinsky
34d3235c84 [3.2] Visual Shader Parenthesis fix 2021-02-08 19:37:50 +03:00
Pedro J. Estébanez
e1054a17b5 Expose Tree::scroll_to_item() 2021-02-08 02:19:23 +01:00
Kayomn
d923df52c5 Accomodate blend shape ranges of -1 to +1 2021-02-07 21:42:02 +00:00
Rémi Verschelde
f05e068d6c
Merge pull request #45583 from lawnjelly/optimize_transform_propagate
Optimize transform propagation for hidden 3d objects
2021-02-06 12:23:52 +01:00
Rémi Verschelde
f36c529ad0
Merge pull request #45752 from JFonS/cpu_lightmapper_fixes
Assorted CPU lightmapper fixes
2021-02-06 11:44:52 +01:00
Oliver Dick
09924d6d73 Bugfix: Update transform of collision shape on NOTIFICATION_PARENTED (fixes invalid transform of collision shape in cases where the node is not supposed to enter the scene tree) 2021-02-06 02:41:16 +01:00
JFonS
27c1e65969 Assorted CPU lightmapper fixes
- Fix crash when a ray hits a texel with a UV2 coordinate exactly
  equal to 1.0.
- Take BakedLightmap extents into account.
- Clear capture data between bakes.
- Fix minor issues with seam correction.
2021-02-05 19:18:19 +01:00
muiroc
11fc3b8758 Use the blend parameter passed to blend_animation during graph processing
(cherry picked from commit 01bd1b33c7)
2021-02-05 09:26:50 +01:00
lawnjelly
cb8134f371 Optimize transform propagation for hidden objects
When visual instances are hidden, there is no need to update their global transforms and send these to the visual server. This only needs to be done when the objects are reshown.
2021-02-03 15:16:47 +00:00
Rémi Verschelde
30fd2f171d
Merge pull request #45497 from Chaosus/fix_particles_3.2
[3.2] Fix particles not properly updated by their lifetime
2021-02-03 15:51:14 +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
kobewi
7a6ab8c558
Cache world in VisibilityNotifier3D to avoid crash
(cherry picked from commit 4d172f1fca)
2021-02-02 13:02:45 +01:00
Volka
c6824ec09d
Fix unintended SpinBox mouse capture
(cherry picked from commit ae2cf8eb38)
2021-02-02 13:02:42 +01:00
Rémi Verschelde
0b6dd929c6
Merge pull request #45169 from fmazan/3.2-completion-panel-positioning
[3.2] Fixed completion and hint panel positioning in TextExit
2021-02-01 20:50:38 +01:00
Rémi Verschelde
cea561e461
Merge pull request #45510 from TamplierS1/3.2
Fix disconnection between Gizmo and inspector values on BakedLightmap
2021-01-28 08:32:12 +01:00
Azamat Nabiullin
5611a17219 Fix disconnection between Gizmo and inspector values on BakedLightmap
After adding `_change_notify("extents");` to `set_extents()` method in `BakedLightmap` class
the issue was fixed

Fix disconnection between Gizmo and inspector values on BakedLightmap

Remove unnecessary `_change_notify("bake_extents")` call from `set_extents()`
2021-01-28 07:03:06 +03:00
HaSa1002
4ff0df702d Expose bookmark, breakpoint, and mark safe functions in TextEdit 2021-01-27 22:41:07 +01:00
kobewi
a7a490e650 Fix popup_centered() for scaled popups 2021-01-27 18:12:09 +01:00
Yuri Roubinsky
4ae5aa0153 [3.2] Fix particles not properly modified by their lifetime 2021-01-27 16:32:21 +03:00
hoontee
32d1efdb21
Do not clear materials when setting mesh
(cherry picked from commit 6e2a55c464)
2021-01-26 22:10:30 +01:00
kobewi
7ede2f36fe
Allow to override drop data in LineEdit
(cherry picked from commit a3a31591b5)
2021-01-26 17:24:55 +01:00
Hugo Locurcio
76bd7d796b
Make Range return 1.0 ratio if minimum and maximum values are equal
An error message is also no longer printed.
This matches the behavior found in most UI frameworks where having
equal minimum and maximum values is considered acceptable.

This closes #43179.

(cherry picked from commit 44204ec32d)
2021-01-26 17:00:17 +01:00
Nils Reid
349f25429b
Exposed find_next_valid_focus and find_prev_valid_focus.
(cherry picked from commit 3e94c23fa5)
2021-01-26 17:00:16 +01:00
Rémi Verschelde
9f2c24e8ce
Cleanup: Remove executable bit from files which don't need it
Drop unused xpmfix.sh script.

(cherry picked from commit 76c6007aa6)
2021-01-26 17:00:15 +01:00
Hugo Locurcio
7133603238
Fix typo in theming methods ("botton" -> "bottom")
(cherry picked from commit 1f9cac1717)
2021-01-26 17:00:15 +01:00
HipsterPenguin
158314c0b9
Fixed 6DOF set/get check for the path starting with joint_constraints
New code checks whether or not property has joint_constraints as the first part of its path.

(cherry picked from commit 6bf46cf70f)
2021-01-26 17:00:15 +01:00
Rémi Verschelde
07be68e904
Merge pull request #45370 from naithar/fix/line_edit_clear
[3.2] [GUI] Fix LineEdit clearing
2021-01-26 12:30:58 +01:00
Sergey Minakov
7b8d6d2413 [GUI] Enforce virtual keyboard redisplay on clear 2021-01-26 13:18:14 +03: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
Lyuma
2c2f70c444 embree: cross compile fixes.
Fix typos in #if; add missing _MSC_VER; avoid warning in random generator.
2021-01-18 06:20:24 -08:00
Rémi Verschelde
bc47a8ae00
Merge pull request #39533 from hilfazer/editable-children-bugfixes
Fix Editable Children issues with node renaming, moving, duplicating and instancing.
2021-01-18 12:31:12 +01:00
Rafał Mikrut
f92ad30dfd Fix memory leak dynamic font 2021-01-17 17:53:13 +01:00
Rafał Mikrut
b213c441e4 Fix usage of deleted element in Area::_area_inout 2021-01-16 09:54:55 +01:00
Rémi Verschelde
029d2568c3
Merge pull request #45211 from akien-mga/3.2-cherrypicks
Cherry-picks for the 3.2 branch (future 3.2.4) - 17th batch
2021-01-15 17:09:32 +01:00
Rémi Verschelde
57e0ef7b95
Merge pull request #45198 from nekomatata/improved-raycast-node-render-debug-3.2
[3.2] Improve Raycast render debug
2021-01-15 16:51:04 +01:00
Alexander Pech
d73281a350
Keep RichTextLabel visible character properties in sync
The RichTextLabel class is inconsistent in how it updates the
visible_characters and percent_visible properties when either is changed.

To keep both properties consistent, update percent_visible when setting the
visible_characters property.
For both properties, when setting one, notify change for the other.

Docs updated for member set_visible_characters on RichTextLabel class.

(cherry picked from commit 463e2002ab)
2021-01-15 16:49:46 +01:00
Rémi Verschelde
497653ab53
Merge pull request #44628 from JFonS/new_cpu_lightmapper_3.2
[3.2] New CPU lightmapper
2021-01-15 13:25:46 +01:00
Rémi Verschelde
066716a46d
Merge pull request #42715 from madmiraal/fix-42614-3.2
[3.2] Update area-body_shape_entered-exited signal documentation.
2021-01-15 13:00:52 +01:00
Rémi Verschelde
258f41c024
Merge pull request #45150 from pycbouh/ge-disconnect-crash-3.2
[3.2] Prevent signal disconnection attempts on invalid references
2021-01-15 12:49:17 +01:00
JFonS
b1ca82c43a CPU lightmapper fixes.
- Fix Embree runtime when using MinGW (patch by @RandomShaper).
- Fix baking of lightmaps on GridMaps.
- Fix some GLSL errors.
- Fix overflow in the number of shader variants (GLES2).
2021-01-15 12:32:54 +01:00
Marcel Admiraal
253b1c22da Rename the final parameter of area_shape_entered-exited local_shape. 2021-01-15 09:46:19 +00:00
PouleyKetchoupp
37ef04c986 Improve Raycast render debug
Fix Raycast node render debug not showing in editor camera preview.

Use dynamic mesh update to change the ray on-the-fly without too much
extra cost when collision debug is enabled.

Fixes #43571
2021-01-14 15:51:22 -07:00
JFonS
7d7d7ef16d CPU lightmapper formatting and minor fixes. 2021-01-14 18:08:33 +01:00
JFonS
089da5a71b Gracefully handle atlassed lightmaps in GLES2. 2021-01-14 18:06:16 +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
Yuri Sizov
6b13c8482a Prevent signal disconnection attempts on invalid references 2021-01-14 15:21:12 +03:00
Filip
f1d00522f5 Fixed completion and hint panel positioning in TextExit [3.2] 2021-01-13 21:44:05 +01:00
Marcel Admiraal
b651db999c Fix not clearing a Joint3D with only a B node when removing the B node 2021-01-13 18:29:44 +00:00
Rémi Verschelde
f93c2ddc92
Merge pull request #45163 from akien-mga/3.2-cherrypicks
Cherry-picks for the 3.2 branch (future 3.2.4) - 16th batch
2021-01-13 17:38:05 +01:00