Commit graph

4074 commits

Author SHA1 Message Date
George Marques 0525467fbc
Fix TileSet::CellNeighbor enum binding
Having the TileSet:: prefix has some unintended consequences in the
bindings, in particular in the extension API dump.
2021-07-06 11:07:58 -03:00
Rémi Verschelde d31cf83bb3
Merge pull request #50203 from SirQuartz/docs
Add multiple descriptions to several classes
2021-07-06 14:10:33 +02:00
Nick Huelin 27e9df7778 Add multiple descriptions to several classes
This pull request adds several descriptions to multiple different classes.

This improves the completeness of the documentation and enhances usability by doing so.
2021-07-06 07:40:27 -04:00
reduz 7f6027927a Fix Subsurface Scattering
* Works again
* Transmittance also works again
* Removed the curve patamter, exp() function is good enough.
2021-07-05 17:17:45 -03:00
PouleyKetchoupp ccac36a6e2 Remove unused PhysicsShapeQueryResult3D & PhysicsShapeQueryResult2D 2021-07-05 11:16:11 -07:00
reduz f4379cbc82 Clean up Tree
Fixes some problems introduced by #49917

* Tree used minimum size as a stretch ratio, so it forced a minimum size of 1.
* Minimum size redone, stretch ratio moved to a separate setting
* Fitting to contents was enforced, this is more intuitive, but in many situations this is undesired.
* Added a clip content option for situations where fit to contents does not apply.
* Icon would scroll with the item, making it invislbe if the item is too long.
* Made icon always appear to the right (or left if RTL is enabled) of the visible item space.
2021-07-04 13:13:53 -03:00
Hendrik Brucker 56a8d3f30c Improvements to Label's layout options
- Added options to trim the text in case it overruns
- Added more autowrap modes
- Improved line breaking, which ignores trailing spaces
2021-07-04 16:43:55 +02:00
Hendrik Brucker 3a4a2198ed Fix color properties of particle nodes/material 2021-07-04 02:14:31 +02:00
Josh Chandler 879f84d8f8 add viewport.get_camera_2d()
* there is now a more clear distinction between camera_2d and camera_3d functions in the engine code
* simplified camera2d's exported interface - now everything happens directly with the 'current' variable and make_current and clear_current are no longer exposed- there were some situations where calling one instead of set_current would result in incomplete results
* rebased to current godot master
2021-07-03 15:08:17 -04:00
Rémi Verschelde cb4e42155d
Merge pull request #50054 from reduz/curve-texture-3d
Implement Curve3Texture
2021-07-03 20:32:18 +02:00
reduz d6893cb2e8 Implement Curve3Texture
* This was required by users in some scenarios, such as animating individual axes over time with a single texture.
* Examples: Shaders, Particles, etc.
* CurveTexture now defaults to RGB, can be changed to Red if needed, this allows to freely exchange them.
2021-07-03 12:11:01 -03:00
reduz 6c55d2aad2 Fix Render Info
* Fixed and redone the process to obtain render information from a viewport
* Some stats, such as material changes are too difficult to guess on Vulkan, were removed.
* Separated visible and shadow stats, which causes confusion.
* Texture, buffer and general video memory can be queried now.
* Fixed the performance metrics too.
2021-07-03 10:15:04 -03:00
Rémi Verschelde b9b128cb1d
Merge pull request #50102 from nekomatata/expose-body-test-motion-3d
Expose body_test_motion in 3D physics server
2021-07-03 09:29:46 +02:00
PouleyKetchoupp 62e577267f Expose body_test_motion in 3D physics server
Results are exposed through PhysicsTestMotionResult3D, the same way it's
done for 2D.

