summaryrefslogtreecommitdiff
path: root/core/object
AgeCommit message (Collapse)Author
2022-09-30Fix typos with codespellRémi Verschelde
Using codespell 2.3-dev from current git. And fix typo in `methods.py` for `vsproj=yes` option (still won't work though).
2022-09-28Rename `script_instance` to `_script_instance` in the `GDVIRTUAL*` wrappers ↵bruvzg
to avoid shadowing `Object` member.
2022-09-26MethodBind: Silence GCC `-Wmaybe-uninitialized` caused by UBSANRémi Verschelde
A priori this doesn't appear to be an actual bug, but a known consequence of using UBSAN. We silence this one to still have the possibility to get more warnings raised by UBSAN, in case they are useful. Works around and closes #66343.
2022-09-22Merge pull request #66110 from Zylann/reference_get_countRémi Verschelde
get_reference_count()`
2022-09-21Rename and expose `RefCounted::get_reference_count()`Marc Gilleron
2022-09-18Change UndoRedo to use Callableskobewi
2022-09-06Rename CONNECT_ONESHOT TO CONNECT_ONE_SHOTMicky
For consistency. Every other exposed `one_shot` is spaced out like this.
2022-09-02Rename `or_lesser` range property hint to `or_less`Hugo Locurcio
"less" should be used for quantity, rather than "lesser". Existing scripts that use `or_lesser` in `_get_property_list()` will need to be updated to account for this change.
2022-08-31Improve null and object printing to avoid confusion with arraysHugo Locurcio
- Use different syntax for object printing to avoid confusion with arrays. - Print null as `<null>` to avoid confusion with a string `"null"`. - Display `<empty>` in editor resource pickers to avoid confusion with array-based properties.
2022-08-26[macOS export] Simplify code signing options, add support for rcodesign tool ↵bruvzg
for signing and notarization.
2022-08-24Merge pull request #64691 from TokageItLab/Quaternion-editorRémi Verschelde
2022-08-24Implement Quaternion EditorSilc Renew
2022-08-24Merge pull request #64009 from KoBeWi/arrayy_lmaoRémi Verschelde
Replace Array return types with TypedArray (part 2)
2022-08-23Replace Array return types with TypedArray 2kobewi
2022-08-23[GDExtension] Fix `_property_can_revert` and `_property_get_revert` methods ↵bruvzg
using incorrect string type.
2022-08-23Merge pull request #64511 from derammo/derammo_fix_has_property_default_valueRémi Verschelde
2022-08-22Make `_validate_property` a multilevel methodYuri Sizov
2022-08-20added missing virtual to ScriptExtensionderammo
_has_property_default_value is a required virtual for ScriptExtension but it was not bound, and could therefore not be implemented this made it impossible to implement a ScriptExtension that runs
2022-08-19Merge pull request #64334 from YuriSizov/core-bind-property-revert-methodsYuri Sizov
Make `property_*_revert` methods multilevel and expose them for scripting
2022-08-18Make `property_*_revert` methods multilevel and expose them for scriptingYuri Sizov
2022-08-12Fix instance binding unreference callback regressionIgnacio Roldán Etcheverry
This was a regression from 44691448911f1d29d4d79dbdd5553734761e57c4 The callback should be called, not only be called when the refcount reaches 0. For example, the C# callback needs to know when the refcount reaches 1, in order to swap to a weak GC handle.
2022-08-08Add checks for empty/unnamed arguments to make_rst.pyYuri Sizov
2022-08-06Merge pull request #63712 from object71/fix-export-issuesRémi Verschelde
2022-08-03Removed faulty function update after get_property_list.Hristo Stamenov
The function tried to rearrange properties but that lead to problems with duplication or deleted properties. Implemented the logic that that function did inside the get_property_list both for tool scripts and non-tool scripts.
2022-08-02Clean-up array editingreduz
2022-08-01Improve easing inspector usabilityHugo Locurcio
- Add `positive_only` property hint to disallow using negative presets. These values are clamped in several places in the editor already, so this avoids displaying presets that don't work. - Move the Zero preset at the end of the positive list to match the custom property editor. It's also used less often than Linear, Ease In and Ease Out. - Rename presets to be consistent between the easing property editor and custom property editor. - Remove unused `inout` hint which was redundant since it was already the default.
2022-07-29Remove Signal connect bindsJuan Linietsky
Remove the optional argument p_binds from `Object::connect` since it was deprecated by Callable.bind(). Changed all uses of it to Callable.bind()
2022-07-26[Net] Modularize multiplayer, expose MultiplayerAPI to extensions.Fabio Alessandrelli
- RPC configurations are now dictionaries. - Script.get_rpc_methods renamed to Script.get_rpc_config. - Node.rpc[_id] and Callable.rpc now return an Error. - Refactor MultiplayerAPI to allow extension. - New MultiplayerAPI.rpc method with Array argument (for scripts). - Move the default MultiplayerAPI implementation to a module.
2022-07-25Remove ThreadWorkPool, replace by WorkerThreadPoolJuan Linietsky
The former needs to be allocated once per usage. The later is shared for all threads, which is more efficient. It can also be better debugged.
2022-07-23Implement Vector4, Vector4i, Projectionreduz
Implement built-in classes Vector4, Vector4i and Projection. * Two versions of Vector4 (float and integer). * A Projection class, which is a 4x4 matrix specialized in projection types. These types have been requested for a long time, but given they were very corner case they were not added before. Because in Godot 4, reimplementing parts of the rendering engine is now possible, access to these types (heavily used by the rendering code) becomes a necessity. **Q**: Why Projection and not Matrix4? **A**: Godot does not use Matrix2, Matrix3, Matrix4x3, etc. naming convention because, within the engine, these types always have a *purpose*. As such, Godot names them: Transform2D, Transform3D or Basis. In this case, this 4x4 matrix is _always_ used as a _Projection_, hence the naming.
2022-07-22Merge pull request #63141 from reduz/implement-thread-runnerRémi Verschelde
2022-07-22Implement a Worker ThreadPoolreduz
This PR implements a worked thread pool. It uses a fixed amount of threads in a pool and allows scheduling tasks that can be run on threads (and then waited for). It satisfies the following use cases: * HTML5 thread count is fixed (and similar restrictions are known in consoles) so we need to reuse threads. * Thread spawning is slow in general, so reusing threads is faster anyway. * This implementation supports recursive waiting for tasks, making it less prone to deadlocks if threads from the pool also run tasks. After this is approved and merged, subsequent PRs will be needed to replace the ThreadWorkPool usage by this class.
2022-07-22Implement Feature Build Profilesreduz
This PR is a continuation of #50381 (which was implemented exactly a year ago!) * Add a visual interface to select which classes should not be built into Godot (well, they are built if something else uses them, but if not used the optimizer will remove them out). * Add a detection system to scan the project and figure out the actual classes used. * Added the ability for SCons to load build profiles. Obligatory Screen: A simple test with a couple of nodes in the scene resulted in a 25% reduction for the final binary size TODO: * Script languages need to implement used class detection (left for another PR). * Options to disable servers or server functionalities (like 2D or 3D physics, navigation, etc). Are missing, that should also greatly aid in reducing binary size. * Options to disable some modules would be desired. * More options to disable drivers (OpenGL, Vulkan, etc) would be desired. In general this PR is a starting point for more contributors to improve and enhance this functionality.
2022-07-12Remove unused hintskobewi
2022-07-06Merge pull request #62713 from YuriSizov/docs-scripting-annotationsRémi Verschelde
2022-07-05Implement a BitField hintreduz
Allows to specify the binder that an enum must be treated as a bitfield.
2022-07-04Add support for documenting built-in annotationsYuri Sizov
2022-06-29GDExtension: reuse code with constructor PropertyInfo(const ↵Jan Haller
GDNativePropertyInfo&)
2022-06-27Add a const call mode to Object, Variant and Script.K. S. Ernest (iFire) Lee
For this to work safely (user not call queue_free or something in the expression), a const call mode was added to Object and Variant (and optionally Script). This mode ensures only const functions can be called, making it safe to use from the editor. Co-Authored-By: reduz <reduzio@gmail.com>
2022-06-27Merge pull request #62185 from reduz/export-node-pointer-pathRémi Verschelde
Add ability to export Node pointers as NodePaths
2022-06-25Add ability to export Node pointers as NodePathsreduz
This PR implements: * A new hint: PROPERTY_HINT_NODE_TYPE for variant type OBJECT, which can take specific node types as hint string. * The editor will show it as a node path, but will set it as a pointer to a node from the current scene if you select a path. * When scene is saved, the node path is saved, then restored as a pointer. NOTE: This is a proof of concept and this approach will most likely not work. The reason if that, if the node referenced is deleted, then when trying to edit this the node will become invalid. Potential workarounds: Since this uses the Variant API, it should obtain the pointer from the Variant object ID. Yet, this would either only really work in GDScript or it would need to be implemented with workarounds in every language. Alternative ways to make this work: Nodes could export an additional property with a node path (like for which_node, it could be which_node_path). Another alternative: Path editing could happen as a hidden metadata (ignoring the pointer).
2022-06-24Rename export_range's noslider option to no_sliderMarcus Elg
2022-06-23Implement varargs in Methodinforeduz
Variadic templates are an awful thing. Implements #62233 using them in MethodInfo so less changes are required.
2022-06-21Merge pull request #62122 from reduz/implement-movie-writerRémi Verschelde
Implement a Movie Maker mode
2022-06-21Implement Running Godot as Movie Writerreduz
* Allows running the game in "movie writer" mode. * It ensures entirely stable framerate, so your run can be saved stable and with proper sound (which is impossible if your CPU/GPU can't sustain doing this in real-time). * If disabling vsync, it can save movies faster than the game is run, but if you want to control the interaction it can get difficult. * Implements a simple, default MJPEG writer. This new features has two main use cases, which have high demand: * Saving game videos in high quality and ensuring the frame rate is *completely* stable, always. * Using Godot as a tool to make movies and animations (which is ideal if you want interaction, or creating them procedurally. No other software is as good for this). **Note**: This feature **IS NOT** for capturing real-time footage. Use something like OBS, SimpleScreenRecorder or FRAPS to achieve that, as they do a much better job at intercepting the compositor than Godot can probably do using Vulkan or OpenGL natively. If your game runs near real-time when capturing, you can still use this feature but it will play no sound (sound will be saved directly). Usage: $ godot --write-movie movie.avi [scene_file.tscn] Missing: * Options for configuring video writing via GLOBAL_DEF * UI Menu for launching with this mode from the editor. * Add to list of command line options. * Add a feature tag to override configurations when movie writing (fantastic for saving videos with highest quality settings).
2022-06-20Clean up Hash Functionsreduz
Clean up and do fixes to hash functions and newly introduced murmur3 hashes in #61934 * Clean up usage of murmur3 * Fixed usages of binary murmur3 on floats (this is invalid) * Changed DJB2 to use xor (which seems to be better)
2022-06-19Allow autocompletion of "noslider" in export_rangeMarcus Elg
2022-06-17Make enum/constant binds 64-bit.bruvzg
2022-06-14Merge pull request #62030 from KoBeWi/SetName/GetNameRémi Verschelde
2022-06-14Change set/get binding to use StringNamekobewi