1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-04 12:00:25 +00:00
Commit Graph

198 Commits

Author SHA1 Message Date
cier
ebe9370724 Add enable checkboxes to editor sections
Fixes https://github.com/godotengine/godot-proposals/issues/4173
2025-04-15 13:49:41 -07:00
Lukas Tenbrink
fbe64ffb45 Change get_class_static to return StringName.
Use that static `get_class_static` for `_get_class_namev` to avoid duplication.
2025-04-08 23:25:05 +02:00
Thaddeus Crews
36991aba34 Merge pull request #104264 from YYF233333/layout/gdvirtual
Optimize gdvirtual function layout
2025-04-08 12:32:51 -05:00
Thaddeus Crews
5dc7d56b92 Merge pull request #105099 from Ivorforce/object-classname-cache
Fix caching of objects' class name pointer in `Object` instances.
2025-04-08 12:32:40 -05:00
Lukas Tenbrink
e7f087b91a Fix caching of objects' class name pointer in Object instances.
Use `get_class_name` for `get_class` calls. Merge `get_parent_class_static` into `get_class_static`.
2025-04-07 21:05:21 +02:00
Thaddeus Crews
5edb235018 CI: Bump various pre-commit hooks 2025-04-07 08:23:35 -05:00
Thaddeus Crews
046c9f540c Merge pull request #105030 from Ivorforce/class-is-enabled-object
Move `GD_IS_CLASS_ENABLED` and respective include from `class_db.h` to `object.h`, as this is where it's needed.
2025-04-04 17:40:58 -05:00
Lukas Tenbrink
aa5ca4f1a2 Move GD_IS_CLASS_ENABLED and respective include from class_db.h to object.h, as this is where it's needed. 2025-04-04 23:45:35 +02:00
Thaddeus Crews
78922d756a Core: Decouple GDCLASS from ClassDB 2025-04-04 16:21:30 -05:00
Yufeng Ying
057858a0fb Optimize gdvirtual layout.
Co-authored-by: David Snopek <dsnopek@gmail.com>
2025-04-04 22:54:42 +08:00
Lukas Tenbrink
e6d166344b Remove unused get_inheritance_list_static from GDCLASS. 2025-04-03 17:18:28 +02:00
Lukas Tenbrink
be82731f99 Removed unused get_valid_parents_static functions from GDCLASS. 2025-04-02 13:50:47 +02:00
Thaddeus Crews
1f1b1c56e7 Merge pull request #104381 from Ivorforce/object-notification-nobool
Optimize `Object::notification` by avoiding runtime branches
2025-04-01 19:53:37 -05:00
Lukas Tenbrink
8a76e31547 Remove bool from Object::notification virtual function; replace with separate functions to avoid branching. 2025-04-01 15:26:32 +02:00
Thaddeus Crews
abd565eb19 Merge pull request #104844 from Ivorforce/gdsoftclass
Add and require `GDSOFTCLASS` for `Object` subclasses that want to cast but do not use `GDCLASS`.
2025-03-31 19:02:03 -05:00
Lukas Tenbrink
fa0a3c9c6e Add and require GDSOFTCLASS for Object subclasses that want to cast but do not use GDCLASS. 2025-03-31 20:49:50 +02:00
Thaddeus Crews
8f6bb119f4 Merge pull request #100602 from KoBeWi/over_100_changes_in_50_random_files_aka_the_best_kind_of_PR
Add templated version of `ObjectDB::get_instance()`
2025-03-31 12:03:47 -05:00
kobewi
bc9d0c7835 Add templated version of ObjectDB::get_instance() 2025-03-27 15:43:23 +01:00
Lukas Tenbrink
dd9dc75a83 Optimize Object::cast_to by assuming no virtual and multiple inheritance, gaining 8x throughput over dynamic_cast.
Add `-Wvirtual-inheritance` to compiler warnings as a sanity check.
2025-03-27 15:39:53 +01:00
A Thousand Ships
d9721954e6 [Core] Use Vector for MethodInfo::arguments 2025-03-10 13:57:53 +01:00
Thaddeus Crews
324512e11c Style: Replace header guards with #pragma once 2025-03-07 17:33:47 -06:00
kobewi
c6c1a49bea Don't edit objects when loading folding 2025-03-06 15:04:00 +01:00
David Snopek
39f16e70f8 GDExtension: Add compatibility system for virtual methods 2025-01-10 16:00:05 -06:00
Thaddeus Crews
e06d83860d Style: Enforce AllowShortFunctionsOnASingleLine 2025-01-02 10:09:41 -06:00
Hugo Locurcio
7a04d85ec3 Only allow valid types in Decal, Light3D projector, PointLight2D texture and CSGMesh3D mesh
If an invalid type is supplied (which can still be done from a script),
a warning is printed (along with a workaround for ViewportTexture).