Also cleaned a few things in the 2D version.
2021-07-02 18:03:44 -07:00
Rémi Verschelde a8fb450b3c
Merge pull request #50092 from YeldhamDev/window_get_contents_expose
Expose `Window.get_contents_minimum_size()` to scripts
2021-07-02 22:12:11 +02:00
sygi 6f3e7f7cb0 Add mouse_shape_entered and mouse_shape_exited signals to CollisionObject2D.
Co-authored-by: Hugo Locurcio <hugo.locurcio@hugo.pro>
2021-07-02 20:50:27 +01:00
Michael Alexsander a829e88ddc Expose Window.get_contents_minimum_size() to scripts 2021-07-02 15:35:56 -03:00
Hugo Locurcio 5370f4876e
Remove leftovers from the DirectionalLight3D Optimized shadow depth range
The Optimized shadow depth range was removed in late 2020 in favor
of the Stable shadow depth range, but it still had a (broken) property
that allowed to enable it.
2021-07-02 20:32:43 +02:00
Hugo Locurcio 7d4c20f9db
Improve and clarify documentation for RandomNumberGenerator 2021-07-02 17:47:52 +02:00
Nick H c6f28ed62b Add get_dead_zone() method to InputMap
This commit adds a new method to the `InputMap`, allowing the user to get the value of an action's dead zone as a float.
2021-07-02 03:07:37 -04:00
Rémi Verschelde ad8a2b3d52
Merge pull request #50040 from reduz/fix-renderingserver-bindings
Clean up RenderingServer and its bindings
2021-07-01 15:17:33 +02:00
reduz 37776b2867 Clean up RenderingServer and its bindings
* Rewrote bindings for RenderingServer.
* They are now all up to date.
* Several unused methods and deprecated features were cleaned up.
2021-07-01 09:07:36 -03:00
Rémi Verschelde 230a24a49d
Merge pull request #50026 from lyuma/callable_is_valid
Add Callable.is_valid() analogous to FuncRef.is_valid() from 3.x
2021-07-01 12:57:14 +02:00
Lyuma 8f1efa656b Add Callable.is_valid() analogous to FuncRef.is_valid() from 3.x 2021-07-01 02:54:01 -07:00
Eric 525ad7c37e Enable Camera2D smoothing on limit change 2021-06-30 16:21:29 -07:00
Rémi Verschelde 915344fe76
Merge pull request #49834 from nekomatata/physics-disable-modes
Add support for controlling physics nodes' behavior when disabled
2021-06-30 20:36:36 +02:00
Rémi Verschelde 270f9d4c88
Merge pull request #50014 from reduz/remove-immediate
Deprecate ImmediateGeometry
2021-06-30 20:18:59 +02:00
reduz 85cf99f28e Deprecate ImmediateGeometry
* Removed entirely from RenderingServer.
* Replaced by ImmediateMesh resource.
* ImmediateMesh replaces ImmediateGeometry, but could use more optimization in the future.
* Sprite3D and AnimatedSprite3D work again, ported from Godot 3.x (though a lot of work was needed to adapt them to Godot 4).
* RootMotionView works again.
* Polygon3D editor works again.
2021-06-30 14:14:41 -03:00
Rémi Verschelde a02620f3a5
Merge pull request #50009 from reduz/fix-suffixes-and-degrees
Fix editor suffixes and degrees conversion
2021-06-30 18:47:40 +02:00
PouleyKetchoupp 5cbdc7a0ac Add support for controlling physics nodes' behavior when disabled
New property disable_mode to set different behaviors:
Remove: remove from physics simulation
MakeStatic: change body mode to static (doesn't affect area and soft body)
KeepActive: do nothing

Extra change:
Handle disable/enable node state with specific notifications, in order
to differentiate global pause from disabled nodes.
2021-06-30 09:20:44 -07:00
reduz 75688772b3 Fix editor suffixes and degrees conversion
* Functions to convert to/from degrees are all gone. Conversion is done by the editor.
* Use PROPERTY_HINT_ANGLE instead of PROPERTY_HINT_RANGE to edit radian angles in degrees.
* Added possibility to add suffixes to range properties, use "min,max[,step][,suffix:<something>]" example "0,100,1,suffix:m"
* In general, can add suffixes for EditorSpinSlider
Not covered by this PR, will have to be addressed by future ones:

* Ability to switch radians/degrees in the inspector for angle properties (if actually wanted).
* Animations previously made will most likely break, need to add a way to make old ones compatible.
* Only added a "px" suffix to 2D position and a "m" one to 3D position, someone needs to go through the rest of the engine and add all remaining suffixes.
* Likely also need to track down usage of EditorSpinSlider outside properties to add suffixes to it too.
2021-06-30 12:38:25 -03:00
Rémi Verschelde bcd1fc832f
Merge pull request #49901 from nekomatata/move-and-collide-fix-slide
Fix move_and_collide causing sliding on slopes
2021-06-30 02:18:01 +02:00
reduz d07f7c8d25 Fixes to 2D viewport
* Editor 2D viewport now uses embedded subwindows (windows no longer pop up)
* Restored the ability to disable 3D on the 2D viewport (makes 3D not display on 2D when there is a camera on the scene)
2021-06-29 17:40:45 -03:00
Rémi Verschelde 76dc811c76
Merge pull request #49470 from levilindsey/master
Update File.store_var description to mention which properties of an object are included.
2021-06-29 13:59:17 +02:00
Rémi Verschelde 90982d60cb
Merge pull request #37181 from jitspoe/master.button_icon_alignment 2021-06-29 13:31:53 +02:00
Rémi Verschelde dfdde2c598
Merge pull request #49812 from nekomatata/node-path-editor-update
NodePath properly updated in the editor in more cases when nodes are moved or renamed
2021-06-29 12:51:38 +02:00
Rémi Verschelde 36d4314f15
Merge pull request #49921 from SirQuartz/patch-7
Update `Label.clip_text()` Method Description
2021-06-29 12:39:52 +02:00
jitspoe e192eb05db
Add alignment options to icons on buttons.
They can now be centered and right-aligned.

Fixes #11380.
2021-06-29 12:31:40 +02:00
Rémi Verschelde 8fb7a9f023
Merge pull request #49719 from LightningAA/rename-node-is-ancestor-of
Rename `is_a_parent_of()` to `is_ancestor_of()`
2021-06-29 12:07:25 +02:00
Gilles Roudière 30a615dd94 Implement painting properties over TileSets 2021-06-29 11:07:46 +02:00
PouleyKetchoupp 9758a75221 Fix move_and_collide causing sliding on slopes
Make sure the direction of the motion is preserved, unless the depth is
higher than the margin, which means the body needs depenetration in any
direction.

Also changed move_and_slide to avoid sliding on the first motion, in
order to avoid issues with unstable position on ground when jumping.

Co-authored-by: fabriceci <fabricecipolla@gmail.com>
2021-06-28 17:17:52 -07:00
Rémi Verschelde 89f270f4c5
Merge pull request #49917 from groud/tree_disable_scroll
Allow disabling scrolling in Tree and implement horizontal scrolling
2021-06-28 18:41:23 +02:00
PouleyKetchoupp 3e4e530523 NodePath properly updated in the editor in more cases
Fix more cases of node path needing an update when nodes are renamed or
moved in the editor.

Built-in node properties:
Before, node paths were checked only for script export variables. Now
all properties are checked from the node, which includes built-in node
properties.
Allows proper node path updates for nodes like remote transform, physics
joints, etc.

Arrays and dictionaries:
Node paths nested in array and dictionary properties are now also
updated in the editor.

Also update the documentation to be clear about node path update in the
editor and at runtime.

Co-authored-by: latorril <latorril@gmail.com>
2021-06-28 09:28:29 -07:00
Gilles Roudière d7d32ced5b Implement Tree's internal minimum width calculation 2021-06-28 15:54:31 +02:00
Hugo Locurcio f28b55b551
Increase the default ReflectionProbe extents to Vector3(10, 10, 10)
On top of having a more realistic size out of the box, this matches
the default VoxelGI extents for better usability.
2021-06-27 16:46:03 +02:00
Nick H ea94aeac48
Amend Label.clip_text() Method Description
This update fixes an inconsistencies in the documentation about the `clip_text()` method.
2021-06-25 23:33:00 -04:00
reduz b1d15c51bc Implement native extension system
* Deprecates GDNative in favor of a simpler, lower level interface.
* New extension system allows registering core engine classes.
* Simple header interface in gdnative_interace.h
2021-06-25 17:32:45 -03:00
Gilles Roudière b2dddc3c82 Allow disabling scrolling in Tree 2021-06-25 21:19:46 +02:00
kobewi 452e10ba7b Remove clips_input() method and use clip_content 2021-06-25 15:46:37 +02:00
Rémi Verschelde e4430771db
Merge pull request #49885 from reduz/implement-render-pass-support
Implement Framebuffer Subpass support
2021-06-25 15:00:01 +02:00
reduz bde6f5eed1 Implement Framebuffer Subpass support
* Required for better optimizing mobile platforms
* Will be used by the Vulkan mobile renderer.
2021-06-24 15:59:15 -03:00
kobewi 678827bebc Correct the description of Tween.custom_step 2021-06-24 16:01:12 +02:00
Hugo Locurcio b4ed84ba2b
Allow a top and bottom radius equal to 0 in CylinderMesh
The CylinderMesh generation code handles this special case and
avoids generating the top and bottom faces if their radius is equal
to 0. This improves performance by reducing the number of vertices
to draw.

If both values are set to 0, nothing will be visible but the mesh
generation will still succeed.

This also improves the CylinderMesh class documentation.
2021-06-23 18:50:10 +02:00
Lightning_A 899e5f8685 Rename is_a_parent_of() to is_ancestor_of() 2021-06-21 08:39:28 -06:00
Paulb23 1a0cfc219b Move indent management to CodeEdit 2021-06-20 20:00:54 +01:00
Rémi Verschelde 953de68cfc
Merge pull request #35608 from golfinq/master 2021-06-20 18:51:15 +02:00
Aaron Franke 0ce49800ac
Use mouse and joypad enums instead of plain integers
Also MIDIMessage
2021-06-20 11:54:24 -04:00
golfinq 0c1d10d1ca Rich Text Label now allows for foreground colors and background colors 2021-06-20 11:29:37 -04:00
Hugo Locurcio e3ef50db38
Improve descriptions for ProjectSettings' disable_stdout/disable_stderr 2021-06-20 16:44:58 +02:00
Rémi Verschelde cca29b78b9
Merge pull request #48359 from Calinou/add-engine-print-error-property 2021-06-20 13:22:08 +02:00
Lightning_A e28fd07b2b Rename instance()->instantiate() when it's a verb 2021-06-19 20:49:18 -06:00
Rémi Verschelde 9c182b0f45
Merge pull request #41794 from KoBeWi/shiny_new_tweens 2021-06-20 00:35:28 +02:00
Rémi Verschelde 4effadc0ba
Merge pull request #48696 from madmiraal/fix-48692
Fix `InputMap.action_erase_event()` failing to erase events correctly.
2021-06-20 00:29:42 +02:00
Rémi Verschelde d88be9b70c
Merge pull request #44806 from madmiraal/consolidate_json
Consolidate JSON, JSONParseResults and JSONParser into JSON
2021-06-19 21:45:34 +02:00
Tomasz Chabora 900b2e0fdc Complete rewrite of Tweens
* Tweens were changed from Node to RefCounted. New API is inspired by DOTween.
* Tweens are created and managed by SceneTree, similar to SceneTreeTimer, which makes them ultra cheap to use a lot.
* Animating with Tweens is done by creating sequences of Tweeners. You create them from code and they autostart by default (fire-and-forget).
* There are 4 Tweeners that cover the former Tween functionality: PropertyTweener, IntervalTweener, CallbackTweener and MethodTweener.
* The methods were simplified a lot. Long argument lists are replaced with chained calls on Tweens and Tweeners.
* Tweeners by default execute in sequence, so it's easy to create complex chained animations.
* You can bind a Tween to a node. Tween will be removed automatically when the bound node is freed.
2021-06-19 12:08:50 +02:00
Marcel Admiraal 2bafcd3422 Consolidate JSON, JSONParseResults and JSONParser into JSON
Renames JSON.parse_string() to parse()
Renames JSON.decode_data() to stringify()
2021-06-19 08:01:40 +01:00
Hugo Locurcio aa0976f47c
Expose OS data directory getter methods
This can be used by editor plugins and non-game applications to
store data in the correct directories according to the
XDG Base Directory specification.
2021-06-19 08:56:20 +02:00
PouleyKetchoupp 2bf145fa5d Make LineShape2D normal point upwards by default
Allows line shapes to collide with objects falling from the top by
default, which makes more sense for the most common cases.
2021-06-18 09:14:06 -07:00
Rémi Verschelde 92f20fd70e
Merge pull request #49659 from LightningAA/string-valid-integer-to-int 2021-06-18 16:14:14 +02:00
Rémi Verschelde 7aebb8f81c
Merge pull request #44156 from aaronfranke/quat-angle-to
Add Quaternion angle_to method
2021-06-18 12:35:58 +02:00
Rémi Verschelde 3fc39954ec
Merge pull request #49638 from aaronfranke/multiply-transforms
Allow multiplying Transforms and Basis by numbers
2021-06-18 12:35:14 +02:00
Rémi Verschelde 3e8620c275
Merge pull request #49475 from nekomatata/kinematic-collision-rid
Expose collider RID in 2D/3D kinematic collision
2021-06-18 12:32:26 +02:00
Aaron Franke 93b494d4ae
Add Quaternion angle_to method 2021-06-17 23:57:00 -04:00
Michael Alexsander Silva Dias 0ff4095b36 Better format arguments in variant parser 2021-06-18 00:06:40 -03:00
reduz 94d31ac327 Implement animation slice drawing in CanvasItem
* Added a function to ignore subsequent commands if they don't fall within the slice.
* This will be used by the new TileMap to properly provide animated tiles.
2021-06-17 12:42:27 -03:00
Rémi Verschelde 085e1d3c03
Merge pull request #49670 from reduz/rename-visibility-notifiers
Rename VisibilityNotifier2D/3D to VisibleOnScreenNotifier2D/3D
2021-06-17 15:14:44 +02:00
Rémi Verschelde 74850b3511
Merge pull request #38261 from pycbouh/adjust-graph-edit-zoom-levels
Make zoom limits and step adjustable in `GraphEdit`
2021-06-17 12:12:34 +02:00
reduz ab2456b740 Rename VisibilityNotifierXD to VisibleOnScreenNotifierXD
* Renames for 2D and 3D
* Class name was confusing, given both 2D and 3D have a "visible" property that is unrelated to actual on-screen visibility.
* New name makes it clear that this is about visibility on screen.
2021-06-16 22:01:39 -03:00
Rémi Verschelde bb4c464fec
Merge pull request #49258 from megalobyte/editor-fix
Fixes for documentation search
2021-06-17 02:25:41 +02:00
reduz 6e98c4cd50 Refactor VisibilityNotifier3D
* This is the 3D counterpart to #49632
* Implemented a bit different as 3D works using instancing

After merged, both 2D and 3D classes will most likely be renamed in a separate PR to DisplayNotifier2D/3D.
2021-06-16 18:50:39 -03:00
Rémi Verschelde 341cb8da31
Merge pull request #49238 from Paulb23/code_edit_code_folding
Move code folding into CodeEdit and hide line hiding API
2021-06-16 20:11:39 +02:00
Gregory Basile 8ab13f8ace Documentation search fixes
Updates rich_text_label so that the built-in documentation can be searched
Previously, it would only find the first result and would not select other results
Renames "_entered" functions to "_submitted"
2021-06-16 09:43:34 -07:00
Lightning_A b6af2a29eb Rename is_valid_integer() to is_valid_int()
Method from `String`
2021-06-16 10:32:22 -06:00
Rémi Verschelde 48fe9c9794
Merge pull request #49657 from timothyqiu/postion
Fix typo in CodeEdit methods
2021-06-16 17:27:40 +02:00
Haoyu Qiu bf5f13e6a0 Fix typo in CodeEdit methods 2021-06-16 22:15:29 +08:00
reduz 38d164c74b Refactor VisibilityNotifier
* Works from RenderinServer
* Accurately tells when on or off-scren, its no longer approximate.
* VisibilityEnabler also simplified to use the process mode instead.
2021-06-16 10:48:57 -03:00
Yuri Sizov 0a82a669e3 Make zoom limits and step adjustable in GraphEdit 2021-06-16 16:39:18 +03:00
Levi Lindsey 2b7c0cfb34 Update File.store_var description to mention which properties of an object are included. 2021-06-15 20:00:19 -07:00
Aaron Franke bd6ed3fb09
Allow multiplying Transforms and Basis by numbers 2021-06-15 22:26:29 -04:00
Rémi Verschelde b574d29ed2
Merge pull request #48681 from Calinou/doc-audioeffectpitchshift
Complete documentation for the AudioEffectPitchShift class
2021-06-15 18:25:07 +02:00
Rémi Verschelde c2ba60f31a
Merge pull request #48682 from Calinou/doc-audio-generation
Improve AudioStreamGenerator and AudioEffectSpectrumAnalyzer documentation
2021-06-15 16:55:14 +02:00
Rémi Verschelde b5da5543db
Merge pull request #49292 from KoBeWi/you_changed,_animation
Clarify animation_changed signal
2021-06-15 15:34:51 +02:00
Rémi Verschelde 529bf43134
Merge pull request #49432 from Calinou/tweak-physics-fps-property-hint
Tweak the physics FPS property hint to only allow reasonable values
2021-06-15 15:19:24 +02:00
Rémi Verschelde aa43b5a3f4
Merge pull request #48287 from aaronfranke/camera-is-frustum 2021-06-14 19:05:43 +02:00
Rémi Verschelde 07b8fffa7c
Merge pull request #49458 from JFonS/fix_unwrap_xform
Rename get_parent_spatial() to get_parent_node_3d()
2021-06-14 18:32:33 +02:00
Aaron Franke bd40474bd6
Add is_position_in_frustum to Camera3D 2021-06-14 12:03:18 -04:00
jfons ee702334a1 Rename get_parent_spatial() to get_parent_node3d()
Renames get_parent_spatial() to get_parent_node3d() and changes its
implementation. Before it was not returning a correct pointer if the
node wasn't added to a SceneTree. Now it uses the same implementation as
CanvasItem, which will be correct even for nodes outside a SceneTree.
2021-06-14 14:05:13 +02:00
jfons 3a53ae5d9f Implement visibility range and dependencies.
This commit adds the following properties to GeometryInstance3D: `visibility_range_begin`,
`visibility_range_begin_margin`, `visibility_range_end`, `visibility_range_end_margin`.

Together they define a range in which the GeometryInstance3D will be visible from the camera,
taking hysteresis into account for state changes. A begin or end value of 0 will be ignored,
so the visibility range can be open-ended in both directions.

This commit also adds the `visibility_parent` property to 'Node3D'.
Which defines the visibility parents of the node and its subtree (until
another parent is defined).

Visual instances with a visibility parent will only be visible when the parent, and all of its
ancestors recursively, are hidden because they are closer to the camera than their respective
`visibility_range_begin` thresholds.

Combining visibility ranges and visibility parents users can set-up a quick HLOD system
that shows high detail meshes when close (i.e buildings, trees) and merged low detail meshes
for far away groups (i.e. cities, woods).
2021-06-14 12:17:11 +02:00
Rémi Verschelde 4ebf248e1b
Merge pull request #48207 from BastiaanOlij/multiview_stereoscopic
Add stereoscopic rendering through multiview
2021-06-13 15:36:55 +02:00
Bastiaan Olij 15c1a76361 Add stereoscopic rendering through multiview 2021-06-13 22:52:20 +10:00