Commit Graph

4568 Commits

Author SHA1 Message Date
Raul Santos 99353a2aee
Fix getting properties state when reloading C#
When reloading C# classes and keep their properties values they are
retrieved and stored in a state list.
Retrieving the properties was only getting the fields of the C# class
and not inherited fields so those properties values were lost on reload.
Now we also try to find the field in the parent classes.

(cherry picked from commit 907e709f9d)
2022-01-06 00:58:31 +01:00
Raul Santos b096c4b05f
Fix `KeyValuePairAt` memory leak
(cherry picked from commit 1fdfc379b6)
2022-01-06 00:58:30 +01:00
Raul Santos 9520c6b953
Check a csproj exists before trying to edit it
When folders are moved/removed from the file system, the `.csproj`
may need to be edited to update the path of C# scripts or remove them.
If a C# solution has not been created, the `.csproj` file does not exist
and therefore there is no need to edit it.

(cherry picked from commit cf98ff248a)
2021-12-21 12:23:19 +01:00
Fabio Alessandrelli 1d9993936c
[Net] Fix WebRTC returning packets from peers too early.
Due to the async nature of WebRTC implementations, the multiplayer peer
could end up having queued packets from a given connection before it is
able to emit the "peer_added" signal.
This commit ensures that packets from peers which are not notified yet
are skipped by `get_packet` and `get_available_packet_count`.

(cherry picked from commit 9b8db7c63a)
2021-12-16 22:58:48 +01:00
Max Hilbrunner adc6ec0abb
Websockets: Fix buffer size checks in put_packet()
(cherry picked from commit 6a92a2e92d)
2021-12-16 22:57:16 +01:00
Aaron Franke e147fc3428
[3.x] Misc build system fixes
(cherry picked from commit 7bf7bd70ac)
2021-12-14 17:29:59 +01:00
Francois Belair 77746ebed5
Remove extraneous return to LSP
(cherry picked from commit ad01201f34)
2021-12-09 22:08:21 +01:00
Cory Petkovsek 686780e289
Clears RIDs wherever they are freed by VisualServer or PhysicsServer and possibly reused. Fixes #53374
(cherry picked from commit 3d20218dae)
2021-12-09 22:02:00 +01:00
Francois Belair 97958e2a38
Prevent LSP adding signal func to non GDScripts
(cherry picked from commit 66f1b4bf66)
2021-12-07 09:14:32 +01:00
Vincent 2c7f6832ae
AudioStreamMP3: expose loop properties to the editor
(cherry picked from commit 8263646f68)
2021-12-07 09:14:31 +01:00
Rémi Verschelde ba277a0aa0
Revert "Expose Variant operator= to GDNative"
(cherry picked from commit 796f875870)
2021-12-02 11:47:50 +01:00
BimDav 521af55301
expose Variant operator= to GDNative
(cherry picked from commit 084b21c4a8)
2021-12-01 17:09:04 +01:00
Vincent 72709bb821
Fix crash when loading an invalid mp3 file
(cherry picked from commit 2d0068d1cb)
2021-12-01 17:01:31 +01:00
kobewi e203910804
Correct the doc about ease()
(cherry picked from commit 44e6655924)
2021-11-25 23:13:16 +01:00
jitspoe b9d6d54746
Fix crash when exporting gltf mesh that has no skin.
(cherry picked from commit 734b4a46bc)
2021-11-25 23:13:14 +01:00
Rémi Verschelde 63b5d5de64
Modules: Make sure to include `modules_enabled.gen.h` where needed
Fixes #51677.

Co-authored-by: Arkadiusz Marcin Kołek <aksoftware91@gmail.com>
(cherry picked from commit 6f4858f184)
2021-11-15 22:36:02 +01:00
PouleyKetchoupp 7344beafdd
Fix errors in KinematicBody when floor is destroyed or removed
In all physics servers, body_get_direct_state() now silently returns
nullptr when the body has been already freed or is removed from space,
so the client code can detect this state and invalidate the body rid.

In 2D, there is no change in behavior (just no more errors).

In 3D, the Bullet server returned a valid direct body state when the
body was removed from the physics space, but in this case it didn't
make sense to use the information from the body state.

