Commit graph

3656 commits

Author SHA1 Message Date
QbieShay d6672096fc moved particle parameters to minmax and split scale axis
This commit adds quite a chunk of modifications to particles
- particle (value + randomness) now use min and max instead
- passing a curveXYZtexture is now possible and will scale particles per-axis
- CPUParticle3D have an optional parameter to split the scale curve per-axis
2021-08-22 18:42:17 +02:00
K. S. Ernest (iFire) Lee 7cbf5a547f
Merge pull request #51700 from Geometror/fix-color-picker
Reimplement ColorPicker presets
2021-08-22 08:23:09 -07:00
reduz 3682978aee Replace BIND_VMETHOD by new GDVIRTUAL syntax
* New syntax is type safe.
* New syntax allows for type safe virtuals in native extensions.
* New syntax permits extremely fast calling.

Note: Everything was replaced where possible except for `_gui_input` `_input` and `_unhandled_input`.
These will require API rework on a separate PR as they work different than the rest of the functions.

Added a new method flag METHOD_FLAG_OBJECT_CORE, used internally. Allows to not dump the core virtuals like `_notification` to the json API, since each language will implement those as it is best fits.
2021-08-22 08:23:58 -03:00
Juan Linietsky 1990721d1b
Revert "Add Node processing and physics processing cumulative (as opposed to delta) time" 2021-08-22 08:21:34 -03:00
K. S. Ernest (iFire) Lee 8cae1294b8
Merge pull request #51952 from Jummit/refactor-graphedit-connections
Refactor GraphEdit connections
2021-08-22 01:33:58 -07:00
Hugo Locurcio fb94b2e656
Merge pull request #41850 from MohammadKhashashneh/cumulative-time_issue_6999
Add Node processing and physics processing cumulative (as opposed to delta) time
2021-08-22 10:33:20 +02:00
Hugo Locurcio f02a040d48
Define a default minimum window size to workaround rendering issues
The minimum window size can still be set to `Vector2(0, 0)` in a script
if needed.

This closes #37242.
2021-08-22 08:19:49 +02:00
Hugo Locurcio 30a88f464b
Document Image.generate_mipmaps() always running on the main thread 2021-08-22 02:22:04 +02:00
Jummit e9ef6f9815 Refactor GraphEdit connections
Remove duplicate bezier code and use Curve instead.
Add an overridable method for retrieving the points of a connection line, which
makes it posible to create custom connections lines.
2021-08-21 22:15:26 +02:00
Hendrik Brucker 72e49eadec Fix ItemList layout (+EditorFileDialog) 2021-08-21 00:22:09 +02:00
Hugo Locurcio 2daef0400a
Merge pull request #51866 from requizm/fix/49455
Fix `line_separation` working incorrectly in `RichTextLabel`
2021-08-20 23:24:42 +02:00
requizm 39b90802d0 Fix line_separation constant working incorrectly in RichTextLabel 2021-08-20 23:03:13 +03:00
reduz 542e6e8ca6 Implement Extension Loader
* Extensions are now scanned and loaded on demand.
* Extensions found are cached into a file that is used to load them (which is also exported).
* Editor will ask to restart when an extension requires core functionality.
* Editor will attempt to load extensions always before importing or loading scenes. This ensures extensions can register the relevant types.
2021-08-20 16:02:24 -03:00
fabriceci 68f0cf97bc add motion mode to handle TPS 2021-08-20 17:32:33 +02:00
Hugo Locurcio 09eb98c530
Improve documentation for String.get_extension() 2021-08-20 03:07:15 +02:00
jfons 55e7832d7b Improvements to SpotLight3D and OmniLight3D's shadows
OmniLight3D:
* Fixed lack of precision in cube map mode by scaling the projection's
  znear.
* Fixed aliasing issues by making the paraboloids use two square regions instead of two half
  squares.
* Fixed shadowmap atlas bleeding by adding padding.
* Fixed sihadow blur's inconsistent radius and unclamped sampling.

SpotLight3D:
* Fixed lack of precision by scaling the projection's znear.
* Fixed normal biasing.