This also adds support for "negative" resource hints such as
"Texture2D,-ViewportTexture" to exclude one or more subclasses
from a class hint.

Co-authored-by: Tomasz Chabora <kobewi4e@gmail.com>
2024-12-17 20:41:12 +01:00
Rémi Verschelde
08508d2e01 Merge pull request #99700 from hpvb/scene_tree_editor_performance
Improve Scene Tree editor performance
2024-12-16 17:16:00 +01:00
HP van Braam
6f7525c396 Improve Scene Tree editor performance
We now cache the Node*<>TreeItem* mapping in the SceneTreeEditor. This
allows us to make targeted updates to the Tree used to display the scene
tree in the editor.

Previously on almost all changes to the scene tree the editor would
rebuild the entire widget, causing a large number of deallocations an
allocations. We now carefully manipulate the Tree widget in-situ saving
a large number of these allocations.

In order to know what Nodes need to be updated we add a
editor_state_changed signal to Node, this is a TOOLS_ENABLED,
editor-only signal fired when changes to Node happen that are relevant
to editor state.

We also now make sure that when nodes are moved/renamed we don't check
expensive properties that cannot contain NodePaths. This saves a lot of
time when SceneTreeDock renames a node in a scene with a lot of
MeshInstances. This makes renaming nodes go from ~27 seconds to ~2
seconds on large scenes.

SceneTreeEditor instances will now also not do all of the potentially
expensive update work if they are invisible. This behavior is turned off
by default so it won't affect existing users. This change allows the
editor to only update SceneTreeEditors that actually in view. In
practice this means that for most changes instead of updating 6
SceneTreeEditors we only update 1 instantly, and the others only when
they become visible.

There is definitely more that could be done, but this is already a
massive improvement. In complex scenes we see an improvement of 10x,
things that used to take ~30 seconds now only take 2.

This fixes #83460

I want to thank KoBeWi, TokisanGames, a-johnston, aniel080400 for
their tireless testing. And AeioMuch for their testing and providing a
fix for the hover issue.
2024-12-12 22:47:05 +01:00
Rémi Verschelde
2153a60425 Revert "Avoid duplicating signals from scene instances into packed scenes"
This partially reverts commit 8a42e3d3ef.