(cherry picked from commit b93aeec4a2)
2021-11-15 22:32:53 +01:00
Mark Riedesel 619c1e506e
Fix glTF cubic spline track interpolation incorrectly reporting times/values size mismatch (3.4 specific)
(cherry picked from commit 999bba6916)
2021-11-15 22:32:26 +01:00
Hugo Locurcio 1f35876fd5
Remove hash symbol in front of opcode error messages in GDScript
The hash symbol creates spurious issue references on GitHub if
the message is posted outside a code block, which means some issues
have a lot more references than originally intended.

(cherry picked from commit 63d214f04b)
2021-11-15 22:31:32 +01:00
Ignacio Roldán Etcheverry b63f1fc603
C#: Don't use ActivityThread to determine Android nativeLibraryDir
(cherry picked from commit 690bf12c4c)
2021-11-15 22:27:38 +01:00
Rémi Verschelde e5d6954505
GDScript: Support multiline indexing with `[]`
Fixes #35417.

(cherry picked from commit 92664f03a9)
2021-11-15 22:21:16 +01:00
Bartłomiej T. Listwon bdf7a0294b
Don't ignore the type mismatch in setter function
(cherry picked from commit 5a7bd296af)
2021-11-15 22:20:46 +01:00
Rémi Verschelde 489b49c6b8
doc: Remove obsolete files 2021-11-05 16:11:18 +01:00
Yuri Sizov d764e1fae7 Fix maximum allowed size atlas in CPU lightmapper 2021-11-02 15:50:50 +03:00
Rémi Verschelde e4996887ca
Merge pull request #48625 from The-O-King/compression_options 2021-11-02 08:58:22 +01:00
Lyuma e575b27b15 3.x backport glTF: Fix override materials and non-empty arrays
Keep track of MeshInstance and GeometryInstance override materials in the GLTFMesh object.
Ensure all arrays are non-empty to conform with "minItems":1 in glTF spec.
2021-11-01 23:40:12 -07:00
Omar El Sheikh 203295f17d Added Mesh Compression Import Options
Fleshed out the "Optimize Mesh" options found in the mesh import UI
Gave a checkbox to every vertex attribute that can be compressed

Surfaced option to enable/disable Octahedral compression for
normal/tangent vectors

Also surfaces the vertex position compression option which previously
inaccessible because the defaults did not compress vertex positions

Supports all current importers (obj, fbx, collada, gltf)
2021-11-01 12:54:28 -04:00
Raul Santos 21f68e7bdb
Ensure C# script properties are added to the end
Ensures that the `get_property_list` and `get_script_property_list`
methods push the script properties to the end of the given list, this
prevents the script property from appearing after the script variables.
2021-10-30 16:55:21 +02:00
Rémi Verschelde 14ef65e49b
Merge pull request #54348 from akien-mga/3.x-clang-format-dont-align-operands 2021-10-28 15:43:15 +02:00
Rémi Verschelde 87c80f529f
clang-format: Enable `BreakBeforeTernaryOperators`
clang-format keeps breaking the way it handles break *after* ternary operators,
so I give up and go with the only style they seem to actually test.
2021-10-28 14:50:33 +02:00
Rémi Verschelde 1b65550ec7
clang-format: Various fixes to comments alignment from `clang-format` 13
All reviewed manually and occasionally rewritten to avoid bad auto formatting.
2021-10-28 14:50:32 +02: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
Rémi Verschelde 23955fc282
Merge pull request #54262 from raulsntos/csproj-globbing-3.x 2021-10-26 21:56:58 +02:00
Rémi Verschelde 5d0ec1779d
Merge pull request #54272 from pycbouh/gdscript-ignore-groups-completion-3.x 2021-10-26 20:02:01 +02:00
Yuri Sizov b3fc278dcf Ignore property groups and categories in GDScript code completion 2021-10-26 20:01:49 +03:00
Max Hilbrunner e29126914d
Save all 64 bits of get_ticks_msec() in more cases
(cherry picked from commit 5dc02eb8b0)
2021-10-26 18:23:31 +02:00
Raul Santos ced4f3519d Avoid modifying csproj globbing includes
Check if the found globbing include already matches the new path on
moving scripts to avoid modifying users' csproj files.
2021-10-26 18:21:19 +02:00
Lyuma e49f8c5823 3.x: Fix validation errors due to chunk padding and empty skins.
GLB chunk padding length calculation was backwards and missing for the BIN chunk.
Fixed error caused by "skins":[] when no skins were present.
Finally, encode animations before textures to avoid accessor misalignment due to texture byteLength.
2021-10-25 21:17:13 -07:00
Raul Santos da419bbeed Keep order for C# exported members 2021-10-24 21:14:20 +02:00
Aaron Franke 5659120af3
[3.x] Add support for the RISC-V architecture
Supports RV64GC (RISC-V 64-bit with general-purpose and compressed-instruction extensions)
2021-10-22 12:51:23 -05:00
Rémi Verschelde 89076410de
WebM: Disable SIMD optimization with YASM on Windows
It triggers a crash when playing V9 videos.

