Commit graph

6441 commits

Author SHA1 Message Date
Delf Neumärker
7df977c3ed
Fix crash during drag if user freed the drag preview 2021-02-27 15:16:06 +01:00
Rémi Verschelde
9047e760d1
Merge pull request #46451 from hilfazer/click_mesh_instance_crash
Prevent crash when clicking Mesh in MeshInstance when is scene root
2021-02-26 20:59:19 +01:00
hilfazer
84a9efcebc Prevent crash when clicking Mesh in MeshInstance when is scene root 2021-02-26 18:58:05 +01:00
Eric M
3b2c43312c Fixed issues with slider focus and scroll input
(cherry picked from commit 707cf278a5)
2021-02-26 15:27:42 +01:00
Meriipu
6f77f1bb3e If the mouse is held on notification_wm_mouse_exit, do not drop focus
This fixes a bug where users of the scrollbar had to be very careful
not to move the mouse outside the viewport, otherwise the scrollbar
would drop its drag-action and stop scrolling until clicked again.

The existing behaviour had the side-effect of also dropping the
cosmetic highlighting of the scrollbar (in addition to the dragging),
for the specific case where the mouse was move outside the window.
The previous behaviour did nothing to remove the highlight if the
mouse was released (but not moved) inside the viewport.

This separate issue with the lingering highlight of the scrollbar
(until a mouse-movement action is performed inside the viewport) is
fixed in an immediate followup to this commit.

Closes bug #39634

(cherry picked from commit 44657db3e2)
2021-02-26 15:22:08 +01:00
Delf Neumärker
28e36dc7b9 Fix crash when loading a scene containing an uncreatable type
(cherry picked from commit 04a4828c5e)
2021-02-26 11:30:38 +01:00
Emmanuel Leblond
94fe2dd31e
Fix Godot returned status code on unexpected error 2021-02-25 18:39:29 +01:00
Rémi Verschelde
6fc9c409dd
Merge pull request #46420 from nekomatata/draw-collision-outline-option-3.2
[3.2] Added option in project settings to draw Shape2D outlines
2021-02-25 17:15:52 +01:00
Rémi Verschelde
e919a413fb
Merge pull request #46397 from trollodel/collisionobject3d-debug-shapes-3.2
Allow CollisionObject to show collision shape meshes
2021-02-25 16:54:47 +01:00
PouleyKetchoupp
d94cd42ccd 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:48:33 -07:00
Rémi Verschelde
96d38d9751 Revert "Warn when setting Control size inside ready()"
This reverts commit a8105d73c7.

We need to improve the logic somewhat to make the warning more specific to
actual problematic scenarios. Will likely be cherry-picked again + fixes
for the next release.

Fixes #46376.
2021-02-25 15:14:32 +01:00
kleonc
80e4b2d02e MeshDataTool::create_from_surface Fail on invalid index data
(cherry picked from commit 8e82cf8174)
2021-02-25 15:14:32 +01:00
Jummit
0a9190134d expose edit_selected in Tree
(cherry picked from commit 13fb24cb6f)
2021-02-25 15:14:32 +01:00
Christoffer Sundbom
3b63467783 Tween: Add null check for target object
Fixes #45399.

(cherry picked from commit 5b2100d85c)
2021-02-25 15:14:31 +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
Hugo Locurcio
2735a5498e 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.

(cherry picked from commit e6abdc943d)
2021-02-22 14:16:42 +01:00
kleonc
566ad4fd22 Label::set_lines_skipped Fail if passed a negative value
(cherry picked from commit d7bb7cad47)
2021-02-22 10:16:54 +01:00
kleonc
bd7c24371d Line2D::set_point_position Fail if passed index is out of bounds
(cherry picked from commit df49fdd189)
2021-02-22 10:16:22 +01:00
Kongfa Waroros
af5fe70623 Keep Hue value when Saturation or Value is zero
(cherry picked from commit 27749711b2)
2021-02-22 10:15:29 +01:00
nc
bc86f3e27e improve error message when travel() is called on an AnimationNodeStateMachine when the state machine is not playing
(cherry picked from commit 0c968d603a)
2021-02-22 10:15:00 +01:00
Tomasz Chabora
a8105d73c7 Warn when setting Control size inside ready()
(cherry picked from commit 84da090a69)
2021-02-22 10:15:00 +01:00
PouleyKetchoupp
cefaa6fb06 Fixed export var default value in PackedScene when script is not loaded in editor
(cherry picked from commit 4e14eefd94)
2021-02-22 10:15:00 +01:00
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