Comment improvements and the test case were kept, with one part commented out.
2024-12-10 10:42:58 +01:00
cixil
8a42e3d3ef Avoid duplicating signals from scene instances into packed scenes 2024-11-29 18:29:08 +01:00
Thaddeus Crews
37305e40bc Merge pull request #95711 from TokageItLab/warn-oneshot-prop
Add hint for oneshot property & warning when it will be updated continuously by Force Continuous in `AnimationMixer`
2024-11-22 14:54:30 -06:00
Silc Lizard (Tokage) Renew
761a20f7a7 Add hint for oneshot & warning when it will be updated continuously 2024-11-11 01:12:45 +09:00
Adam Scott
0d350e7108 Set clang-format RemoveSemicolon rule to true
- Set clang-format `Standard` rule to `c++20`
2024-10-25 13:49:43 -04:00
Danil Alexeev
85dfd89653 Add @export_tool_button annotation for easily creating inspector buttons
Co-authored-by: jordi <creptthrust@gmail.com>
Co-authored-by: K. S. Ernest (iFire) Lee <ernest.lee@chibifire.com>
Co-authored-by: Mack <86566939+Macksaur@users.noreply.github.com>
2024-09-27 22:24:15 +01:00
Rémi Verschelde
8a9a26ef19 Merge pull request #93311 from dsnopek/gdextension-required-virtuals
GDExtension: Mark virtual function as `is_required` in `extension_api.json`
2024-09-27 13:53:16 +02:00
A Thousand Ships
203d3be200 [Core] Add way to check if a signal has any connections
Added to `Object` and `Signal`
2024-09-20 16:39:09 +02:00
Haoyu Qiu
c5d147b9b5 Allow configuring which translation domain Object.tr uses 2024-09-17 13:09:44 +08:00
David Snopek
c2af6bcb59 GDExtension: Mark virtual function as is_required in extension_api.json
Co-authored-by: Jovan Gerodetti <jovan.gerodetti@titannano.de>
2024-09-11 16:48:14 -05:00
rune-scape
0dde931bc9 StringName: Fix empty hash
+Fixed compat hashes
2024-09-09 13:30:02 -07:00
Thaddeus Crews
9853a69144 Implement typed dictionaries 2024-09-04 10:27:26 -05:00
Danil Alexeev
49bcdf78a7 Core: Сheck r_error after calling callp() 2024-08-30 21:09:30 +03:00
Rémi Verschelde
909629d9f9 Merge pull request #96166 from AThousandShips/more_lock_raii
Use `MutexLock` in more places
2024-08-30 09:59:19 +02:00
demolke
c409e6d722 Import/export GLTF extras to node->meta
This is useful for custom tagging of objects with properties (for example in Blender) and having this available in the editor for scripting.

- Adds import logic to propagate the parsed GLTF extras all the way to the resulting Node->meta
- Adds export logic to save Godot Object meta into GLTF extras
- Supports `nodes`, `meshes` and `materials` (in GLTF sense of the words)
2024-08-29 19:17:04 +02:00
A Thousand Ships
e33fdb4296 Use MutexLock in more places 2024-08-29 14:12:59 +02:00
Rémi Verschelde
3e8d051a4a Merge pull request #94068 from dalexeev/core-remove-is-gpl-reversed
Core: Remove unused method `_is_gpl_reversed()`
2024-08-28 00:11:58 +02:00
Daylily-Zeleen
3d575801ce Allow ClassDB to create a Object without postinitialization for GDExtension. 2024-08-20 20:19:02 +08:00
Danil Alexeev
151f34bb80 Core: Remove unused method _is_gpl_reversed() 2024-07-08 12:31:09 +03:00
Jan Haller
27a637d287 GDExtension: provide free_property_list_func with length of array 2024-04-27 14:13:17 +02:00
Radiant
e263b11cdd Implement remove_user_signal()
Co-authored-by: Timothe Bonhoure <tbonhoure@ymail.Com>
Co-authored-by: Rémi Verschelde <rverschelde@gmail.com>
Co-authored-by: A Thousand Ships <96648715+AThousandShips@users.noreply.github.com>
2024-04-18 11:22:59 +03:00
Rémi Verschelde
453485aede Merge pull request #89270 from Repiteo/enforce-typename-in-templates
Enforce template syntax `typename` over `class`
2024-03-14 22:34:37 +01:00
A Thousand Ships
59bcc2888c Add methods to get argument count of methods
Added to:
* `Callable`s
* `Object`s
* `ClassDB`
* `Script(Instance)`s
2024-03-10 11:02:43 +01:00