Could likely be fixed if anyone wants to work on it, but so far nobody seems to
want to and WebM support is dropped in 4.0, so this workaround should help for
now.

Fixes #50862.
2021-10-18 15:48:45 +02:00
Rémi Verschelde fddbbf445b
SCons: Fix missing mono `.gen.cpp` sources after #53860
(cherry picked from commit d6aab5c1bf)
2021-10-16 16:47:08 +02:00
Raul Santos 977898709f Fix hint_string for C# enum arrays 2021-10-15 19:07:31 +02:00
Rémi Verschelde f04a1bec63
Merge pull request #53628 from raulsntos/fix-list-marshal-3.x 2021-10-15 17:36:00 +02:00
Rémi Verschelde b8761569f6
Merge pull request #53582 from raulsntos/mono-marshal-generics-3.x 2021-10-15 17:35:32 +02:00
Rémi Verschelde 5ff8d0e8a7
Merge pull request #53577 from raulsntos/fix-mono-to-variant-array-3.x 2021-10-15 17:35:09 +02:00
Raul Santos 059750cd0d Support marshaling generic Godot.Object
Allows using generic C# types in signals as long as they inherit
from `Godot.Object`.
2021-10-13 18:22:06 +02:00
Ev1lbl0w e57f8fd083
Fix VisualScript crash with null object 2021-10-13 12:19:29 +01:00
M. Huri 37ccfb18ff Fixed a typo in csg module 2021-10-12 11:13:29 +07:00
Yuri Sizov b6b65e08d1 Remove redundant String operation from GDScript enum exports 2021-10-11 02:12:30 +03:00
Infinixius 0f328bcbdc
Fix small typos regarding WebSocketPeer
(cherry picked from commit 547ed239c0)
2021-10-10 12:27:47 +02:00
Raul Santos fd160b642e Fix C# List<T> marshalling 2021-10-10 11:41:37 +02:00
Rémi Verschelde 302ad4e600
Merge pull request #52918 from Calinou/add-new-light-attenuation-3.x 2021-10-08 23:08:49 +02:00
Hugo Locurcio 85e080fcc0
Backport new 3D point light attenuation as an option
This provides more realistic lighting with a very small performance cost.
The option is available in both GLES3 and GLES2, and can be enabled in
the Project Settings. This goes well with the ACES Fitted tonemapping mode
that was recently added.

When enabled, this also makes upgrading Godot 3.x projects to Godot 4.0 easier,
since lighting in 3.x will better match how it'll look in Godot 4.0.
2021-10-08 22:15:22 +02:00
Raul Santos ec2f86ec9a Support arrays of StringName, NodePath and RID in mono 2021-10-08 18:52:40 +02:00
Rémi Verschelde 07094f5253
Merge pull request #53507 from qarmin/fast_as_snail 2021-10-08 14:58:01 +02:00
Rémi Verschelde 81da3b8ba4
Use translated docs in PropertySelector
And do the dedent and stripping for both translated and
non-translated strings for consistency, and so that we
don't need to do it at the call site.

