summaryrefslogtreecommitdiffstats
path: root/core/object/class_db.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Fix deadlocks related to ClassDB queries about global classesPedro J. Estébanez2024-11-081-43/+61
| | | | | | `ClassDB::can_instantiate()` and other reflection methods deadlock if the type is an script global class, when such script indirectly uses a not-yet-registered class. The reason is the `ClassDB` read lock is still held when invoking the `ResourceLoader` to load the class script, which may in turn need to lock for writing (for the class registration). In particular, this happens with some types related to animation tree, that aren't registered at engine startup, but can happen with others, especially ones from the user. Registration statements are also added for the animation-related types that were lacking them.
* [Core] Improve error messages with `vformat`A Thousand Ships2024-10-301-44/+44
|
* Merge pull request #92888 from ↵Rémi Verschelde2024-09-121-0/+7
|\ | | | | | | | | | | Hilderin/fix-unable-to-use-resourceLoader-in-c#-after-threaded-load Fix inability to use ResourceLoader in C# after threaded load in GDScript
| * Fix Unable to use ResourceLoader in C# after threaded load in GDScript #92798Hilderin2024-09-111-0/+7
| |
* | Merge pull request #95292 from aaronp64/is_parent_class_perfRémi Verschelde2024-09-121-8/+4
|\ \ | |/ |/| | | Improve `ClassDB::_is_parent_class` performance
| * Improve ClassDB::_is_parent_class performanceaaronp642024-08-081-8/+4
| | | | | | | | Change ClassDB::_is_parent_class to use ClassInfo::inherits_ptr, instead of looking up each inherited class name.
* | Fix `bool` type appearing in GDExtension headerJan Haller2024-08-311-2/+2
| |
* | Core: Сheck `r_error` after calling `callp()`Danil Alexeev2024-08-301-2/+4
| |
* | Fix editor needs restart after adding GDExtensionsHilderin2024-08-291-0/+16
| |
* | Merge pull request #91018 from ↵Rémi Verschelde2024-08-261-27/+89
|\ \ | | | | | | | | | | | | | | | Daylily-Zeleen/daylily-zeleen/optionally_postinitialization_for_extension_owner Allow ClassDB to create a Object without postinitialization for GDExtension.
| * | Allow ClassDB to create a Object without postinitialization for GDExtension.Daylily-Zeleen2024-08-201-27/+89
| |/
* | Merge pull request #93602 from aaronp64/inspector_latencyRémi Verschelde2024-08-221-0/+23
|\ \ | |/ |/| | | Improve Editor Inspector/Theme item lookup performance
| * Improve Editor Inspector/Theme item lookup performanceaaronp642024-08-201-0/+23
| | | | | | | | | | | | | | | | | | | | | | Changes to reduce the latency between changing node selection in the editor and seeing the new node reflected in the Inspector tab - Use Vector instead of List for ThemeOwner::get_theme_type_dependencies and related functions - Use Vector instead of List for ThemeContext::themes, set_themes(), and get_themes() - Add ClassDB:get_inheritance_chain_nocheck to get all parent/ancestor classes at once, to avoid repeated ClassDB locking overhead - Update BIND_THEME_ITEM macros and ThemeDB::update_class_instance_items to use provided StringNames for call to ThemeItemSetter, instead of creating a new StringName in each call These changes reduce the time taken by EditorInspector::update_tree by around 30-35%
* | Merge pull request #93942 from MikeSchulze/73525Rémi Verschelde2024-07-111-0/+15
|\ \ | | | | | | | | | Fix GDScript analyzer error when instantiating EditorPlugins.
| * | Fix gdscript analyzer error when instantiating EditorPlugins.baptr2024-07-101-0/+15
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Editor code is not instantiable outside of the editor (https://github.com/godotengine/godot/blob/1d14c054a12dacdc193b589e4afb0ef319ee2aae/core/object/class_db.cpp#L369). This is fine for editor plugins and the like, but the GDScript analyzer balks at it, causing F5 runs to fail: #73525. Instead, we really just want to know if the type is abstract - so add a new ClassDB method to check that and nothing else. Update core/object/class_db.cpp Apply code review comments Co-Authored-By: Bryce <1522777+baptr@users.noreply.github.com>
* / GDExtension: Fix setting base class properties on a runtime classDavid Snopek2024-07-081-19/+44
|/
* Fix `ClassDB` not checking for `API_EDITOR_EXTENSION`Mikael Hermansson2024-05-251-3/+3
|
* Don't use `ERR_PRINT_ONCE()` for runtime class error because it will hide errorsDavid Snopek2024-05-211-1/+1
|
* Use Core/Scene stringnames consistentlykobewi2024-05-131-1/+0
|
* Add shorthand for using singleton string nameskobewi2024-05-111-1/+1
|
* Reduce and prevent unnecessary random-access to `List`A Thousand Ships2024-05-041-4/+5
| | | | | | | | | Random-access access to `List` when iterating is `O(n^2)` (`O(n)` when accessing a single element) * Removed subscript operator, in favor of a more explicit `get` * Added conversion from `Iterator` to `ConstIterator` * Remade existing operations into other solutions when applicable
* GDExtension: provide `free_property_list_func` with length of arrayJan Haller2024-04-271-2/+3
|
* Fix GDExtension hot reload for classes not created via `ClassDB::instantiate()`David Snopek2024-04-091-8/+19
|
* Add methods to get argument count of methodsA Thousand Ships2024-03-101-0/+25
| | | | | | | | Added to: * `Callable`s * `Object`s * `ClassDB` * `Script(Instance)`s
* Fix compilation errors when `DISABLE_DEPRECATED` is defined398utubzyt2024-02-281-0/+2
|
* Allow registering "runtime classes" in modules (not just GDExtension)David Snopek2024-02-221-17/+44
|
* Allow registering "runtime classes"David Snopek2024-02-201-5/+225
|
* Allow GDExtensions to register virtual methods and call them on scriptsDavid Snopek2024-02-121-0/+22
|
* Allow `free()` to be used as CallableGeorge Marques2024-01-181-0/+7
| | | | | | | This method is registered in a special way so ClassDB doesn't naturally know about its existence. Here it is hardcoded if any other option fail to check if it is about the `free()` method and, if so, say it exists and return a Callable.
* Polish & fix editor help cache generationPedro J. Estébanez2023-11-021-1/+16
| | | | | | | - Isolated the generation of extensions's docs. They're now not cached and refreshed as needed. - Removed superfluous sorting of the class list. - Removed some superfluous/unused elements. - Renamed some items for clarity.
* Improve threading in ClassDB and EditorHelpYuri Sizov2023-10-201-3/+8
|
* Merge pull request #80527 from ↵Rémi Verschelde2023-09-261-3/+59
|\ | | | | | | | | | | raulsntos/dotnet/generate-compat-methods-from-classdb C#: Generate and use compat methods
| * C#: Generate and use compat methodsRaul Santos2023-09-191-3/+59
| | | | | | | | | | | | - Implements `ClassDB::get_method_list_with_compatibility` to retrieve all methods from a class including compat methods. - C# bindings generator now also generates compat methods. - All generated C# methods now use `ClassDB::get_method_with_compatibility`.
* | Merge pull request #80284 from dsnopek/gdextension-hot-reloadRémi Verschelde2023-09-261-4/+21
|\ \ | | | | | | | | | Implement reloading of GDExtensions
| * | Implement reloading of GDExtensionsDavid Snopek2023-09-251-4/+21
| | |
* | | Merge pull request #81101 from 398utubzyt/dotnet/abstract-class-supportRémi Verschelde2023-09-251-2/+12
|\ \ \ | |/ / |/| | | | | C#: Add abstract class support
| * | C#: Abstract script class support398utubzyt2023-09-151-2/+12
| | |
* | | Merge pull request #81521 from dsnopek/method-bind-default-argument-hash-fixRémi Verschelde2023-09-221-4/+5
|\ \ \ | |/ / |/| | | | | Fix method hashes with default arguments
| * | Fix method hashes with default argumentsDavid Snopek2023-09-211-4/+5
| | |
* | | [Core] Replace `ERR_FAIL_COND` with `ERR_FAIL_NULL` where applicableA Thousand Ships2023-09-111-28/+28
| | |
* | | Allow GDExtension to register unexposed class.Daylily-Zeleen2023-09-041-1/+8
|/ /
* / Fix GDExtension classes derived from abstract GDExtension classes always ↵Ricardo Buring2023-08-221-1/+9
|/ | | | being registered as abstract
* Re-enable docs cache with fixesPedro J. Estébanez2023-07-051-2/+2
|
* Merge pull request #76446 from reduz/add-gdextension-api-compatibilityRémi Verschelde2023-05-151-6/+124
|\ | | | | | | Add a backwards-compatibility system for GDExtension
| * Add a backwards-compatibility system for GDExtension methodJuan Linietsky2023-05-151-6/+124
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds a way to ensure that methods that were modified in the Godot API will continue working in older builds of GDExtension even if the new signature is different. ```C++ // New version (changed) ClassDB::bind_method(D_METHOD("add_sphere","radius","position"),&MyShapes::add_sphere); // Compatibility version (still available to extensions). ClassDB::bind_compatibility_method(D_METHOD("add_sphere","radius"),&MyShapes::_compat_add_sphere); ``` **Q**: If I add an extra argument and provide a default value (hence can still be called the same), do I still have to provide the compatibility version? **A**: Yes, you must still provide a compatibility method. Most language bindings use the raw method pointer to do the call and process the default parameters in the binding language, hence if the actual method signature changes it will no longer work. **Q**: If I removed a method, can I still bind a compatibility version even though the main method no longer exists? **A**: Yes, for methods that were removed or renamed, compatibility versions can still be provided. **Q**: Would it be possible to automate checking that methods were removed by mistake? **A**: Yes, as part of a future PR, the idea is to add a a command line option to Godot that can be run like : `$ godot --test-api-compatibility older_api_dump.json`, which will also be integrated to the CI runs.
* | Add peace-of-mind checks to API hash cachingPedro J. Estébanez2023-04-261-1/+7
|/
* Improve reliability of editor docs cachePedro J. Estébanez2023-04-251-1/+8
|
* One Copyright Update to rule them allRémi Verschelde2023-01-051-29/+29
| | | | | | | | | | | | | | | | | | | | As many open source projects have started doing it, we're removing the current year from the copyright notice, so that we don't need to bump it every year. It seems like only the first year of publication is technically relevant for copyright notices, and even that seems to be something that many companies stopped listing altogether (in a version controlled codebase, the commits are a much better source of date of publication than a hardcoded copyright statement). We also now list Godot Engine contributors first as we're collectively the current maintainers of the project, and we clarify that the "exclusive" copyright of the co-founders covers the timespan before opensourcing (their further contributions are included as part of Godot Engine contributors). Also fixed "cf." Frenchism - it's meant as "refer to / see".
* Rename all gdnative occurences to gdextensionGilles Roudière2022-12-121-10/+10
| | | | | | | | | | | | | Non-exhaustive list of case-sensitive renames: GDExtension -> GDNative GDNATIVE -> GDEXTENSION gdextension -> gdnative ExtensionExtension ->Extension (for where there was GDNativeExtension) EXTENSION_EXTENSION ->EXTENSION (for where there was GDNATIVE_EXTENSION) gdnlib -> gdextension gdn_interface -> gde_interface gdni -> gde_interface
* Fix default values on virtual classes causing errors in projectsAaron Franke2022-11-091-1/+1
|