Both:
* Tweaked biasing to make sure it works out of the box in most situations.
2021-08-19 13:46:51 +02:00
Aaron Franke 70c0154cbe
Improve the docs for the float type 2021-08-18 13:27:22 -05:00
Paulb23 c13c738c88 Hide TextFile from the API 2021-08-18 17:56:23 +01:00
Fabio Alessandrelli d4dd859991 [Net] MultiplayerReplicator with initial state.
Move the former "spawnables" functions to a dedicated
MultiplayerReplicator class.
Support custom overrides in replicator.
Spawn/despawn messages can now contain a state.
The state can be automatically encoded/decoded by passing the desired
object properties to `spawnable_config`.
You can use script properties to optimize the state representation.
2 Callables can be also specified to completely override the default
implementation for sending and receiving the spawn/despawn event.
(9 bytes overhead, and there's room for improvement here).
When using a custom implementation `spawn` and `despawn` can be called
with any Object, `send_spawn`/`send_despawn` can receive any Variant as
a state, and the path is not required.

Two new functions, `spawn` and `despawn`, convey the implementation
independent method for requesting a spawn/despawn of an Object, while
`send_spawn` and `send_despawn` represent the more low-level send event
for a Variant to be used by the custom implementations.
2021-08-18 10:21:29 +01:00
Rémi Verschelde a031579286
Merge pull request #50752 from Phischermen/indeterminate_checkmark_api
Added icons and API for indeterminate checkmarks for the Tree class.
2021-08-18 10:31:06 +02:00
Rémi Verschelde d7b843a060
Merge pull request #51787 from akien-mga/string-num-fix-default-decimals
String: Fix default decimals truncation in num and num_real
2021-08-18 09:31:34 +02:00
Hendrik Brucker ff9901f51e Reimplement ColorPicker presets 2021-08-18 02:09:48 +02:00
Rémi Verschelde 066dbc2f0c
String: Fix default decimals truncation in num and num_real
Fixes undefined behavior, and fixes the logic for negative powers of ten.
Fixes #51764.

Adds tests to validate the changes and prevent regressions.
Adds docs for `String.num`.
2021-08-18 00:48:03 +02:00
Mohammad Khashashneh 0c027ef0f1 Add Node processing and physics processing cumulative (as opposed to delta) time. 2021-08-17 21:34:50 +03:00
Rémi Verschelde 819aa47fee
Merge pull request #51768 from reduz/fixes-to-mobile-renderer-2
Fixes to mobile renderer
2021-08-17 19:50:10 +02:00
Rémi Verschelde 273d1ca932
Merge pull request #51775 from timothyqiu/disable-undo-redo
Improve Undo/Redo menu items
2021-08-17 19:09:56 +02:00
reduz 6027cd0a1d Fixes to mobile renderer
* Make sure shaders are named, to aid in debug in case of failure
* SceneRenderRD was being wrongly initialized (virtual functions being called when derivative class not initialized).
* Fixed some bugs resulting on the above being corrected.
2021-08-17 13:52:06 -03:00
Rémi Verschelde 913a7a63d5
Merge pull request #51793 from KoBeWi/direnam
Fix renaming directories
2021-08-17 16:06:30 +02:00
Haoyu Qiu 16c2d4ef22 Improve Undo/Redo menu items
* Make Undo/Redo menu items disabled when clicking it does nothing.
    * Context menu of `TextEdit`
    * Context menu of `LineEdit`
    * Editor's Scene menu
    * Script editor's Edit menu and context menu (for Script and Text)
* Make editor undo/redo log messages translatable.
* Mark `UndoRedo`'s `has_{un,re}do()` methods as `const`.
* Expose `TextEdit`'s `has_{un,re}do()` to scripts since `{un,re}do()` are already available.
2021-08-17 21:11:10 +08:00
kobewi 0dde3e5b59 Fix renaming directories 2021-08-17 14:38:48 +02:00
Rémi Verschelde be80d381d2
Merge pull request #50360 from m4gr3d/address_external_dir_access_master
Add support for Android scoped storage
2021-08-17 13:33:28 +02:00
Rémi Verschelde 45344c6a02
Merge pull request #51651 from pycbouh/editor-merge-custom-theme
Add support for partial custom editor themes
2021-08-17 13:13:08 +02:00
ne0fhyk 3a00ff1cce Add partial support for Android scoped storage.
This is done by providing API access to app specific directories which don't have any limitations and allows us to bump the target sdk version to 30.
In addition, we're also bumping the min sdk version to 19 as version 18 is no longer supported by Google Play Services and only account of 0.3% of Android devices.
2021-08-16 23:11:56 -07:00
Kevin Fischer 75866c81e7 Added icons and API for indeterminate checkmarks for the Tree class. 2021-08-16 10:13:06 -07:00
Rémi Verschelde 43440228db
Merge pull request #51645 from fabriceci/improve-physics-api
API improvement on the physics (CharacterBody and related classes)
2021-08-16 17:05:08 +02:00
Rémi Verschelde fff9a451a1
Merge pull request #51368 from TwistedTwigleg/GSOC_2020_Working_Branch_IK_SQUASHED
New and improved IK system for Skeleton3D - Squashed!
2021-08-16 15:37:17 +02:00
Yuri Roubinsky 1e60fcc53c Fix incorrect inheritance of VisualShaderNodeParticleAccelerator 2021-08-16 14:17:31 +03:00
Yuri Roubinsky e537a1f10e Added missed limiters for Visual Shader node enums 2021-08-15 19:10:51 +03:00
fabriceci d776b6c154 API improvement on physics, mainly CharacterBody
Changes:

- Rename few methods/property and group them in the editor when it's possible
- Make MotionResult API consistency with KinematicCollision
- Return a boolean in move_and_slide if there was a collision
- New methods:
  - get_floor_angle on CharacterBody to get the floor angle.
  - get_angle on KinematicCollision to get the collision angle.
  - get_last_slide_collision to quickly get the latest collision of move_and_slide.
2021-08-15 12:53:29 +02:00
TwistedTwigleg 5ffed49907 New and improved IK system for Skeleton3D
This PR and commit adds a new IK system for 3D with the Skeleton3D node
that adds several new IK solvers, as well as additional changes and functionality
for making bone manipulation in Godot easier.

This work was sponsored by GSoC 2020 and TwistedTwigleg

Full list of changes:
* Adds a SkeletonModification3D resource
  * This resource is the base where all IK code is written and executed
* Adds a SkeletonModificationStack3D resource
  * This node oversees the execution of the modifications and acts as a bridge of sorts for the modifications to the Skeleton3D node
* Adds SkeletonModification3D resources for LookAt, CCDIK, FABRIK, Jiggle, and TwoBoneIK
  * Each modification is in it's own file
* Several changes to Skeletons, listed below:
  * Added local_pose_override, which acts just like global_pose_override but keeps bone-child relationships intract
    * So if you move a bone using local_pose_override, all of the bones that are children will also be moved. This is different than global_pose_override, which only affects the individual bone
  * Internally bones keep track of their children. This removes the need of a processing list, makes it possible to update just a few select bones at a time, and makes it easier to traverse down the bone chain
  * Additional functions added for converting from world transform to global poses, global poses to local poses, and all the same changes but backwards (local to global, global to world). This makes it much easier to work with bone transforms without needing to think too much about how to convert them.
  * New signal added, bone_pose_changed, that can be used to tell if a specific bone changed its transform. Needed for BoneAttachment3D
  * Added functions for getting the forward position of a bone
* BoneAttachment3D node refactored heavily
  * BoneAttachment3D node is now completely standalone in its functionality.
    * This makes the code easier and less interconnected, as well as allowing them to function properly without being direct children of Skeleton3D nodes
  * BoneAttachment3D now can be set either using the index or the bone name.
  * BoneAttachment3D nodes can now set the bone transform instead of just following it. This is disabled by default for compatibility
  * BoneAttachment3D now shows a warning when not configured correctly
* Added rotate_to_align function in Basis
* Added class reference documentation for all changes
2021-08-14 15:57:00 -04:00
Rémi Verschelde 59879447a3
Merge pull request #51636 from Calinou/rename-lineshape2d
Rename LineShape2D to WorldMarginShape2D
2021-08-14 09:36:16 +02:00
Hugo Locurcio 8e3f71d750
Rename LineShape2D to WorldMarginShape2D
The new name makes it more obvious that it acts as an infinite plane,
and is consistent with its 3D counterpart (WorldMarginShape3D).
2021-08-14 03:12:13 +02:00
Yuri Sizov 855cfe1559 Add support for partial custom editor themes 2021-08-14 02:03:07 +03:00
Hugo Locurcio 1d257d02db
Add an use_hdr property to GradientTexture to allow storing HDR colors
This is disabled by default to save some memory and preserve the existing
behavior of clamping colors.
2021-08-13 23:16:24 +02:00
Rémi Verschelde 761eb7e06a
Merge pull request #51585 from Paulb23/theme-update-optimisation 2021-08-13 21:33:36 +02:00
Paulb23 b73983340d Add bulk theme overrides to Control 2021-08-13 16:41:36 +01:00
Rémi Verschelde e499758a77
Merge pull request #51025 from reduz/fix-directional-shadow-bias
Fix directional shadow bias
2021-08-13 16:45:49 +02:00
Rémi Verschelde f0e420e981
Merge pull request #51519 from Chaosus/vs_transform_operator
Changed `TransformMult` node to `TransformOp` in visual shaders
2021-08-13 14:44:14 +02:00
Rémi Verschelde 1833c8b233
Merge pull request #51587 from Calinou/use-unicode-multiplication-symbol
Use the Unicode multiplication symbol where relevant
2021-08-13 14:27:48 +02:00
Pedro J. Estébanez abdfbef075 Add project setting for agile input event flushing
If enabled, key/touch/joystick events will be flushed just before every idle and physics frame.

Enabling this can greatly improve the responsiveness to input, specially in devices that need to run multiple physics frames per each idle frame, because of not being powerful enough to run at the target frame rate.

This will only work for platforms using input buffering (regardless event accumulation). Currenly, only Android does so, but could be implemented for iOS in an upcoming PR.
2021-08-13 11:45:50 +02:00
Rémi Verschelde a98589a449
Merge pull request #51581 from bruvzg/camera_feed_port
Port camera feed to the new RenderingServer API.
2021-08-12 23:28:10 +02:00
Hugo Locurcio 7612cff432
Use the Unicode multiplication symbol where relevant 2021-08-12 21:45:33 +02:00
Rémi Verschelde 244295a0c2
Merge pull request #51579 from Calinou/doc-editorfilesystem-get-file-type
Fix incorrect descriptions for EditorFileSystem's `get_file_type()`
2021-08-12 20:36:20 +02:00
Rémi Verschelde 5e0838c58e
Merge pull request #50372 from Paulb23/code_edit_breakpoint_fixes
Fix breakpoint toggle signal not firing when expected
2021-08-12 20:33:56 +02:00
bruvzg de30dfe6a5 Port camera feed to the new RenderingServer API. 2021-08-12 20:46:19 +03:00
Hugo Locurcio 1942e0c117
Fix incorrect descriptions for EditorFileSystem's get_file_type() 2021-08-12 18:38:57 +02:00
Rémi Verschelde c89ad92c96
Merge pull request #51532 from nekomatata/layer-mask-accessors
Uniformize layer names, script methods and documentation
2021-08-12 17:55:11 +02:00
PouleyKetchoupp 989acbbe81 Uniformize layer names, script methods and documentation
- Back to 1-based layer names to make it clearer in editor UI
- Layer bit accessors are renamed to layer value and 1-based too
- Uniform errors and documentation in render and physics
- Fix a few remaining collision_layer used in place of collision_mask
2021-08-12 08:06:42 -07:00
Paulb23 a736fb8ce9 Fix breakpoint toggle signal not firing when expected 2021-08-12 14:47:10 +01:00
Rémi Verschelde a695a6764e
Merge pull request #50371 from Paulb23/text_edit_cleanup 2021-08-12 15:30:12 +02:00
Paulb23 a4606c2806 Cleanup and complete TextEdit inspector and docs 2021-08-12 11:43:35 +01:00
Yuri Roubinsky 810c30dc09
Merge pull request #51517 from Chaosus/precise_graphedit_port_handling
Better port handling connection for `GraphEdit`
2021-08-12 11:40:52 +03:00
Paulb23 0a32a6907b Cleanup and expose viewport / scrolling methods 2021-08-12 09:29:58 +01:00
Paulb23 7dbb0f3233 Rename readonly to editable 2021-08-12 09:29:58 +01:00
Paulb23 b799e5583a Rename insert mode to overtype mode 2021-08-12 09:29:58 +01:00
Paulb23 9ec3e7f3d7 Cleanup TextEdit selection methods 2021-08-12 09:29:56 +01:00
Paulb23 7e70f9e0b9 Expose and cleanup TextEdit line wrap API 2021-08-12 09:29:16 +01:00
Paulb23 d5dcaee4c5 Cleanup and rename caret operations 2021-08-12 09:29:13 +01:00
Paulb23 e60900a353 Make TextEdit cut, copy and paste overridable 2021-08-12 09:27:10 +01:00
Rémi Verschelde 1c5a8592ca
Merge pull request #49346 from IcedQuinn/document-jsonrpc
doc: Add documentation for JSONRPC class
2021-08-12 08:41:59 +02:00
Rémi Verschelde e2ca1d413e
Merge pull request #51533 from Calinou/fix-nearest-mipmap-filter
Fix the Use Nearest Mipmap Filter project setting not working
2021-08-12 08:16:46 +02:00
Iced Quinn 3fc5646b98
doc: Add documentation for JSONRPC class 2021-08-12 08:13:35 +02:00
Yuri Roubinsky 61904d56ea Better port handling connection for GraphEdit 2021-08-12 09:09:24 +03:00
Hugo Locurcio 635f6cdf2e
Fix the Use Nearest Mipmap Filter project setting not working
The project setting wasn't being used anywhere.

This also tweaks the property hints to denote that these properties
are only effective after a restart.
2021-08-12 01:58:42 +02:00
PouleyKetchoupp f9176a39ce Make radius & height in CapsuleShape3D independent
Also changed CapsuleMesh to make settings consistent between render and
physics.
2021-08-11 14:54:53 -07:00
Max Hilbrunner 4e065a5242 Docs: Fix capitalisation of Warning in two places
These are the only places in the docs that were not cased like this. Now they are!
2021-08-11 22:46:14 +02:00
Yuri Roubinsky 9cf158019d Changed TransformMult node to TransformOp in visual shaders 2021-08-11 22:05:04 +03:00
Max Hilbrunner dd277aedc9 Fix CI after #38992 2021-08-11 19:46:29 +02:00
Rémi Verschelde d7a39cc346
Merge pull request #38992 from Dragoncraft89/master
Error handling functions for GdScript
2021-08-11 18:43:27 +02:00
Rémi Verschelde e30be92ce8
Merge pull request #41634 from KoBeWi/the_independence 2021-08-11 18:16:24 +02:00
Rémi Verschelde 3e2496b72e
Merge pull request #50329 from Calinou/decrease-default-dof-bokeh-quality
Decrease the default depth of field bokeh quality
2021-08-11 17:42:56 +02:00
Rémi Verschelde b7f0fc2a08
Merge pull request #51513 from mhilbrunner/ssl-warning
Docs: Add warnings about no SSL/(D)TLS revocation
2021-08-11 17:37:50 +02:00
Tomasz Chabora f12f5b36b5 Make radius & height in CapsuleShape2D independent 2021-08-11 17:34:27 +02:00
Hugo Locurcio d364ff2087
Decrease the default depth of field bokeh quality
This makes depth of field perform better out of the box, with little
visual difference.
2021-08-11 16:59:22 +02:00
Max Hilbrunner 4eb427afb8 Docs: Add warnings about no SSL/(D)TLS revocation 2021-08-11 16:02:38 +02:00
Rémi Verschelde 62047e4e48
Merge pull request #51486 from reduz/fixes-to-mobile-renderer
Fixes and optimizations to mobile renderer
2021-08-11 15:19:11 +02:00
Rémi Verschelde a57d420224
Merge pull request #51500 from timothyqiu/navmesh-doc 2021-08-11 14:12:56 +02:00
Haoyu Qiu 60298328ca Improve NavigationMesh typing, parameter validation and documentation 2021-08-11 18:18:10 +08:00
Rémi Verschelde c00303ff55
Merge pull request #47378 from aaronfranke/use-input-enums
Use key enum instead of plain integers for input code
2021-08-11 11:20:45 +02:00
Rémi Verschelde 80dec1948a
Merge pull request #41956 from Calinou/rename-engine-iterations-per-second
Rename `iterations_per_second` to `physics_ticks_per_second`
2021-08-11 08:05:33 +02:00
Rémi Verschelde 7d43da928f
Merge pull request #51490 from nekomatata/clean-character-body
Remove infinite inertia and ray shapes from CharacterBody
2021-08-11 08:04:09 +02:00
Rémi Verschelde 2c88e1c15d
Merge pull request #51178 from Geometror/layout-options-textline-textparagraph
Various text layout improvements (TextLine, TextParagraph, Label, TextServer)
2021-08-11 07:51:57 +02:00
Rémi Verschelde 588883eb4a
Merge pull request #51442 from Geometror/styleboxflat-fake-aa-float
StyleBox fake AA improvements (make anti aliasing size a float property)
2021-08-11 07:35:53 +02:00
reduz ca117910da Fixes and optimizations to mobile renderer
* Only apply final actions to attachments used in the last pass.
* Fixes to draw list final action (was using continue instead of read/drop).
* Profiling regions inside draw lists now properly throw errors.
* Ability to enable gpu profile printing from project settings. (used to debug).
2021-08-10 23:17:28 -03:00
Hugo Locurcio 937c1a716c
Rename iterations_per_second to physics_ticks_per_second
This makes it clearer that this property is only about physics FPS,
not rendering FPS.

The `physics_fps` project setting was also renamed to
`physics_ticks_per_second` for consistency.
2021-08-11 02:37:02 +02:00
Hendrik Brucker 403f4902d0 Various text layout improvements (TextLine, TextParagraph, Label, TextServer) 2021-08-11 00:09:48 +02:00
Hendrik Brucker db2460f43c StyleBox fake AA improvements (aa_size float property) 2021-08-10 23:37:06 +02:00
Aaron Franke fa3a32a2d6
Use Key enum instead of plain integers 2021-08-10 16:26:55 -05:00
K. S. Ernest (iFire) Lee 18bd0fee5a
Merge pull request #49343 from theoway/node_auto_arrangement_graph_edit
Node Auto Arrangement in GraphEdit/VisualScript/VisualShader
2021-08-10 15:42:04 -04:00
Umang Kalra 12fc3f1eef Automatic arrangement of nodes in VisualScript/VisualShaders editors
This PR and commit adds the functionality to arrange nodes in VisualScript/VisualShader editor. The layout generated by this 
feature is compact, with minimum crossings between connections
& uniform horizontal & vertical gaps between the nodes. 

This work has been sponsored by GSoC '21.

Full list of additions/changes:
• Added arrange_nodes() method in GraphEdit module.
    • This method computes new positions for all the selected
      nodes by forming blocks and compressing them.
      The nodes are moved to these new positions. 
    • Adding this method to GraphEdit makes it available for 
      use in VisualScript/VisualShaders editors and its other
      subclasses. 
• Button with an icon has been added to call arrange_nodes() in GraphEdit. 
    • This button is inherited by VisualScript/VisualShaders editors
       to invoke the method.
• Undo/redo is functional with this method.
    • By using signals in arrange_nodes(), position changes are registered 
       in undo/redo stack of the subclass that is using the method. 
• Metadata of the method has been updated in ClassDB
• Method description has been added to class reference of GraphEdit
2021-08-11 00:44:28 +05:30