(cherry picked from commit a16031beb6)
2021-10-07 12:48:23 +02:00
Rafał Mikrut 1558f4a599 Speedup parsing big GDScript files 2021-10-07 07:39:56 +02:00
Rémi Verschelde 3f05c388a1
Merge pull request #52521 from kdiduk/52499-preload-parsing-error-when-newline-encountered 2021-10-06 10:13:19 +02:00
Kirill Diduk 835143b7bd #52499 Fix parsing 'preload': increase/decrease parenthesis count 2021-10-06 09:35:21 +02:00
Rémi Verschelde c7eb3d25e7
doc: Fix style inconsistencies for `[b]Note:[/b]` paragraphs
(cherry picked from commit 788b3aa27a)
2021-10-06 09:29:32 +02:00
Rémi Verschelde 0a1cd0c316
Merge pull request #53448 from lyuma/backport_gltf_skin_export 2021-10-06 08:26:18 +02:00
Rémi Verschelde e6cc245bf0
Merge pull request #53454 from stebulba/path_simplify_angle-fix-error-from-merge 2021-10-06 08:24:56 +02:00
Stéphane Fortin 58a4035017
Fix merging error path_simplify_angle CSGPolygon
[3.x] Quick fix on path_simplify_angle introduce here https://github.com/godotengine/godot/pull/52509#issuecomment-933331579
after merging #52509
2021-10-05 21:19:23 -04:00
Lyuma 3cdaaffb54 Backport to 3.x "gltf export: Fix export of skeletons, skins and blend shapes."
Create GLTFSkeleton at the same time we create GLTFNode objects.
Create GLTFSkin at the same time we export MeshInstance3D
Fixes export of blend shape arrays for meshes with multiple surfaces.
Fixes array indexing issues in export of glTF morph target animations.

Converts BoneAttachment3D nodes during normal node creation: this avoids
special cases during mesh export, and especially exporting skeletons or meshes
which are children of BoneAttachment3D.

Co-authored-by: K. S. Ernest (iFire) Lee <ernest.lee@chibifire.com>
2021-10-05 14:14:28 -07:00
Rémi Verschelde 393166793c
Merge pull request #52952 from Calinou/cpu-lightmapper-num-threads-editor-setting 2021-10-05 19:20:29 +02:00
Hugo Locurcio 0e943939e2
Add an editor setting to configure number of threads for lightmap baking
This can be used to free some CPU cores when baking lightmaps.
When using fewer CPU cores, lightmap baking is slower but background
tasks aren't slowed down as much.
2021-10-05 17:35:20 +02:00
Rémi Verschelde f9e3bc2652
Merge pull request #51728 from lawnjelly/proj_settings_misc 2021-10-05 13:36:43 +02:00
lawnjelly 192ec963ae Create 'rendering/misc' project settings section
To prevent the project settings `rendering` section getting out of hand, this PR moves some of the smaller new settings into a `misc` category.
2021-10-05 11:47:03 +01:00
Rémi Verschelde e31a10da98
Merge pull request #52274 from aaronfranke/3.x-gltf-noregex 2021-10-05 12:40:12 +02:00
Rémi Verschelde db0370cab5
Merge pull request #51086 from aaronfranke/3.x-warn-dectime 2021-10-05 12:06:03 +02:00
Rémi Verschelde d01c660954
Merge pull request #52964 from Pineapple/WIN32_LEAN_AND_MEAN 2021-10-05 12:03:52 +02:00
Rémi Verschelde 9ffaa6c090
Merge pull request #53347 from migeran/fix_gdnative_get_current_library_path 2021-10-05 11:08:16 +02:00
Kongfa Waroros 77d5ead241
Check if the line pointer goes away from the image buffer's EOF in the BMP importer
(cherry picked from commit ac5d7abe13)
2021-10-04 15:22:16 +02:00
Hugo Locurcio 48e0212497
Add an example on iterating an array backwards
This closes https://github.com/godotengine/godot-docs/issues/3472.

(cherry picked from commit 810d8f06b7)
2021-10-04 15:15:27 +02:00
Hugo Locurcio 7e3016ebfd
Document how to set up UPnP in a non-blocking manner
(cherry picked from commit f4bebc272c)
2021-10-04 14:37:43 +02:00
jitspoe d7af7a9b3b
CSGPolygon fixes and features: Added angle simplification, UV tiling distance option, and interval type, which allows distance-based intervals (old) and subdivision-based intervals (new to 3.4). 2021-10-04 12:14:44 +02:00
Haoyu Qiu ed5a98c3c6 Fix crash when pinned SoftBody point is out of range 2021-10-04 15:47:12 +08:00
Rémi Verschelde 06e0260699
Merge pull request #53349 from LATRio/53331_1 2021-10-03 12:16:45 +02:00
LATRio 56aa9f71b6 Prevent out of bound access through 'm_nodes' in SoftBodyBullet 2021-10-03 16:36:01 +09:00
Gergely Kis 1583c89a45 Fix GDNativeLibrary::get_current_library_path()
Return a const String reference to make sure that when its address
is used as a handle in NativeScriptLanguage::init_library(),
it refers to the heap instead of a temporary object on the stack.
2021-10-03 08:24:49 +02:00
LATRio be69d26403 Fix crash at SoftBodyBullet::reset_all_node_positions when bt_soft_body isn't initialized
Update soft_body_bullet.cpp
2021-10-02 22:03:54 +09:00
Francois Belair 6be31e559d
Fix empty line hover; fix open non-res:// script
(cherry picked from commit 572979d011)
2021-10-01 21:30:39 +02:00
Francois Belair 3754759e26 Fix extends parsing breaking if it has the cursor 2021-10-01 11:31:05 -04:00
Hugo Locurcio fe2f24c47c
Improve the documentation for `ease()` and `smoothstep()`
This adds a cheatsheet for `ease()` and a comparison graph for
`smoothstep()`, among other things.

(cherry picked from commit 567b6436c9)
2021-10-01 08:04:20 +02:00
Francois Belair 679ce6fd0b Fix LSP crash parsing scripts of temp size 0 2021-09-30 11:11:56 -04:00
Rémi Verschelde fba9fb2439
Merge pull request #53183 from m4nu3lf/threadsafe_bullet_3.x 2021-09-29 21:34:56 +02:00
Rémi Verschelde 585a9c2979
Merge pull request #48300 from akien-mga/3.x-bullet-3.09 2021-09-29 21:25:58 +02:00
Rémi Verschelde b7901c773c
bullet: Sync with upstream 3.17
Stop include Bullet headers using `-isystem` for GCC/Clang as it misleads
SCons into not properly rebuilding all files when headers change.

This means we also need to make sure Bullet builds without warning, and
current version fares fairly well, there were just a couple to fix (patch
included).

Increase minimum version for distro packages to 2.90 (this was never released
as the "next" version after 2.89 was 3.05... but that covers it too).
2021-09-29 16:30:34 +02:00
Rémi Verschelde 69b2f1dcc6
Merge pull request #53094 from Razoric480/fix-func-doc-_init 2021-09-29 15:47:37 +02:00
Francois Belair ae3aec1dbc Makes LSP report new() as _init; fixes docstrings 2021-09-29 08:43:32 -04:00
Manuele Finocchiaro 6f81c213a6 Compile bullet with threasafe switch on 2021-09-28 17:21:26 +01:00
Rémi Verschelde dbe0e4613a
Merge pull request #53140 from V-Sekai/gltf_naming_fix 2021-09-28 08:40:54 +02:00
Pedro J. Estébanez 6697e380d9 Fix check for freed object during cast 2021-09-27 19:46:49 +02:00
SaracenOne c6387e58e9 Fixes naming conflict in GLTF importer 2021-09-27 18:07:50 +01:00
BimDav 9de9994444
Reload kinematic shapes when changing PhysicsBody mode to Kinematic
Prevents a crash when calling test_body_motion. Call reload_kinematic_shapes
from init_kinematic_utilities as they are always called together.

(cherry picked from commits 112985c5bc
and 3540e716f9)
2021-09-27 18:10:30 +02:00
Aaron Franke 674cb947ea
[3.x] Fix GLTF light import 2021-09-26 21:57:03 -05:00
Francois Belair 885d905b0d Make LSP send applyEdit to connect editor signals 2021-09-25 15:22:28 -04:00
Rémi Verschelde 6e39566344
Merge pull request #52883 from Germanrc/script_reload_fix
C# scripts reload in editor fixed
2021-09-24 08:33:49 +02:00
Bartłomiej T. Listwon f463e612a1 Add missing WIN32_LEAN_AND_MEAN 2021-09-23 10:36:31 +02:00