diff options
129 files changed, 422 insertions, 314 deletions
diff --git a/AUTHORS.md b/AUTHORS.md index 13a67ce3f5..2f109aff6e 100644 --- a/AUTHORS.md +++ b/AUTHORS.md @@ -73,7 +73,7 @@ name is available. J08nY Jakub Grzesik (kubecz3k) Jérôme GULLY (Nutriz) - JFonS + Joan Fons Sanchez (JFonS) Johan Manuel (29jm) Joshua Grams (JoshuaGrams) Juan Linietsky (reduz) diff --git a/CHANGELOG.md b/CHANGELOG.md index 533968886e..6a0310f904 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -47,7 +47,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/). - Setters and getters for node properties. - Underscores in number literals are now allowed for improved readability (for example,`1_000_000`). - Improved performance (+20% to +40%, based on various benchmarks). -- [Feature tags](http://docs.godotengine.org/en/latest/learning/workflow/export/feature_tags.html) in the Project Settings, for custom per-platform settings. +- [Feature tags](http://docs.godotengine.org/en/latest/getting_started/workflow/export/feature_tags.html) in the Project Settings, for custom per-platform settings. - Full support for the [glTF 2.0](https://www.khronos.org/gltf/) 3D interchange format. - Freelook and fly navigation to the 3D editor. - Built-in editor logging (logging standard output to a file), disabled by default. diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 2ea2ed6bba..a8e4650710 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -71,7 +71,7 @@ discuss the implementation in the bug report first if you are not 100% about what would be the best fix. In addition to the following tips, also take a look at the -[Engine development guide](http://docs.godotengine.org/en/latest/development/cpp/) +[Engine development guide](https://docs.godotengine.org/en/latest/development/cpp/) for an introduction to developing on Godot. #### Be nice to the git history @@ -13,30 +13,29 @@ generous deed immortalized in the next stable release of Godot Engine. ## Platinum sponsors Enjin Coin <https://enjincoin.io> - GameDev.TV <https://gdev.tv/godot> ## Gold sponsors Gamblify <https://www.gamblify.com> + GameDev.TV <https://gdev.tv/godot> + Image Campus <https://www.imagecampus.edu.ar> ## Mini sponsors Andrew Dunai Brandon Lamb Christian Uldall Pedersen - Christopher Igoe Christoph Woinke + David Graham GameDev.net Hein-Pieter van Braam iDev.Network Studios Jamal Alyafei - Jay Sistar Leona Eden Matthieu Huvé Mike King Nathan Warden Neal Gompa (Conan Kudo) - Pascal Julien Patrick Aarstad Ruslan Mustakov Slobodan Milnovic @@ -67,7 +66,6 @@ generous deed immortalized in the next stable release of Godot Engine. Gary Oberbrunner Jay Horton Johannes Wuensch - Josep G. Camarasa Joshua Lesperance Krzysztof Dluzniewski Kyle Szklenski @@ -77,7 +75,7 @@ generous deed immortalized in the next stable release of Godot Engine. Ranoller Sergey Svenne Krap - Timothy Hagberg + Xananax BanjoNode2D Beliar @@ -92,6 +90,7 @@ generous deed immortalized in the next stable release of Godot Engine. Justo Delgado Baudí KTL Laurence Bannister + Markus Wiesner paul gruenbacher Rami Robert Willes @@ -106,7 +105,6 @@ generous deed immortalized in the next stable release of Godot Engine. Alessandra Pereyra Alexey Dyadchenko Amanda Haldy - Branwen Danielle Zakariasen Chau Siu Hung Chris Brown Chris Petrich @@ -130,9 +128,8 @@ generous deed immortalized in the next stable release of Godot Engine. joe513 Juraj Móza Justin Arnold - Lars Wuethrich Leandro Voltolino - Markus Wiesner + Marius Kamm Marvin Nahuel Sacchetti Nick Nikitin @@ -140,8 +137,6 @@ generous deed immortalized in the next stable release of Godot Engine. Pete Goodwin ray-tracer Ruben Soares Luis - Rufus Xavier Sarsaparilla - Sindre Sømme Sofox Stoned Xander Trent McPheron @@ -167,7 +162,6 @@ generous deed immortalized in the next stable release of Godot Engine. Bailey Bastian Böhm Benedikt - Benjamin Beshara Ben Vercammen Blair Allen Brandon @@ -178,7 +172,6 @@ generous deed immortalized in the next stable release of Godot Engine. Chris Chapin Christian Baune Christian Winter - Christopher Schmitt Collin Shooltz Daniel Johnson Daniel Kaplan @@ -192,11 +185,13 @@ generous deed immortalized in the next stable release of Godot Engine. Edward Herbert Elias Nykrem Eric Martini + Eric Williams Eugenio Hugo Salgüero Jáñez Fabian Becker fengjiongmax Foomf G3Dev sàrl + George Lesica Gerrit Großkopf Gilberto K. Otubo Greg Olson @@ -206,6 +201,7 @@ generous deed immortalized in the next stable release of Godot Engine. ialex32x Jahn Johansen Jaime Ruiz-Borau Vizárraga + Jako Danar Jeff Hungerford Joel Fivat Johan Lindberg @@ -213,9 +209,9 @@ generous deed immortalized in the next stable release of Godot Engine. Jonas Yamazaki Jonathan Martin Jonathan Nieto - Jonathon Jon Bonazza Jon Sully + Jose Malheiro Josh 'Cheeseness' Bush Juanfran Juan Negrier @@ -227,14 +223,16 @@ generous deed immortalized in the next stable release of Godot Engine. Kevin Kamper Meejach Petersen Klavdij Voncina Krzysztof Jankowski + Krzysztof Sierszecki + KsyTek Games Linus Lind Lundgren Loreshaper Games - Luc Magitem Luis Moraes Macil magodev - Manolis Makris + Malcolm Martin Eigel + Matt Welke Max R.R. Collada Maxwell Mertcan Mermerkaya @@ -245,17 +243,18 @@ generous deed immortalized in the next stable release of Godot Engine. Mikael Olsson MoM Moritz Laass + Moritz Weissenberger Natrim nee Neil Blakey-Milner Nick Pavlica Niclas Eriksen + Nicolás Montaña Nicolas SAN AGUSTIN - Niko Leopold + Nik Noi Sek Pan Ip Pascal Grüter - Pat LaBine Patrick Nafarrete Paul E Hansen Paul Gieske @@ -273,10 +272,7 @@ generous deed immortalized in the next stable release of Godot Engine. Roman Tinkov Sasori Olkof Sootstone - Stefan Butucea - The K-B Theo Cranmore - Thibaud Galloy Thibault Barbaroux Thomas Bell Thomas Holmes @@ -284,18 +280,15 @@ generous deed immortalized in the next stable release of Godot Engine. tiansheng li Tim Tom Larrow - Tristan Crawford - Tryggve Sollid Trym Nilsen + Tyggve Sollid Tyler Stafos UltyX Vaiktorg Victor Viktor Ferenczi waka nya - werner mendizabal Wout Standaert - Yu He ## Bronze donors @@ -37,7 +37,7 @@ Official binaries for the Godot editor and the export templates can be found #### Compiling from source -[See the official docs](http://docs.godotengine.org/en/latest/development/compiling/) +[See the official docs](https://docs.godotengine.org/en/latest/development/compiling/) for compilation instructions for every supported platform. ### Community and contributing @@ -53,10 +53,10 @@ To get started contributing to the project, see the [contributing guide](CONTRIB ### Documentation and demos -The official documentation is hosted on [ReadTheDocs](http://docs.godotengine.org). +The official documentation is hosted on [ReadTheDocs](https://docs.godotengine.org). It is maintained by the Godot community in its own [GitHub repository](https://github.com/godotengine/godot-docs). -The [class reference](http://docs.godotengine.org/en/latest/classes/) +The [class reference](https://docs.godotengine.org/en/latest/classes/) is also accessible from within the engine. The official demos are maintained in their own [GitHub repository](https://github.com/godotengine/godot-demo-projects) diff --git a/doc/classes/AABB.xml b/doc/classes/AABB.xml index b9061e0b87..2e0d0c15b2 100644 --- a/doc/classes/AABB.xml +++ b/doc/classes/AABB.xml @@ -7,7 +7,7 @@ AABB consists of a position, a size, and several utility functions. It is typically used for fast overlap tests. </description> <tutorials> - <link>http://docs.godotengine.org/en/3.0/tutorials/math/index.html</link> + <link>https://docs.godotengine.org/en/latest/tutorials/math/index.html</link> </tutorials> <demos> </demos> diff --git a/doc/classes/Animation.xml b/doc/classes/Animation.xml index bb161cd87c..f189e6451d 100644 --- a/doc/classes/Animation.xml +++ b/doc/classes/Animation.xml @@ -17,7 +17,7 @@ Animations are just data containers, and must be added to nodes such as an [AnimationPlayer] or [AnimationTreePlayer] to be played back. </description> <tutorials> - <link>http://docs.godotengine.org/en/3.0/tutorials/animation/index.html</link> + <link>https://docs.godotengine.org/en/latest/tutorials/animation/index.html</link> </tutorials> <demos> </demos> diff --git a/doc/classes/AnimationPlayer.xml b/doc/classes/AnimationPlayer.xml index a5be8ffc53..3b3638a4f3 100644 --- a/doc/classes/AnimationPlayer.xml +++ b/doc/classes/AnimationPlayer.xml @@ -7,8 +7,8 @@ An animation player is used for general purpose playback of [Animation] resources. It contains a dictionary of animations (referenced by name) and custom blend times between their transitions. Additionally, animations can be played and blended in different channels. </description> <tutorials> - <link>http://docs.godotengine.org/en/3.0/getting_started/step_by_step/animations.html</link> - <link>http://docs.godotengine.org/en/3.0/tutorials/animation/index.html</link> + <link>https://docs.godotengine.org/en/latest/getting_started/step_by_step/animations.html</link> + <link>https://docs.godotengine.org/en/latest/tutorials/animation/index.html</link> </tutorials> <demos> </demos> diff --git a/doc/classes/AudioServer.xml b/doc/classes/AudioServer.xml index 8f654441b2..3ae5454e65 100644 --- a/doc/classes/AudioServer.xml +++ b/doc/classes/AudioServer.xml @@ -7,7 +7,7 @@ AudioServer is a low level server interface for audio access. It is in charge of creating sample data (playable audio) as well as its playback via a voice interface. </description> <tutorials> - <link>http://docs.godotengine.org/en/3.0/tutorials/audio/audio_buses.html</link> + <link>https://docs.godotengine.org/en/latest/tutorials/audio/audio_buses.html</link> </tutorials> <demos> </demos> diff --git a/doc/classes/AudioStream.xml b/doc/classes/AudioStream.xml index 753a506058..96ce53b14f 100644 --- a/doc/classes/AudioStream.xml +++ b/doc/classes/AudioStream.xml @@ -7,7 +7,7 @@ Base class for audio streams. Audio streams are used for music playback, or other types of streamed sounds that don't fit or require more flexibility than a [Sample]. </description> <tutorials> - <link>http://docs.godotengine.org/en/3.0/tutorials/audio/audio_streams.html</link> + <link>https://docs.godotengine.org/en/latest/tutorials/audio/audio_streams.html</link> </tutorials> <demos> </demos> diff --git a/doc/classes/AudioStreamPlayer.xml b/doc/classes/AudioStreamPlayer.xml index 26d0b1a83d..be4e4f137a 100644 --- a/doc/classes/AudioStreamPlayer.xml +++ b/doc/classes/AudioStreamPlayer.xml @@ -7,8 +7,8 @@ Plays background audio. </description> <tutorials> - <link>http://docs.godotengine.org/en/latest/learning/features/audio/index.html</link> - <link>http://docs.godotengine.org/en/3.0/tutorials/audio/audio_streams.html</link> + <link>https://docs.godotengine.org/en/latest/learning/features/audio/index.html</link> + <link>https://docs.godotengine.org/en/latest/tutorials/audio/audio_streams.html</link> </tutorials> <demos> </demos> diff --git a/doc/classes/AudioStreamPlayer2D.xml b/doc/classes/AudioStreamPlayer2D.xml index 5cc87e0e7a..3b81894c14 100644 --- a/doc/classes/AudioStreamPlayer2D.xml +++ b/doc/classes/AudioStreamPlayer2D.xml @@ -7,8 +7,8 @@ Plays audio that dampens with distance from screen center. </description> <tutorials> - <link>http://docs.godotengine.org/en/latest/learning/features/audio/index.html</link> - <link>http://docs.godotengine.org/en/3.0/tutorials/audio/audio_streams.html</link> + <link>https://docs.godotengine.org/en/latest/learning/features/audio/index.html</link> + <link>https://docs.godotengine.org/en/latest/tutorials/audio/audio_streams.html</link> </tutorials> <demos> </demos> diff --git a/doc/classes/AudioStreamPlayer3D.xml b/doc/classes/AudioStreamPlayer3D.xml index e61515ffc0..5841f1f6dc 100644 --- a/doc/classes/AudioStreamPlayer3D.xml +++ b/doc/classes/AudioStreamPlayer3D.xml @@ -7,8 +7,8 @@ Plays a sound effect with directed sound effects, dampens with distance if needed, generates effect of hearable position in space. </description> <tutorials> - <link>http://docs.godotengine.org/en/latest/learning/features/audio/index.html</link> - <link>http://docs.godotengine.org/en/3.0/tutorials/audio/audio_streams.html</link> + <link>https://docs.godotengine.org/en/latest/learning/features/audio/index.html</link> + <link>https://docs.godotengine.org/en/latest/tutorials/audio/audio_streams.html</link> </tutorials> <demos> </demos> diff --git a/doc/classes/BakedLightmap.xml b/doc/classes/BakedLightmap.xml index 966b6dd7c4..8e27dc8d5d 100644 --- a/doc/classes/BakedLightmap.xml +++ b/doc/classes/BakedLightmap.xml @@ -7,7 +7,7 @@ Baked lightmaps are an alternative workflow for adding indirect (or baked) lighting to a scene. Unlike the [GIProbe] approach, baked lightmaps work fine on low-end PCs and mobile devices as they consume almost no resources in run-time. </description> <tutorials> - <link>http://docs.godotengine.org/en/3.0/tutorials/3d/baked_lightmaps.html</link> + <link>https://docs.godotengine.org/en/latest/tutorials/3d/baked_lightmaps.html</link> </tutorials> <demos> </demos> diff --git a/doc/classes/Basis.xml b/doc/classes/Basis.xml index fe8debe1a9..95f6346321 100644 --- a/doc/classes/Basis.xml +++ b/doc/classes/Basis.xml @@ -8,8 +8,8 @@ For such use, it is composed of a scaling and a rotation matrix, in that order (M = R.S). </description> <tutorials> - <link>http://docs.godotengine.org/en/latest/tutorials/3d/using_transforms.html</link> - <link>http://docs.godotengine.org/en/latest/tutorials/math/rotations.html</link> + <link>https://docs.godotengine.org/en/latest/tutorials/3d/using_transforms.html</link> + <link>https://docs.godotengine.org/en/latest/tutorials/math/rotations.html</link> </tutorials> <demos> </demos> diff --git a/doc/classes/CanvasItem.xml b/doc/classes/CanvasItem.xml index 60f097f3f9..4bae656740 100644 --- a/doc/classes/CanvasItem.xml +++ b/doc/classes/CanvasItem.xml @@ -11,8 +11,8 @@ Ultimately, a transform notification can be requested, which will notify the node that its global position changed in case the parent tree changed. </description> <tutorials> - <link>http://docs.godotengine.org/en/3.0/tutorials/2d/2d_transforms.html</link> - <link>http://docs.godotengine.org/en/3.0/tutorials/2d/custom_drawing_in_2d.html</link> + <link>https://docs.godotengine.org/en/latest/tutorials/2d/2d_transforms.html</link> + <link>https://docs.godotengine.org/en/latest/tutorials/2d/custom_drawing_in_2d.html</link> </tutorials> <demos> </demos> diff --git a/doc/classes/CanvasLayer.xml b/doc/classes/CanvasLayer.xml index d4412e15c9..c39b47ab07 100644 --- a/doc/classes/CanvasLayer.xml +++ b/doc/classes/CanvasLayer.xml @@ -7,8 +7,8 @@ Canvas drawing layer. [CanvasItem] nodes that are direct or indirect children of a [code]CanvasLayer[/code] will be drawn in that layer. The layer is a numeric index that defines the draw order. The default 2D scene renders with index 0, so a [code]CanvasLayer[/code] with index -1 will be drawn below, and one with index 1 will be drawn above. This is very useful for HUDs (in layer 1+ or above), or backgrounds (in layer -1 or below). </description> <tutorials> - <link>http://docs.godotengine.org/en/3.0/tutorials/2d/2d_transforms.html</link> - <link>http://docs.godotengine.org/en/3.0/tutorials/2d/canvas_layers.html</link> + <link>https://docs.godotengine.org/en/latest/tutorials/2d/2d_transforms.html</link> + <link>https://docs.godotengine.org/en/latest/tutorials/2d/canvas_layers.html</link> </tutorials> <demos> </demos> diff --git a/doc/classes/CollisionShape.xml b/doc/classes/CollisionShape.xml index 5639c14192..740a6b7ab1 100644 --- a/doc/classes/CollisionShape.xml +++ b/doc/classes/CollisionShape.xml @@ -7,7 +7,7 @@ Editor facility for creating and editing collision shapes in 3D space. You can use this node to represent all sorts of collision shapes, for example, add this to an [Area] to give it a detection shape, or add it to a [PhysicsBody] to create a solid object. [b]IMPORTANT[/b]: this is an Editor-only helper to create shapes, use [method CollisionObject.shape_owner_get_shape] to get the actual shape. </description> <tutorials> - <link>http://docs.godotengine.org/en/3.0/tutorials/physics/physics_introduction.html</link> + <link>https://docs.godotengine.org/en/latest/tutorials/physics/physics_introduction.html</link> </tutorials> <demos> </demos> diff --git a/doc/classes/CollisionShape2D.xml b/doc/classes/CollisionShape2D.xml index 713cb8d098..d3c616ee3d 100644 --- a/doc/classes/CollisionShape2D.xml +++ b/doc/classes/CollisionShape2D.xml @@ -7,7 +7,7 @@ Editor facility for creating and editing collision shapes in 2D space. You can use this node to represent all sorts of collision shapes, for example, add this to an [Area2D] to give it a detection shape, or add it to a [PhysicsBody2D] to create a solid object. [b]IMPORTANT[/b]: this is an Editor-only helper to create shapes, use [method CollisionObject2D.shape_owner_get_shape] to get the actual shape. </description> <tutorials> - <link>http://docs.godotengine.org/en/3.0/tutorials/physics/physics_introduction.html</link> + <link>https://docs.godotengine.org/en/latest/tutorials/physics/physics_introduction.html</link> </tutorials> <demos> </demos> diff --git a/doc/classes/Control.xml b/doc/classes/Control.xml index ee82afd592..76a475e49d 100644 --- a/doc/classes/Control.xml +++ b/doc/classes/Control.xml @@ -13,8 +13,8 @@ [Theme] resources change the Control's appearance. If you change the [Theme] on a [code]Control[/code] node, it affects all of its children. To override some of the theme's parameters, call one of the [code]add_*_override[/code] methods, like [method add_font_override]. You can override the theme with the inspector. </description> <tutorials> - <link>http://docs.godotengine.org/en/3.0/tutorials/gui/index.html</link> - <link>http://docs.godotengine.org/en/3.0/tutorials/2d/custom_drawing_in_2d.html</link> + <link>https://docs.godotengine.org/en/latest/tutorials/gui/index.html</link> + <link>https://docs.godotengine.org/en/latest/tutorials/2d/custom_drawing_in_2d.html</link> </tutorials> <demos> </demos> diff --git a/doc/classes/DirectionalLight.xml b/doc/classes/DirectionalLight.xml index 2dc522083d..86c8f2f03a 100644 --- a/doc/classes/DirectionalLight.xml +++ b/doc/classes/DirectionalLight.xml @@ -7,7 +7,7 @@ A directional light is a type of [Light] node that models an infinite number of parallel rays covering the entire scene. It is used for lights with strong intensity that are located far away from the scene to model sunlight or moonlight. The worldspace location of the DirectionalLight transform (origin) is ignored. Only the basis is used do determine light direction. </description> <tutorials> - <link>http://docs.godotengine.org/en/3.0/tutorials/3d/lights_and_shadows.html</link> + <link>https://docs.godotengine.org/en/latest/tutorials/3d/lights_and_shadows.html</link> </tutorials> <demos> </demos> diff --git a/doc/classes/Directory.xml b/doc/classes/Directory.xml index d8ad208fa7..57301f954f 100644 --- a/doc/classes/Directory.xml +++ b/doc/classes/Directory.xml @@ -23,7 +23,7 @@ [/codeblock] </description> <tutorials> - <link>http://docs.godotengine.org/en/3.0/getting_started/step_by_step/filesystem.html</link> + <link>https://docs.godotengine.org/en/latest/getting_started/step_by_step/filesystem.html</link> </tutorials> <demos> </demos> diff --git a/doc/classes/EditorImportPlugin.xml b/doc/classes/EditorImportPlugin.xml index aaba30ccc9..24201c39b9 100644 --- a/doc/classes/EditorImportPlugin.xml +++ b/doc/classes/EditorImportPlugin.xml @@ -49,7 +49,7 @@ [/codeblock] </description> <tutorials> - <link>http://docs.godotengine.org/en/3.0/tutorials/plugins/editor/import_plugins.html</link> + <link>https://docs.godotengine.org/en/latest/tutorials/plugins/editor/import_plugins.html</link> </tutorials> <demos> </demos> diff --git a/doc/classes/EditorPlugin.xml b/doc/classes/EditorPlugin.xml index 0792d556d7..feaa24b0ab 100644 --- a/doc/classes/EditorPlugin.xml +++ b/doc/classes/EditorPlugin.xml @@ -7,7 +7,7 @@ Plugins are used by the editor to extend functionality. The most common types of plugins are those which edit a given node or resource type, import plugins and export plugins. Also see [EditorScript] to add functions to the editor. </description> <tutorials> - <link>http://docs.godotengine.org/en/3.0/development/plugins/index.html</link> + <link>https://docs.godotengine.org/en/latest/development/plugins/index.html</link> </tutorials> <demos> </demos> diff --git a/doc/classes/EditorScenePostImport.xml b/doc/classes/EditorScenePostImport.xml index 76c105dd25..0c5de68d98 100644 --- a/doc/classes/EditorScenePostImport.xml +++ b/doc/classes/EditorScenePostImport.xml @@ -26,7 +26,7 @@ [/codeblock] </description> <tutorials> - <link>http://docs.godotengine.org/en/latest/getting_started/workflow/assets/importing_scenes.html#custom-script</link> + <link>https://docs.godotengine.org/en/latest/getting_started/workflow/assets/importing_scenes.html#custom-script</link> </tutorials> <demos> </demos> diff --git a/doc/classes/Environment.xml b/doc/classes/Environment.xml index 566322e6c5..4c2c83e55f 100644 --- a/doc/classes/Environment.xml +++ b/doc/classes/Environment.xml @@ -13,8 +13,8 @@ - Adjustments </description> <tutorials> - <link>http://docs.godotengine.org/en/3.0/tutorials/3d/environment_and_post_processing.html</link> - <link>http://docs.godotengine.org/en/3.0/tutorials/3d/high_dynamic_range.html</link> + <link>https://docs.godotengine.org/en/latest/tutorials/3d/environment_and_post_processing.html</link> + <link>https://docs.godotengine.org/en/latest/tutorials/3d/high_dynamic_range.html</link> </tutorials> <demos> </demos> diff --git a/doc/classes/Expression.xml b/doc/classes/Expression.xml index d5b831a61a..c5f71fe55e 100644 --- a/doc/classes/Expression.xml +++ b/doc/classes/Expression.xml @@ -1,8 +1,27 @@ <?xml version="1.0" encoding="UTF-8" ?> <class name="Expression" inherits="Reference" category="Core" version="3.1"> <brief_description> + A class that stores an expression you can execute. </brief_description> <description> + An expression can be made of any arithmetic operation, built-in math function call, method call of a passed instance, or built-in type construction call. + An example expression text using the built-in math functions could be [code]sqrt(pow(3,2) + pow(4,2))[/code]. + In the following example we use a [LineEdit] node to write our expression and show the result. + [codeblock] + onready var expression = Expression.new() + + func _ready(): + $LineEdit.connect("text_entered", self, "_on_text_entered") + + func _on_text_entered(command): + var error = expression.parse(command, []) + if error != OK: + print(get_error_text()) + return + var result = expression.execute([], null, true) + if not expression.has_execute_failed(): + $LineEdit.text = str(result) + [/codeblock] </description> <tutorials> </tutorials> @@ -19,18 +38,21 @@ <argument index="2" name="show_error" type="bool" default="true"> </argument> <description> + Executes the expression that was previously parsed by [method parse] and returns the result. Before you use the returned object, you should check if the method failed by calling [method has_execute_failed]. </description> </method> <method name="get_error_text" qualifiers="const"> <return type="String"> </return> <description> + Returns the error text if [method parse] has failed. </description> </method> <method name="has_execute_failed" qualifiers="const"> <return type="bool"> </return> <description> + Returns [code]true[/code] if [method execute] has failed. </description> </method> <method name="parse"> @@ -41,6 +63,7 @@ <argument index="1" name="input_names" type="PoolStringArray" default="PoolStringArray( )"> </argument> <description> + Parses the expression and returns a [enum @GlobalScope.Error]. </description> </method> </methods> diff --git a/doc/classes/File.xml b/doc/classes/File.xml index 20054ac9dc..6c900385f7 100644 --- a/doc/classes/File.xml +++ b/doc/classes/File.xml @@ -22,7 +22,7 @@ [/codeblock] </description> <tutorials> - <link>http://docs.godotengine.org/en/3.0/getting_started/step_by_step/filesystem.html</link> + <link>https://docs.godotengine.org/en/latest/getting_started/step_by_step/filesystem.html</link> </tutorials> <demos> </demos> diff --git a/doc/classes/GIProbe.xml b/doc/classes/GIProbe.xml index 77dea73564..5fb0ccc33d 100644 --- a/doc/classes/GIProbe.xml +++ b/doc/classes/GIProbe.xml @@ -5,7 +5,7 @@ <description> </description> <tutorials> - <link>http://docs.godotengine.org/en/3.0/tutorials/3d/gi_probes.html</link> + <link>https://docs.godotengine.org/en/latest/tutorials/3d/gi_probes.html</link> </tutorials> <demos> </demos> diff --git a/doc/classes/HTTPClient.xml b/doc/classes/HTTPClient.xml index 08e2f649a0..2f21505757 100644 --- a/doc/classes/HTTPClient.xml +++ b/doc/classes/HTTPClient.xml @@ -10,8 +10,8 @@ For more information on HTTP, see https://developer.mozilla.org/en-US/docs/Web/HTTP (or read RFC 2616 to get it straight from the source: https://tools.ietf.org/html/rfc2616). </description> <tutorials> - <link>http://docs.godotengine.org/en/3.0/tutorials/networking/http_client_class.html</link> - <link>http://docs.godotengine.org/en/3.0/tutorials/networking/ssl_certificates.html</link> + <link>https://docs.godotengine.org/en/latest/tutorials/networking/http_client_class.html</link> + <link>https://docs.godotengine.org/en/latest/tutorials/networking/ssl_certificates.html</link> </tutorials> <demos> </demos> diff --git a/doc/classes/HTTPRequest.xml b/doc/classes/HTTPRequest.xml index c5bb10a23a..3916eb2b5b 100644 --- a/doc/classes/HTTPRequest.xml +++ b/doc/classes/HTTPRequest.xml @@ -8,7 +8,7 @@ Can be used to make HTTP requests, i.e. download or upload files or web content via HTTP. </description> <tutorials> - <link>http://docs.godotengine.org/en/3.0/tutorials/networking/ssl_certificates.html</link> + <link>https://docs.godotengine.org/en/latest/tutorials/networking/ssl_certificates.html</link> </tutorials> <demos> </demos> diff --git a/doc/classes/Input.xml b/doc/classes/Input.xml index 0e6e54c8fd..38804e40b4 100644 --- a/doc/classes/Input.xml +++ b/doc/classes/Input.xml @@ -7,7 +7,7 @@ A Singleton that deals with inputs. This includes key presses, mouse buttons and movement, joypads, and input actions. Actions and their events can be set in the Project Settings / Input Map tab. Or be set with [InputMap]. </description> <tutorials> - <link>http://docs.godotengine.org/en/3.0/tutorials/inputs/index.html</link> + <link>https://docs.godotengine.org/en/latest/tutorials/inputs/index.html</link> </tutorials> <demos> </demos> diff --git a/doc/classes/InputEvent.xml b/doc/classes/InputEvent.xml index 993d62d188..c880823aee 100644 --- a/doc/classes/InputEvent.xml +++ b/doc/classes/InputEvent.xml @@ -7,8 +7,8 @@ Base class of all sort of input event. See [method Node._input]. </description> <tutorials> - <link>http://docs.godotengine.org/en/3.0/tutorials/inputs/inputevent.html</link> - <link>http://docs.godotengine.org/en/3.0/tutorials/2d/2d_transforms.html</link> + <link>https://docs.godotengine.org/en/latest/tutorials/inputs/inputevent.html</link> + <link>https://docs.godotengine.org/en/latest/tutorials/2d/2d_transforms.html</link> </tutorials> <demos> </demos> diff --git a/doc/classes/InputEventAction.xml b/doc/classes/InputEventAction.xml index 16000231cb..8a10dc6ab9 100644 --- a/doc/classes/InputEventAction.xml +++ b/doc/classes/InputEventAction.xml @@ -7,7 +7,7 @@ Contains a generic action which can be targeted from several type of inputs. Actions can be created from the project settings menu [code]Project > Project Settings > Input Map[/code]. See [method Node._input]. </description> <tutorials> - <link>http://docs.godotengine.org/en/3.0/tutorials/inputs/inputevent.html#actions</link> + <link>https://docs.godotengine.org/en/latest/tutorials/inputs/inputevent.html#actions</link> </tutorials> <demos> </demos> diff --git a/doc/classes/InputEventJoypadButton.xml b/doc/classes/InputEventJoypadButton.xml index adaeae685e..18e33c2131 100644 --- a/doc/classes/InputEventJoypadButton.xml +++ b/doc/classes/InputEventJoypadButton.xml @@ -7,7 +7,7 @@ Input event type for gamepad buttons. For joysticks see [InputEventJoypadMotion]. </description> <tutorials> - <link>http://docs.godotengine.org/en/3.0/tutorials/inputs/inputevent.html</link> + <link>https://docs.godotengine.org/en/latest/tutorials/inputs/inputevent.html</link> </tutorials> <demos> </demos> diff --git a/doc/classes/InputEventJoypadMotion.xml b/doc/classes/InputEventJoypadMotion.xml index f86aec4ce0..0c73f53158 100644 --- a/doc/classes/InputEventJoypadMotion.xml +++ b/doc/classes/InputEventJoypadMotion.xml @@ -7,7 +7,7 @@ Stores information about joystick motions. One [code]InputEventJoypadMotion[/code] represents one axis at a time. </description> <tutorials> - <link>http://docs.godotengine.org/en/3.0/tutorials/inputs/inputevent.html</link> + <link>https://docs.godotengine.org/en/latest/tutorials/inputs/inputevent.html</link> </tutorials> <demos> </demos> diff --git a/doc/classes/InputEventKey.xml b/doc/classes/InputEventKey.xml index a013ee6266..0118fda2df 100644 --- a/doc/classes/InputEventKey.xml +++ b/doc/classes/InputEventKey.xml @@ -7,7 +7,7 @@ Stores key presses on the keyboard. Supports key presses, key releases and [member echo] events. </description> <tutorials> - <link>http://docs.godotengine.org/en/3.0/tutorials/inputs/inputevent.html</link> + <link>https://docs.godotengine.org/en/latest/tutorials/inputs/inputevent.html</link> </tutorials> <demos> </demos> diff --git a/doc/classes/InputEventMouse.xml b/doc/classes/InputEventMouse.xml index 06de96890a..27e8d17407 100644 --- a/doc/classes/InputEventMouse.xml +++ b/doc/classes/InputEventMouse.xml @@ -7,7 +7,7 @@ Stores general mouse events information. </description> <tutorials> - <link>http://docs.godotengine.org/en/3.0/tutorials/inputs/inputevent.html</link> + <link>https://docs.godotengine.org/en/latest/tutorials/inputs/inputevent.html</link> </tutorials> <demos> </demos> diff --git a/doc/classes/InputEventMouseButton.xml b/doc/classes/InputEventMouseButton.xml index a3a9055087..1342c7bf7e 100644 --- a/doc/classes/InputEventMouseButton.xml +++ b/doc/classes/InputEventMouseButton.xml @@ -7,7 +7,7 @@ Contains mouse click information. See [method Node._input]. </description> <tutorials> - <link>http://docs.godotengine.org/en/3.0/tutorials/inputs/mouse_and_input_coordinates.html</link> + <link>https://docs.godotengine.org/en/latest/tutorials/inputs/mouse_and_input_coordinates.html</link> </tutorials> <demos> </demos> diff --git a/doc/classes/InputEventMouseMotion.xml b/doc/classes/InputEventMouseMotion.xml index 05e3e79d26..f7f6358910 100644 --- a/doc/classes/InputEventMouseMotion.xml +++ b/doc/classes/InputEventMouseMotion.xml @@ -7,7 +7,7 @@ Contains mouse motion information. Supports relative, absolute positions and speed. See [method Node._input]. </description> <tutorials> - <link>http://docs.godotengine.org/en/3.0/tutorials/inputs/mouse_and_input_coordinates.html</link> + <link>https://docs.godotengine.org/en/latest/tutorials/inputs/mouse_and_input_coordinates.html</link> </tutorials> <demos> </demos> diff --git a/doc/classes/InputEventScreenDrag.xml b/doc/classes/InputEventScreenDrag.xml index f777d90ccb..a320c0a028 100644 --- a/doc/classes/InputEventScreenDrag.xml +++ b/doc/classes/InputEventScreenDrag.xml @@ -8,7 +8,7 @@ Contains screen drag information. See [method Node._input]. </description> <tutorials> - <link>http://docs.godotengine.org/en/3.0/tutorials/inputs/inputevent.html</link> + <link>https://docs.godotengine.org/en/latest/tutorials/inputs/inputevent.html</link> </tutorials> <demos> </demos> diff --git a/doc/classes/InputEventScreenTouch.xml b/doc/classes/InputEventScreenTouch.xml index 39cd0a9657..55f04cdd94 100644 --- a/doc/classes/InputEventScreenTouch.xml +++ b/doc/classes/InputEventScreenTouch.xml @@ -8,7 +8,7 @@ Stores multi-touch press/release information. Supports touch press, touch release and [member index] for multi-touch count and order. </description> <tutorials> - <link>http://docs.godotengine.org/en/3.0/tutorials/inputs/inputevent.html</link> + <link>https://docs.godotengine.org/en/latest/tutorials/inputs/inputevent.html</link> </tutorials> <demos> </demos> diff --git a/doc/classes/InputEventWithModifiers.xml b/doc/classes/InputEventWithModifiers.xml index 9c1814fedd..fcf2fd545e 100644 --- a/doc/classes/InputEventWithModifiers.xml +++ b/doc/classes/InputEventWithModifiers.xml @@ -7,7 +7,7 @@ Contains keys events information with modifiers support like [code]SHIFT[/code] or [code]ALT[/code]. See [method Node._input]. </description> <tutorials> - <link>http://docs.godotengine.org/en/3.0/tutorials/inputs/inputevent.html</link> + <link>https://docs.godotengine.org/en/latest/tutorials/inputs/inputevent.html</link> </tutorials> <demos> </demos> diff --git a/doc/classes/InputMap.xml b/doc/classes/InputMap.xml index 7fd1d7e8ac..8c25f851db 100644 --- a/doc/classes/InputMap.xml +++ b/doc/classes/InputMap.xml @@ -7,7 +7,7 @@ Manages all [InputEventAction] which can be created/modified from the project settings menu [code]Project > Project Settings > Input Map[/code] or in code with [method add_action] and [method action_add_event]. See [method Node._input]. </description> <tutorials> - <link>http://docs.godotengine.org/en/3.0/tutorials/inputs/inputevent.html#inputmap</link> + <link>https://docs.godotengine.org/en/latest/tutorials/inputs/inputevent.html#inputmap</link> </tutorials> <demos> </demos> diff --git a/doc/classes/JavaScript.xml b/doc/classes/JavaScript.xml index 17588717c2..fa3aaed684 100644 --- a/doc/classes/JavaScript.xml +++ b/doc/classes/JavaScript.xml @@ -7,7 +7,7 @@ The JavaScript singleton is implemented only in HTML5 export. It's used to access the browser's JavaScript context. This allows interaction with embedding pages or calling third-party JavaScript APIs. </description> <tutorials> - <link>http://docs.godotengine.org/en/3.0/getting_started/workflow/export/exporting_for_web.html#calling-javascript-from-script</link> + <link>https://docs.godotengine.org/en/latest/getting_started/workflow/export/exporting_for_web.html#calling-javascript-from-script</link> </tutorials> <demos> </demos> diff --git a/doc/classes/KinematicBody.xml b/doc/classes/KinematicBody.xml index 82638fc57a..0656341ffa 100644 --- a/doc/classes/KinematicBody.xml +++ b/doc/classes/KinematicBody.xml @@ -9,7 +9,7 @@ Kinematic Characters: KinematicBody also has an API for moving objects (the [method move_and_collide] and [method move_and_slide] methods) while performing collision tests. This makes them really useful to implement characters that collide against a world, but that don't require advanced physics. </description> <tutorials> - <link>http://docs.godotengine.org/en/3.0/tutorials/physics/kinematic_character_2d.html</link> + <link>https://docs.godotengine.org/en/latest/tutorials/physics/kinematic_character_2d.html</link> </tutorials> <demos> </demos> diff --git a/doc/classes/Light.xml b/doc/classes/Light.xml index 04191136a8..cf873e5b28 100644 --- a/doc/classes/Light.xml +++ b/doc/classes/Light.xml @@ -7,7 +7,7 @@ Light is the abstract base class for light nodes, so it shouldn't be used directly (It can't be instanced). Other types of light nodes inherit from it. Light contains the common variables and parameters used for lighting. </description> <tutorials> - <link>http://docs.godotengine.org/en/3.0/tutorials/3d/lights_and_shadows.html</link> + <link>https://docs.godotengine.org/en/latest/tutorials/3d/lights_and_shadows.html</link> </tutorials> <demos> </demos> diff --git a/doc/classes/NetworkedMultiplayerPeer.xml b/doc/classes/NetworkedMultiplayerPeer.xml index 3b76861afd..990f928b25 100644 --- a/doc/classes/NetworkedMultiplayerPeer.xml +++ b/doc/classes/NetworkedMultiplayerPeer.xml @@ -7,7 +7,7 @@ Manages the connection to network peers. Assigns unique IDs to each client connected to the server. </description> <tutorials> - <link>http://docs.godotengine.org/en/3.0/tutorials/networking/high_level_multiplayer.html</link> + <link>https://docs.godotengine.org/en/latest/tutorials/networking/high_level_multiplayer.html</link> </tutorials> <demos> </demos> diff --git a/doc/classes/Node.xml b/doc/classes/Node.xml index 19aa2e9f5e..dcdb6d0500 100644 --- a/doc/classes/Node.xml +++ b/doc/classes/Node.xml @@ -17,7 +17,7 @@ [b]Networking with nodes:[/b] After connecting to a server (or making one, see [NetworkedMultiplayerENet]) it is possible to use the built-in RPC (remote procedure call) system to communicate over the network. By calling [method rpc] with a method name, it will be called locally and in all connected peers (peers = clients and the server that accepts connections). To identify which node receives the RPC call Godot will use its [NodePath] (make sure node names are the same on all peers). Also take a look at the high-level networking tutorial and corresponding demos. </description> <tutorials> - <link>http://docs.godotengine.org/en/3.0/getting_started/step_by_step/scenes_and_nodes.html</link> + <link>https://docs.godotengine.org/en/latest/getting_started/step_by_step/scenes_and_nodes.html</link> </tutorials> <demos> </demos> diff --git a/doc/classes/Node2D.xml b/doc/classes/Node2D.xml index 13eabeca17..e955f6bb7d 100644 --- a/doc/classes/Node2D.xml +++ b/doc/classes/Node2D.xml @@ -7,7 +7,7 @@ A 2D game object, with a position, rotation and scale. All 2D physics nodes and sprites inherit from Node2D. Use Node2D as a parent node to move, scale and rotate children in a 2D project. Also gives control on the node's render order. </description> <tutorials> - <link>http://docs.godotengine.org/en/3.0/tutorials/2d/custom_drawing_in_2d.html</link> + <link>https://docs.godotengine.org/en/latest/tutorials/2d/custom_drawing_in_2d.html</link> </tutorials> <demos> </demos> diff --git a/doc/classes/OmniLight.xml b/doc/classes/OmniLight.xml index 5ed058bb06..8d67cb626b 100644 --- a/doc/classes/OmniLight.xml +++ b/doc/classes/OmniLight.xml @@ -7,7 +7,7 @@ An Omnidirectional light is a type of [Light] that emits light in all directions. The light is attenuated by distance and this attenuation can be configured by changing its energy, radius, and attenuation parameters. </description> <tutorials> - <link>http://docs.godotengine.org/en/3.0/tutorials/3d/lights_and_shadows.html</link> + <link>https://docs.godotengine.org/en/latest/tutorials/3d/lights_and_shadows.html</link> </tutorials> <demos> </demos> diff --git a/doc/classes/Physics2DDirectSpaceState.xml b/doc/classes/Physics2DDirectSpaceState.xml index aa54d9a11a..ebd17fd921 100644 --- a/doc/classes/Physics2DDirectSpaceState.xml +++ b/doc/classes/Physics2DDirectSpaceState.xml @@ -7,7 +7,7 @@ Direct access object to a space in the [Physics2DServer]. It's used mainly to do queries against objects and areas residing in a given space. </description> <tutorials> - <link>http://docs.godotengine.org/en/3.0/tutorials/physics/ray-casting.html</link> + <link>https://docs.godotengine.org/en/latest/tutorials/physics/ray-casting.html</link> </tutorials> <demos> </demos> diff --git a/doc/classes/PhysicsBody.xml b/doc/classes/PhysicsBody.xml index fb145f9de9..2658732f84 100644 --- a/doc/classes/PhysicsBody.xml +++ b/doc/classes/PhysicsBody.xml @@ -7,7 +7,7 @@ PhysicsBody is an abstract base class for implementing a physics body. All *Body types inherit from it. </description> <tutorials> - <link>http://docs.godotengine.org/en/3.0/tutorials/physics/physics_introduction.html</link> + <link>https://docs.godotengine.org/en/latest/tutorials/physics/physics_introduction.html</link> </tutorials> <demos> </demos> diff --git a/doc/classes/PhysicsBody2D.xml b/doc/classes/PhysicsBody2D.xml index 440caf61e5..f848b6df70 100644 --- a/doc/classes/PhysicsBody2D.xml +++ b/doc/classes/PhysicsBody2D.xml @@ -7,7 +7,7 @@ PhysicsBody2D is an abstract base class for implementing a physics body. All *Body2D types inherit from it. </description> <tutorials> - <link>http://docs.godotengine.org/en/3.0/tutorials/physics/physics_introduction.html</link> + <link>https://docs.godotengine.org/en/latest/tutorials/physics/physics_introduction.html</link> </tutorials> <demos> </demos> diff --git a/doc/classes/PhysicsDirectSpaceState.xml b/doc/classes/PhysicsDirectSpaceState.xml index 1fd00fa21c..350a9ed3ce 100644 --- a/doc/classes/PhysicsDirectSpaceState.xml +++ b/doc/classes/PhysicsDirectSpaceState.xml @@ -7,7 +7,7 @@ Direct access object to a space in the [PhysicsServer]. It's used mainly to do queries against objects and areas residing in a given space. </description> <tutorials> - <link>http://docs.godotengine.org/en/3.0/tutorials/physics/ray-casting.html</link> + <link>https://docs.godotengine.org/en/latest/tutorials/physics/ray-casting.html</link> </tutorials> <demos> </demos> diff --git a/doc/classes/Plane.xml b/doc/classes/Plane.xml index 3d5eada066..a57659abda 100644 --- a/doc/classes/Plane.xml +++ b/doc/classes/Plane.xml @@ -7,7 +7,7 @@ Plane represents a normalized plane equation. Basically, "normal" is the normal of the plane (a,b,c normalized), and "d" is the distance from the origin to the plane (in the direction of "normal"). "Over" or "Above" the plane is considered the side of the plane towards where the normal is pointing. </description> <tutorials> - <link>http://docs.godotengine.org/en/3.0/tutorials/math/index.html</link> + <link>https://docs.godotengine.org/en/latest/tutorials/math/index.html</link> </tutorials> <demos> </demos> diff --git a/doc/classes/Quat.xml b/doc/classes/Quat.xml index 67631bbc92..468839dfba 100644 --- a/doc/classes/Quat.xml +++ b/doc/classes/Quat.xml @@ -9,8 +9,8 @@ Quaternions need to be (re)normalized. </description> <tutorials> - <link>http://docs.godotengine.org/en/latest/tutorials/3d/using_transforms.html#interpolating-with-quaternions</link> - <link>http://docs.godotengine.org/en/latest/tutorials/math/rotations.html</link> + <link>https://docs.godotengine.org/en/latest/tutorials/3d/using_transforms.html#interpolating-with-quaternions</link> + <link>https://docs.godotengine.org/en/latest/tutorials/math/rotations.html</link> </tutorials> <demos> </demos> diff --git a/doc/classes/Rect2.xml b/doc/classes/Rect2.xml index 1eea940da9..1392e53f8d 100644 --- a/doc/classes/Rect2.xml +++ b/doc/classes/Rect2.xml @@ -7,7 +7,7 @@ Rect2 consists of a position, a size, and several utility functions. It is typically used for fast overlap tests. </description> <tutorials> - <link>http://docs.godotengine.org/en/3.0/tutorials/math/index.html</link> + <link>https://docs.godotengine.org/en/latest/tutorials/math/index.html</link> </tutorials> <demos> </demos> diff --git a/doc/classes/ReflectionProbe.xml b/doc/classes/ReflectionProbe.xml index a9a897ebaf..7662f72eca 100644 --- a/doc/classes/ReflectionProbe.xml +++ b/doc/classes/ReflectionProbe.xml @@ -5,7 +5,7 @@ <description> </description> <tutorials> - <link>http://docs.godotengine.org/en/3.0/tutorials/3d/reflection_probes.html</link> + <link>https://docs.godotengine.org/en/latest/tutorials/3d/reflection_probes.html</link> </tutorials> <demos> </demos> diff --git a/doc/classes/RichTextLabel.xml b/doc/classes/RichTextLabel.xml index 3371e4d66f..145ce7537b 100644 --- a/doc/classes/RichTextLabel.xml +++ b/doc/classes/RichTextLabel.xml @@ -8,7 +8,7 @@ Note that assignments to [member bbcode_text] clear the tag stack and reconstruct it from the property's contents. Any edits made to [member bbcode_text] will erase previous edits made from other manual sources such as [method append_bbcode] and the [code]push_*[/code] / [method pop] methods. </description> <tutorials> - <link>http://docs.godotengine.org/en/3.0/tutorials/gui/bbcode_in_richtextlabel.html</link> + <link>https://docs.godotengine.org/en/latest/tutorials/gui/bbcode_in_richtextlabel.html</link> </tutorials> <demos> </demos> diff --git a/doc/classes/RigidBody.xml b/doc/classes/RigidBody.xml index 0977b7ea01..4ff332402b 100644 --- a/doc/classes/RigidBody.xml +++ b/doc/classes/RigidBody.xml @@ -10,7 +10,7 @@ If you need to override the default physics behavior, you can write a custom force integration. See [member custom_integrator]. </description> <tutorials> - <link>http://docs.godotengine.org/en/3.0/tutorials/physics/physics_introduction.html</link> + <link>https://docs.godotengine.org/en/latest/tutorials/physics/physics_introduction.html</link> </tutorials> <demos> </demos> diff --git a/doc/classes/SceneTree.xml b/doc/classes/SceneTree.xml index b89ecd1de9..dd94ee66d2 100644 --- a/doc/classes/SceneTree.xml +++ b/doc/classes/SceneTree.xml @@ -7,8 +7,8 @@ As one of the most important classes, the [code]SceneTree[/code] manages the hierarchy of nodes in a scene as well as scenes themselves. Nodes can be added, retrieved and removed. The whole scene tree (and thus the current scene) can be paused. Scenes can be loaded, switched and reloaded. You can also use the SceneTree to organize your nodes into groups: every node can be assigned as many groups as you want to create, e.g. a "enemy" group. You can then iterate these groups or even call methods and set properties on all the group's members at once. </description> <tutorials> - <link>http://docs.godotengine.org/en/3.0/getting_started/step_by_step/scene_tree.html</link> - <link>http://docs.godotengine.org/en/3.0/tutorials/viewports/multiple_resolutions.html</link> + <link>https://docs.godotengine.org/en/latest/getting_started/step_by_step/scene_tree.html</link> + <link>https://docs.godotengine.org/en/latest/tutorials/viewports/multiple_resolutions.html</link> </tutorials> <demos> </demos> diff --git a/doc/classes/Script.xml b/doc/classes/Script.xml index 128d7475cc..ec1d544c03 100644 --- a/doc/classes/Script.xml +++ b/doc/classes/Script.xml @@ -8,7 +8,7 @@ The [code]new[/code] method of a script subclass creates a new instance. [method Object.set_script] extends an existing object, if that object's class matches one of the script's base classes. </description> <tutorials> - <link>http://docs.godotengine.org/en/3.0/getting_started/step_by_step/scripting.html</link> + <link>https://docs.godotengine.org/en/latest/getting_started/step_by_step/scripting.html</link> </tutorials> <demos> </demos> diff --git a/doc/classes/Shader.xml b/doc/classes/Shader.xml index 7f9a124683..dd6a023af4 100644 --- a/doc/classes/Shader.xml +++ b/doc/classes/Shader.xml @@ -7,7 +7,7 @@ This class allows you to define a custom shader program that can be used for various materials to render objects. </description> <tutorials> - <link>http://docs.godotengine.org/en/3.0/tutorials/shading/index.html</link> + <link>https://docs.godotengine.org/en/latest/tutorials/shading/index.html</link> </tutorials> <demos> </demos> diff --git a/doc/classes/Shape.xml b/doc/classes/Shape.xml index bc1a429418..6e51d3156f 100644 --- a/doc/classes/Shape.xml +++ b/doc/classes/Shape.xml @@ -7,7 +7,7 @@ Base class for all 3D shape resources. Nodes that inherit from this can be used as shapes for a [PhysicsBody] or [Area] objects. </description> <tutorials> - <link>http://docs.godotengine.org/en/3.0/tutorials/physics/physics_introduction.html</link> + <link>https://docs.godotengine.org/en/latest/tutorials/physics/physics_introduction.html</link> </tutorials> <demos> </demos> diff --git a/doc/classes/Shape2D.xml b/doc/classes/Shape2D.xml index 2772538cec..96b8a77d9e 100644 --- a/doc/classes/Shape2D.xml +++ b/doc/classes/Shape2D.xml @@ -7,7 +7,7 @@ Base class for all 2D Shapes. All 2D shape types inherit from this. </description> <tutorials> - <link>http://docs.godotengine.org/en/3.0/tutorials/physics/physics_introduction.html</link> + <link>https://docs.godotengine.org/en/latest/tutorials/physics/physics_introduction.html</link> </tutorials> <demos> </demos> diff --git a/doc/classes/Spatial.xml b/doc/classes/Spatial.xml index 7fd7b5deed..6f9d779737 100644 --- a/doc/classes/Spatial.xml +++ b/doc/classes/Spatial.xml @@ -8,7 +8,7 @@ Affine operations (rotate, scale, translate) happen in parent's local coordinate system, unless the Spatial object is set as top level. Affine operations in this coordinate system correspond to direct affine operations on the Spatial's transform. The word local below refers to this coordinate system. The coordinate system that is attached to the Spatial object itself is referred to as object-local coordinate system. </description> <tutorials> - <link>http://docs.godotengine.org/en/3.0/tutorials/3d/introduction_to_3d.html</link> + <link>https://docs.godotengine.org/en/latest/tutorials/3d/introduction_to_3d.html</link> </tutorials> <demos> </demos> diff --git a/doc/classes/SpatialMaterial.xml b/doc/classes/SpatialMaterial.xml index 57fb267e91..8fd9b59bdc 100644 --- a/doc/classes/SpatialMaterial.xml +++ b/doc/classes/SpatialMaterial.xml @@ -7,7 +7,7 @@ This provides a default material with a wide variety of rendering features and properties without the need to write shader code. See the tutorial below for details. </description> <tutorials> - <link>http://docs.godotengine.org/en/3.0/tutorials/3d/spatial_material.html</link> + <link>https://docs.godotengine.org/en/latest/tutorials/3d/spatial_material.html</link> </tutorials> <demos> </demos> diff --git a/doc/classes/SpotLight.xml b/doc/classes/SpotLight.xml index 1f81e9e5c2..11f914aac2 100644 --- a/doc/classes/SpotLight.xml +++ b/doc/classes/SpotLight.xml @@ -7,7 +7,7 @@ A SpotLight light is a type of [Light] node that emits lights in a specific direction, in the shape of a cone. The light is attenuated through the distance and this attenuation can be configured by changing the energy, radius and attenuation parameters of [Light]. TODO: Image of a spotlight. </description> <tutorials> - <link>http://docs.godotengine.org/en/3.0/tutorials/3d/lights_and_shadows.html</link> + <link>https://docs.godotengine.org/en/latest/tutorials/3d/lights_and_shadows.html</link> </tutorials> <demos> </demos> diff --git a/doc/classes/StreamPeerSSL.xml b/doc/classes/StreamPeerSSL.xml index 33948df509..40a4e04a80 100644 --- a/doc/classes/StreamPeerSSL.xml +++ b/doc/classes/StreamPeerSSL.xml @@ -7,7 +7,7 @@ SSL Stream peer. This object can be used to connect to SSL servers. </description> <tutorials> - <link>http://docs.godotengine.org/en/3.0/tutorials/networking/ssl_certificates.html</link> + <link>https://docs.godotengine.org/en/latest/tutorials/networking/ssl_certificates.html</link> </tutorials> <demos> </demos> diff --git a/doc/classes/TileMap.xml b/doc/classes/TileMap.xml index 6f8c76d1ea..7034d75473 100644 --- a/doc/classes/TileMap.xml +++ b/doc/classes/TileMap.xml @@ -7,7 +7,7 @@ Node for 2D tile-based maps. Tilemaps use a [TileSet] which contain a list of tiles (textures plus optional collision, navigation, and/or occluder shapes) which are used to create grid-based maps. </description> <tutorials> - <link>http://docs.godotengine.org/en/3.0/tutorials/2d/using_tilemaps.html</link> + <link>https://docs.godotengine.org/en/latest/tutorials/2d/using_tilemaps.html</link> </tutorials> <demos> </demos> diff --git a/doc/classes/Transform.xml b/doc/classes/Transform.xml index 09edfe4235..b3168ef129 100644 --- a/doc/classes/Transform.xml +++ b/doc/classes/Transform.xml @@ -7,8 +7,8 @@ Represents one or many transformations in 3D space such as translation, rotation, or scaling. It consists of a [Basis] "basis" and an [Vector3] "origin". It is similar to a 3x4 matrix. </description> <tutorials> - <link>http://docs.godotengine.org/en/3.0/tutorials/math/index.html</link> - <link>http://docs.godotengine.org/en/latest/tutorials/3d/using_transforms.html</link> + <link>https://docs.godotengine.org/en/latest/tutorials/math/index.html</link> + <link>https://docs.godotengine.org/en/latest/tutorials/3d/using_transforms.html</link> </tutorials> <demos> </demos> diff --git a/doc/classes/Vector2.xml b/doc/classes/Vector2.xml index 1f8eb47044..006a843c32 100644 --- a/doc/classes/Vector2.xml +++ b/doc/classes/Vector2.xml @@ -7,7 +7,7 @@ 2-element structure that can be used to represent positions in 2d space or any other pair of numeric values. </description> <tutorials> - <link>http://docs.godotengine.org/en/3.0/tutorials/math/index.html</link> + <link>https://docs.godotengine.org/en/latest/tutorials/math/index.html</link> </tutorials> <demos> </demos> diff --git a/doc/classes/Vector3.xml b/doc/classes/Vector3.xml index 2499ba75ff..48856875e7 100644 --- a/doc/classes/Vector3.xml +++ b/doc/classes/Vector3.xml @@ -7,7 +7,7 @@ Vector3 is one of the core classes of the engine, and includes several built-in helper functions to perform basic vector math operations. </description> <tutorials> - <link>http://docs.godotengine.org/en/3.0/tutorials/math/index.html</link> + <link>https://docs.godotengine.org/en/latest/tutorials/math/index.html</link> </tutorials> <demos> </demos> diff --git a/doc/classes/Viewport.xml b/doc/classes/Viewport.xml index 9cd501630e..2cdd8c407f 100644 --- a/doc/classes/Viewport.xml +++ b/doc/classes/Viewport.xml @@ -12,8 +12,8 @@ Finally, viewports can also behave as render targets, in which case they will not be visible unless the associated texture is used to draw. </description> <tutorials> - <link>http://docs.godotengine.org/en/3.0/tutorials/2d/2d_transforms.html</link> - <link>http://docs.godotengine.org/en/3.0/tutorials/viewports/index.html</link> + <link>https://docs.godotengine.org/en/latest/tutorials/2d/2d_transforms.html</link> + <link>https://docs.godotengine.org/en/latest/tutorials/viewports/index.html</link> </tutorials> <demos> </demos> diff --git a/doc/classes/World.xml b/doc/classes/World.xml index 540848e40a..4e954acd48 100644 --- a/doc/classes/World.xml +++ b/doc/classes/World.xml @@ -7,7 +7,7 @@ Class that has everything pertaining to a world. A physics space, a visual scenario and a sound space. Spatial nodes register their resources into the current world. </description> <tutorials> - <link>http://docs.godotengine.org/en/3.0/tutorials/physics/ray-casting.html</link> + <link>https://docs.godotengine.org/en/latest/tutorials/physics/ray-casting.html</link> </tutorials> <demos> </demos> diff --git a/doc/classes/World2D.xml b/doc/classes/World2D.xml index 780cdd181a..9c3d66dade 100644 --- a/doc/classes/World2D.xml +++ b/doc/classes/World2D.xml @@ -7,7 +7,7 @@ Class that has everything pertaining to a 2D world. A physics space, a visual scenario and a sound space. 2D nodes register their resources into the current 2D world. </description> <tutorials> - <link>http://docs.godotengine.org/en/3.0/tutorials/physics/ray-casting.html</link> + <link>https://docs.godotengine.org/en/latest/tutorials/physics/ray-casting.html</link> </tutorials> <demos> </demos> diff --git a/doc/classes/WorldEnvironment.xml b/doc/classes/WorldEnvironment.xml index e68ad2800e..45e1af4e42 100644 --- a/doc/classes/WorldEnvironment.xml +++ b/doc/classes/WorldEnvironment.xml @@ -9,7 +9,7 @@ The [code]WorldEnvironment[/code] allows the user to specify default lighting parameters (e.g. ambient lighting), various post-processing effects (e.g. SSAO, DOF, Tonemapping), and how to draw the background (e.g. solid color, skybox). Usually, these are added in order to improve the realism/color balance of the scene. </description> <tutorials> - <link>http://docs.godotengine.org/en/3.0/tutorials/3d/environment_and_post_processing.html</link> + <link>https://docs.godotengine.org/en/latest/tutorials/3d/environment_and_post_processing.html</link> </tutorials> <demos> </demos> diff --git a/doc/tools/doc_status.py b/doc/tools/doc_status.py index ab74c0b9d6..4bb4342d5f 100644 --- a/doc/tools/doc_status.py +++ b/doc/tools/doc_status.py @@ -229,11 +229,11 @@ class ClassStatus: output['overall'] = (description_progress + items_progress).to_colored_string('{percent}%', '{pad_percent}{s}') if self.name.startswith('Total'): - output['url'] = color('url', 'http://docs.godotengine.org/en/latest/classes/') + output['url'] = color('url', 'https://docs.godotengine.org/en/latest/classes/') if flags['s']: output['comment'] = color('part_good', 'ALL OK') else: - output['url'] = color('url', 'http://docs.godotengine.org/en/latest/classes/class_{name}.html'.format(name=self.name.lower())) + output['url'] = color('url', 'https://docs.godotengine.org/en/latest/classes/class_{name}.html'.format(name=self.name.lower())) if flags['s'] and not flags['g'] and self.is_ok(): output['comment'] = color('part_good', 'ALL OK') diff --git a/drivers/gles2/rasterizer_storage_gles2.cpp b/drivers/gles2/rasterizer_storage_gles2.cpp index c4c5093540..5011794735 100644 --- a/drivers/gles2/rasterizer_storage_gles2.cpp +++ b/drivers/gles2/rasterizer_storage_gles2.cpp @@ -1602,7 +1602,7 @@ void RasterizerStorageGLES2::_update_material(Material *p_material) { if (p_material->shader && p_material->shader->mode == VS::SHADER_SPATIAL) { if (p_material->shader->spatial.blend_mode == Shader::Spatial::BLEND_MODE_MIX && - (!p_material->shader->spatial.uses_alpha || (p_material->shader->spatial.uses_alpha && p_material->shader->spatial.depth_draw_mode == Shader::Spatial::DEPTH_DRAW_ALPHA_PREPASS))) { + (!p_material->shader->spatial.uses_alpha || p_material->shader->spatial.depth_draw_mode == Shader::Spatial::DEPTH_DRAW_ALPHA_PREPASS)) { can_cast_shadow = true; } diff --git a/drivers/gles2/rasterizer_storage_gles2.h b/drivers/gles2/rasterizer_storage_gles2.h index c928f753b1..04a6f72710 100644 --- a/drivers/gles2/rasterizer_storage_gles2.h +++ b/drivers/gles2/rasterizer_storage_gles2.h @@ -429,6 +429,7 @@ public: int light_mode; */ + bool uses_screen_texture; bool uses_screen_uv; bool uses_time; diff --git a/drivers/gles3/rasterizer_canvas_gles3.cpp b/drivers/gles3/rasterizer_canvas_gles3.cpp index f0932c2f80..0c6893d419 100644 --- a/drivers/gles3/rasterizer_canvas_gles3.cpp +++ b/drivers/gles3/rasterizer_canvas_gles3.cpp @@ -967,7 +967,6 @@ void RasterizerCanvasGLES3::_canvas_item_render_commands(Item *p_item, Item *cur //enable instancing state.canvas_shader.set_conditional(CanvasShaderGLES3::USE_INSTANCE_CUSTOM, true); - state.canvas_shader.set_conditional(CanvasShaderGLES3::USE_PARTICLES, true); state.canvas_shader.set_conditional(CanvasShaderGLES3::USE_INSTANCING, true); //reset shader and force rebind state.using_texture_rect = true; @@ -976,10 +975,8 @@ void RasterizerCanvasGLES3::_canvas_item_render_commands(Item *p_item, Item *cur RasterizerStorageGLES3::Texture *texture = _bind_canvas_texture(particles_cmd->texture, particles_cmd->normal_map); if (texture) { - Size2 texpixel_size(1.0 / (texture->width / particles_cmd->h_frames), 1.0 / (texture->height / particles_cmd->v_frames)); + Size2 texpixel_size(1.0 / texture->width, 1.0 / texture->height); state.canvas_shader.set_uniform(CanvasShaderGLES3::COLOR_TEXPIXEL_SIZE, texpixel_size); - } else { - state.canvas_shader.set_uniform(CanvasShaderGLES3::COLOR_TEXPIXEL_SIZE, Vector2(1.0, 1.0)); } if (!particles->use_local_coords) { @@ -993,9 +990,6 @@ void RasterizerCanvasGLES3::_canvas_item_render_commands(Item *p_item, Item *cur state.canvas_shader.set_uniform(CanvasShaderGLES3::MODELVIEW_MATRIX, state.final_transform * inv_xf); } - state.canvas_shader.set_uniform(CanvasShaderGLES3::H_FRAMES, particles_cmd->h_frames); - state.canvas_shader.set_uniform(CanvasShaderGLES3::V_FRAMES, particles_cmd->v_frames); - glBindVertexArray(data.particle_quad_array); //use particle quad array glBindBuffer(GL_ARRAY_BUFFER, particles->particle_buffers[0]); //bind particle buffer @@ -1073,7 +1067,6 @@ void RasterizerCanvasGLES3::_canvas_item_render_commands(Item *p_item, Item *cur state.canvas_shader.set_conditional(CanvasShaderGLES3::USE_INSTANCE_CUSTOM, false); state.canvas_shader.set_conditional(CanvasShaderGLES3::USE_INSTANCING, false); - state.canvas_shader.set_conditional(CanvasShaderGLES3::USE_PARTICLES, false); state.using_texture_rect = true; _set_texture_rect_mode(false); diff --git a/drivers/gles3/rasterizer_storage_gles3.cpp b/drivers/gles3/rasterizer_storage_gles3.cpp index c06ef805a6..649449a891 100644 --- a/drivers/gles3/rasterizer_storage_gles3.cpp +++ b/drivers/gles3/rasterizer_storage_gles3.cpp @@ -2830,7 +2830,7 @@ void RasterizerStorageGLES3::_update_material(Material *material) { if (material->shader && material->shader->mode == VS::SHADER_SPATIAL) { if (material->shader->spatial.blend_mode == Shader::Spatial::BLEND_MODE_MIX && - (!material->shader->spatial.uses_alpha || (material->shader->spatial.uses_alpha && material->shader->spatial.depth_draw_mode == Shader::Spatial::DEPTH_DRAW_ALPHA_PREPASS))) { + (!material->shader->spatial.uses_alpha || material->shader->spatial.depth_draw_mode == Shader::Spatial::DEPTH_DRAW_ALPHA_PREPASS)) { can_cast_shadow = true; } diff --git a/drivers/gles3/rasterizer_storage_gles3.h b/drivers/gles3/rasterizer_storage_gles3.h index 8c26e09037..773b149e0b 100644 --- a/drivers/gles3/rasterizer_storage_gles3.h +++ b/drivers/gles3/rasterizer_storage_gles3.h @@ -449,6 +449,7 @@ public: }; int light_mode; + bool uses_screen_texture; bool uses_screen_uv; bool uses_time; diff --git a/drivers/gles3/shaders/canvas.glsl b/drivers/gles3/shaders/canvas.glsl index 8e8b693eb2..52746e0862 100644 --- a/drivers/gles3/shaders/canvas.glsl +++ b/drivers/gles3/shaders/canvas.glsl @@ -92,11 +92,6 @@ const bool at_light_pass = true; const bool at_light_pass = false; #endif -#ifdef USE_PARTICLES -uniform int h_frames; -uniform int v_frames; -#endif - #if defined(USE_MATERIAL) /* clang-format off */ @@ -143,20 +138,6 @@ void main() { highp vec4 outvec = vec4(vertex, 0.0, 1.0); #endif -#ifdef USE_PARTICLES - //scale by texture size - outvec.xy /= color_texpixel_size; - - //compute h and v frames and adjust UV interp for animation - int total_frames = h_frames * v_frames; - int frame = min(int(float(total_frames) * instance_custom.z), total_frames - 1); - float frame_w = 1.0 / float(h_frames); - float frame_h = 1.0 / float(v_frames); - uv_interp.x = uv_interp.x * frame_w + frame_w * float(frame % h_frames); - uv_interp.y = uv_interp.y * frame_h + frame_h * float(frame / h_frames); - -#endif - #define extra_matrix extra_matrix_instance { diff --git a/editor/code_editor.cpp b/editor/code_editor.cpp index aeb304d3b9..3136b0f012 100644 --- a/editor/code_editor.cpp +++ b/editor/code_editor.cpp @@ -1060,7 +1060,7 @@ void CodeTextEditor::delete_lines() { text_editor->end_complex_operation(); } -void CodeTextEditor::code_lines_down() { +void CodeTextEditor::clone_lines_down() { int from_line = text_editor->cursor_get_line(); int to_line = text_editor->cursor_get_line(); int column = text_editor->cursor_get_column(); @@ -1072,22 +1072,21 @@ void CodeTextEditor::code_lines_down() { } int next_line = to_line + 1; - if (to_line >= text_editor->get_line_count() - 1) { - text_editor->set_line(to_line, text_editor->get_line(to_line) + "\n"); - } - + bool caret_at_start = text_editor->cursor_get_line() == from_line; text_editor->begin_complex_operation(); for (int i = from_line; i <= to_line; i++) { - text_editor->unfold_line(i); - if (i >= text_editor->get_line_count() - 1) { - text_editor->set_line(i, text_editor->get_line(i) + "\n"); - } - String line_clone = text_editor->get_line(i); - text_editor->insert_at(line_clone, next_line); + text_editor->set_line(next_line - 1, text_editor->get_line(next_line - 1) + "\n"); + text_editor->set_line(next_line, text_editor->get_line(i)); next_line++; } + if (caret_at_start) { + text_editor->cursor_set_line(to_line + 1); + } else { + text_editor->cursor_set_line(next_line - 1); + } + text_editor->cursor_set_column(column); if (text_editor->is_selection_active()) { text_editor->select(to_line + 1, text_editor->get_selection_from_column(), next_line - 1, text_editor->get_selection_to_column()); diff --git a/editor/code_editor.h b/editor/code_editor.h index ee47eff9a8..2f9403843e 100644 --- a/editor/code_editor.h +++ b/editor/code_editor.h @@ -203,7 +203,7 @@ public: void move_lines_up(); void move_lines_down(); void delete_lines(); - void code_lines_down(); + void clone_lines_down(); void goto_line(int p_line); void goto_line_selection(int p_line, int p_begin, int p_end); diff --git a/editor/editor_help.cpp b/editor/editor_help.cpp index 80dd5aa114..3ee8d9c6c5 100644 --- a/editor/editor_help.cpp +++ b/editor/editor_help.cpp @@ -36,7 +36,7 @@ #include "editor_node.h" #include "editor_settings.h" -#define CONTRIBUTE_URL "http://docs.godotengine.org/en/latest/community/contributing/updating_the_class_reference.html" +#define CONTRIBUTE_URL "https://docs.godotengine.org/en/latest/community/contributing/updating_the_class_reference.html" #define CONTRIBUTE2_URL "https://github.com/godotengine/godot-docs" #define REQUEST_URL "https://github.com/godotengine/godot-docs/issues/new" @@ -252,6 +252,8 @@ void EditorHelpSearch::_notification(int p_what) { connect("confirmed", this, "_confirmed"); _update_search(); + } else if (p_what == NOTIFICATION_EXIT_TREE) { + disconnect("confirmed", this, "_confirmed"); } else if (p_what == NOTIFICATION_VISIBILITY_CHANGED) { if (is_visible_in_tree()) { diff --git a/editor/editor_inspector.cpp b/editor/editor_inspector.cpp index 1230588016..75b364089d 100644 --- a/editor/editor_inspector.cpp +++ b/editor/editor_inspector.cpp @@ -1143,10 +1143,8 @@ void EditorInspectorSection::_notification(int p_what) { Color color = get_color("font_color", "Tree"); draw_string(font, Point2(hs, font->get_ascent() + (h - font->get_height()) / 2).floor(), label, color, get_size().width); - int ofs = 0; if (arrow.is_valid()) { draw_texture(arrow, Point2(get_size().width - arrow->get_width(), (h - arrow->get_height()) / 2).floor()); - ofs += hs + arrow->get_width(); } } } diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp index f2a4591754..81bcbd63a1 100644 --- a/editor/editor_node.cpp +++ b/editor/editor_node.cpp @@ -2270,7 +2270,7 @@ void EditorNode::_menu_option_confirm(int p_option, bool p_confirmed) { emit_signal("request_help_search", ""); } break; case HELP_DOCS: { - OS::get_singleton()->shell_open("http://docs.godotengine.org/"); + OS::get_singleton()->shell_open("https://docs.godotengine.org/"); } break; case HELP_QA: { OS::get_singleton()->shell_open("https://godotengine.org/qa/"); diff --git a/editor/plugins/particles_2d_editor_plugin.cpp b/editor/plugins/particles_2d_editor_plugin.cpp index 5dcbca2ed6..ab94258c44 100644 --- a/editor/plugins/particles_2d_editor_plugin.cpp +++ b/editor/plugins/particles_2d_editor_plugin.cpp @@ -32,6 +32,7 @@ #include "canvas_item_editor_plugin.h" #include "core/io/image_loader.h" +#include "scene/2d/cpu_particles_2d.h" #include "scene/gui/separator.h" #include "scene/resources/particles_material.h" @@ -82,6 +83,25 @@ void Particles2DEditorPlugin::_menu_callback(int p_idx) { emission_mask->popup_centered_minsize(); } break; + case MENU_OPTION_CONVERT_TO_CPU_PARTICLES: { + + UndoRedo *undo_redo = EditorNode::get_singleton()->get_undo_redo(); + + CPUParticles2D *cpu_particles = memnew(CPUParticles2D); + cpu_particles->convert_from_particles(particles); + cpu_particles->set_name(particles->get_name()); + cpu_particles->set_transform(particles->get_transform()); + cpu_particles->set_visible(particles->is_visible()); + cpu_particles->set_pause_mode(particles->get_pause_mode()); + + undo_redo->create_action("Replace Particles by CPUParticles"); + undo_redo->add_do_method(particles, "replace_by", cpu_particles); + undo_redo->add_undo_method(cpu_particles, "replace_by", particles); + undo_redo->add_do_reference(cpu_particles); + undo_redo->add_undo_reference(particles); + undo_redo->commit_action(); + + } break; } } @@ -355,6 +375,8 @@ Particles2DEditorPlugin::Particles2DEditorPlugin(EditorNode *p_node) { menu->get_popup()->add_separator(); menu->get_popup()->add_item(TTR("Load Emission Mask"), MENU_LOAD_EMISSION_MASK); // menu->get_popup()->add_item(TTR("Clear Emission Mask"), MENU_CLEAR_EMISSION_MASK); + menu->get_popup()->add_separator(); + menu->get_popup()->add_item(TTR("Convert to CPUParticles"), MENU_OPTION_CONVERT_TO_CPU_PARTICLES); menu->set_text(TTR("Particles")); toolbar->add_child(menu); diff --git a/editor/plugins/particles_2d_editor_plugin.h b/editor/plugins/particles_2d_editor_plugin.h index 71ca8ef499..eaa96d84e9 100644 --- a/editor/plugins/particles_2d_editor_plugin.h +++ b/editor/plugins/particles_2d_editor_plugin.h @@ -46,7 +46,8 @@ class Particles2DEditorPlugin : public EditorPlugin { MENU_GENERATE_VISIBILITY_RECT, MENU_LOAD_EMISSION_MASK, - MENU_CLEAR_EMISSION_MASK + MENU_CLEAR_EMISSION_MASK, + MENU_OPTION_CONVERT_TO_CPU_PARTICLES }; enum EmissionMode { diff --git a/editor/plugins/script_editor_plugin.cpp b/editor/plugins/script_editor_plugin.cpp index 03b9f7938f..323dfa681b 100644 --- a/editor/plugins/script_editor_plugin.cpp +++ b/editor/plugins/script_editor_plugin.cpp @@ -210,6 +210,9 @@ void ScriptEditorQuickOpen::_notification(int p_what) { search_box->set_right_icon(get_icon("Search", "EditorIcons")); search_box->set_clear_button_enabled(true); } break; + case NOTIFICATION_EXIT_TREE: { + disconnect("confirmed", this, "_confirmed"); + } break; } } @@ -978,7 +981,7 @@ void ScriptEditor::_menu_option(int p_option) { } break; case SEARCH_WEBSITE: { - OS::get_singleton()->shell_open("http://docs.godotengine.org/"); + OS::get_singleton()->shell_open("https://docs.godotengine.org/"); } break; case WINDOW_NEXT: { diff --git a/editor/plugins/script_text_editor.cpp b/editor/plugins/script_text_editor.cpp index 0796a93dc3..c3e2aa86f0 100644 --- a/editor/plugins/script_text_editor.cpp +++ b/editor/plugins/script_text_editor.cpp @@ -773,7 +773,7 @@ void ScriptTextEditor::_edit_option(int p_op) { } break; case EDIT_CLONE_DOWN: { - code_editor->code_lines_down(); + code_editor->clone_lines_down(); } break; case EDIT_TOGGLE_FOLD_LINE: { diff --git a/editor/plugins/shader_editor_plugin.cpp b/editor/plugins/shader_editor_plugin.cpp index 17f93b55a1..638de1b213 100644 --- a/editor/plugins/shader_editor_plugin.cpp +++ b/editor/plugins/shader_editor_plugin.cpp @@ -263,7 +263,7 @@ void ShaderEditor::_menu_option(int p_option) { shader_editor->delete_lines(); } break; case EDIT_CLONE_DOWN: { - shader_editor->code_lines_down(); + shader_editor->clone_lines_down(); } break; case EDIT_TOGGLE_COMMENT: { diff --git a/editor/plugins/text_editor.cpp b/editor/plugins/text_editor.cpp index 1a43b16f3e..4a8eae1ba4 100644 --- a/editor/plugins/text_editor.cpp +++ b/editor/plugins/text_editor.cpp @@ -360,7 +360,7 @@ void TextEditor::_edit_option(int p_op) { } break; case EDIT_CLONE_DOWN: { - code_editor->code_lines_down(); + code_editor->clone_lines_down(); } break; case EDIT_TOGGLE_FOLD_LINE: { diff --git a/editor/property_selector.cpp b/editor/property_selector.cpp index 9042bdc7c1..a8c97be936 100644 --- a/editor/property_selector.cpp +++ b/editor/property_selector.cpp @@ -394,6 +394,8 @@ void PropertySelector::_notification(int p_what) { if (p_what == NOTIFICATION_ENTER_TREE) { connect("confirmed", this, "_confirmed"); + } else if (p_what == NOTIFICATION_EXIT_TREE) { + disconnect("confirmed", this, "_confirmed"); } } diff --git a/editor/quick_open.cpp b/editor/quick_open.cpp index e48a0022e8..8dacc3c142 100644 --- a/editor/quick_open.cpp +++ b/editor/quick_open.cpp @@ -261,6 +261,8 @@ void EditorQuickOpen::_notification(int p_what) { search_box->set_right_icon(get_icon("Search", "EditorIcons")); search_box->set_clear_button_enabled(true); + } else if (p_what == NOTIFICATION_EXIT_TREE) { + disconnect("confirmed", this, "_confirmed"); } } diff --git a/misc/dist/linux/org.godotengine.Godot.appdata.xml b/misc/dist/linux/org.godotengine.Godot.appdata.xml index 9f3f9e34af..c11317cd35 100644 --- a/misc/dist/linux/org.godotengine.Godot.appdata.xml +++ b/misc/dist/linux/org.godotengine.Godot.appdata.xml @@ -27,8 +27,8 @@ </screenshots> <url type="homepage">https://godotengine.org</url> <url type="bugtracker">https://github.com/godotengine/godot/issues</url> - <url type="faq">http://docs.godotengine.org/en/latest/about/faq.html</url> - <url type="help">http://docs.godotengine.org</url> + <url type="faq">https://docs.godotengine.org/en/latest/about/faq.html</url> + <url type="help">https://docs.godotengine.org</url> <url type="donation">https://godotengine.org/donate</url> <url type="translate">https://hosted.weblate.org/projects/godot-engine/godot</url> <developer_name>The Godot Engine Community</developer_name> diff --git a/modules/enet/doc_classes/NetworkedMultiplayerENet.xml b/modules/enet/doc_classes/NetworkedMultiplayerENet.xml index 6d990f6f6f..e057a435ac 100644 --- a/modules/enet/doc_classes/NetworkedMultiplayerENet.xml +++ b/modules/enet/doc_classes/NetworkedMultiplayerENet.xml @@ -7,7 +7,7 @@ A PacketPeer implementation that should be passed to [method SceneTree.set_network_peer] after being initialized as either a client or server. Events can then be handled by connecting to [SceneTree] signals. </description> <tutorials> - <link>http://docs.godotengine.org/en/3.0/tutorials/networking/high_level_multiplayer.html</link> + <link>https://docs.godotengine.org/en/latest/tutorials/networking/high_level_multiplayer.html</link> <link>http://enet.bespin.org/usergroup0.html</link> </tutorials> <demos> diff --git a/modules/gdscript/doc_classes/GDScript.xml b/modules/gdscript/doc_classes/GDScript.xml index 632970f8c0..4cefdbd7cb 100644 --- a/modules/gdscript/doc_classes/GDScript.xml +++ b/modules/gdscript/doc_classes/GDScript.xml @@ -8,7 +8,7 @@ [method new] creates a new instance of the script. [method Object.set_script] extends an existing object, if that object's class matches one of the script's base classes. </description> <tutorials> - <link>http://docs.godotengine.org/en/3.0/getting_started/scripting/gdscript/index.html</link> + <link>https://docs.godotengine.org/en/latest/getting_started/scripting/gdscript/index.html</link> </tutorials> <demos> </demos> diff --git a/modules/gdscript/gdscript_parser.cpp b/modules/gdscript/gdscript_parser.cpp index 97ac6f7de6..3e5ad7c99b 100644 --- a/modules/gdscript/gdscript_parser.cpp +++ b/modules/gdscript/gdscript_parser.cpp @@ -7080,7 +7080,6 @@ GDScriptParser::DataType GDScriptParser::_reduce_identifier_type(const DataType DataType member_type; for (int i = 0; i < current_class->variables.size(); i++) { - ClassNode::Member m = current_class->variables[i]; if (current_class->variables[i].identifier == p_identifier) { member_type = current_class->variables[i].data_type; current_class->variables.write[i].usages += 1; diff --git a/modules/gridmap/doc_classes/GridMap.xml b/modules/gridmap/doc_classes/GridMap.xml index f13479940d..9b9088dd82 100644 --- a/modules/gridmap/doc_classes/GridMap.xml +++ b/modules/gridmap/doc_classes/GridMap.xml @@ -10,7 +10,7 @@ A GridMap is split into a sparse collection of octants for efficient rendering and physics processing. Every octant has the same dimensions and can contain several cells. </description> <tutorials> - <link>http://docs.godotengine.org/en/3.0/tutorials/3d/using_gridmaps.html</link> + <link>https://docs.godotengine.org/en/latest/tutorials/3d/using_gridmaps.html</link> </tutorials> <demos> </demos> diff --git a/modules/visual_script/doc_classes/VisualScript.xml b/modules/visual_script/doc_classes/VisualScript.xml index 28764aca40..70849c5a80 100644 --- a/modules/visual_script/doc_classes/VisualScript.xml +++ b/modules/visual_script/doc_classes/VisualScript.xml @@ -9,7 +9,7 @@ You are most likely to use this class via the Visual Script editor or when writing plugins for it. </description> <tutorials> - <link>http://docs.godotengine.org/en/3.0/getting_started/scripting/visual_script/index.html</link> + <link>https://docs.godotengine.org/en/latest/getting_started/scripting/visual_script/index.html</link> </tutorials> <demos> </demos> diff --git a/platform/osx/os_osx.mm b/platform/osx/os_osx.mm index 77bf8a8146..985811e166 100644 --- a/platform/osx/os_osx.mm +++ b/platform/osx/os_osx.mm @@ -328,14 +328,14 @@ static Vector2 get_mouse_pos(NSPoint locationInWindow, CGFloat backingScaleFacto //_GodotPlatformSetCursorMode(window, window->cursorMode); [OS_OSX::singleton->context update]; - get_mouse_pos( - [OS_OSX::singleton->window_object mouseLocationOutsideOfEventStream], - [OS_OSX::singleton->window_view backingScaleFactor]); - if (OS_OSX::singleton->input) + if (OS_OSX::singleton->get_main_loop()) { + get_mouse_pos( + [OS_OSX::singleton->window_object mouseLocationOutsideOfEventStream], + [OS_OSX::singleton->window_view backingScaleFactor]); OS_OSX::singleton->input->set_mouse_position(Point2(mouse_x, mouse_y)); - if (OS_OSX::singleton->get_main_loop()) OS_OSX::singleton->get_main_loop()->notification(MainLoop::NOTIFICATION_WM_FOCUS_IN); + } } - (void)windowDidResignKey:(NSNotification *)notification { @@ -365,6 +365,8 @@ static Vector2 get_mouse_pos(NSPoint locationInWindow, CGFloat backingScaleFacto bool imeMode; } - (void)cancelComposition; +- (BOOL)wantsUpdateLayer; +- (void)updateLayer; @end @implementation GodotContentView @@ -375,6 +377,14 @@ static Vector2 get_mouse_pos(NSPoint locationInWindow, CGFloat backingScaleFacto } } +- (BOOL)wantsUpdateLayer { + return YES; +} + +- (void)updateLayer { + [OS_OSX::singleton->context update]; +} + - (id)init { self = [super init]; trackingArea = nil; diff --git a/platform/windows/os_windows.cpp b/platform/windows/os_windows.cpp index f8705c4bff..5e9f9bc59b 100644 --- a/platform/windows/os_windows.cpp +++ b/platform/windows/os_windows.cpp @@ -58,11 +58,8 @@ static const WORD MAX_CONSOLE_LINES = 1500; extern "C" { -#ifdef _MSC_VER -_declspec(dllexport) DWORD NvOptimusEnablement = 0x00000001; -#else -__attribute__((visibility("default"))) DWORD NvOptimusEnablement = 0x00000001; -#endif +__declspec(dllexport) DWORD NvOptimusEnablement = 1; +__declspec(dllexport) int AmdPowerXpressRequestHighPerformance = 1; } // Workaround mingw-w64 < 4.0 bug diff --git a/scene/2d/canvas_item.cpp b/scene/2d/canvas_item.cpp index fab0b7d433..d6d190fe4a 100644 --- a/scene/2d/canvas_item.cpp +++ b/scene/2d/canvas_item.cpp @@ -44,12 +44,19 @@ Mutex *CanvasItemMaterial::material_mutex = NULL; SelfList<CanvasItemMaterial>::List CanvasItemMaterial::dirty_materials; Map<CanvasItemMaterial::MaterialKey, CanvasItemMaterial::ShaderData> CanvasItemMaterial::shader_map; +CanvasItemMaterial::ShaderNames *CanvasItemMaterial::shader_names = NULL; void CanvasItemMaterial::init_shaders() { #ifndef NO_THREADS material_mutex = Mutex::create(); #endif + + shader_names = memnew(ShaderNames); + + shader_names->particles_anim_h_frames = "particles_anim_h_frames"; + shader_names->particles_anim_v_frames = "particles_anim_v_frames"; + shader_names->particles_anim_loop = "particles_anim_loop"; } void CanvasItemMaterial::finish_shaders() { @@ -102,7 +109,37 @@ void CanvasItemMaterial::_update_shader() { case LIGHT_MODE_UNSHADED: code += ",unshaded"; break; case LIGHT_MODE_LIGHT_ONLY: code += ",light_only"; break; } - code += ";\n"; //that's it. + + code += ";\n"; + + if (particles_animation) { + + code += "uniform int particles_anim_h_frames;\n"; + code += "uniform int particles_anim_v_frames;\n"; + code += "uniform bool particles_anim_loop;\n"; + + code += "void vertex() {\n"; + + code += "\tfloat h_frames = float(particles_anim_h_frames);\n"; + code += "\tfloat v_frames = float(particles_anim_v_frames);\n"; + + code += "\tVERTEX.xy /= TEXTURE_PIXEL_SIZE * vec2(h_frames, v_frames);\n"; + + code += "\tint total_frames = particles_anim_h_frames * particles_anim_v_frames;\n"; + code += "\tint frame = int(float(total_frames) * INSTANCE_CUSTOM.z);\n"; + code += "\tif (particles_anim_loop) {\n"; + code += "\t\tframe = abs(frame) % total_frames;\n"; + code += "\t} else {\n"; + code += "\t\tframe = clamp(frame, 0, total_frames - 1);\n"; + code += "\t}\n"; + + code += "\tfloat frame_w = 1.0 / h_frames;\n"; + code += "\tfloat frame_h = 1.0 / v_frames;\n"; + code += "\tUV.x = UV.x * frame_w + frame_w * float(frame % particles_anim_h_frames);\n"; + code += "\tUV.y = UV.y * frame_h + frame_h * float(frame / particles_anim_v_frames);\n"; + + code += "}\n"; + } ShaderData shader_data; shader_data.shader = VS::get_singleton()->shader_create(); @@ -177,7 +214,52 @@ CanvasItemMaterial::LightMode CanvasItemMaterial::get_light_mode() const { return light_mode; } +void CanvasItemMaterial::set_particles_animation(bool p_particles_anim) { + particles_animation = p_particles_anim; + _queue_shader_change(); + _change_notify(); +} + +bool CanvasItemMaterial::get_particles_animation() const { + return particles_animation; +} + +void CanvasItemMaterial::set_particles_anim_h_frames(int p_frames) { + + particles_anim_h_frames = p_frames; + VS::get_singleton()->material_set_param(_get_material(), shader_names->particles_anim_h_frames, p_frames); +} + +int CanvasItemMaterial::get_particles_anim_h_frames() const { + + return particles_anim_h_frames; +} +void CanvasItemMaterial::set_particles_anim_v_frames(int p_frames) { + + particles_anim_v_frames = p_frames; + VS::get_singleton()->material_set_param(_get_material(), shader_names->particles_anim_v_frames, p_frames); +} + +int CanvasItemMaterial::get_particles_anim_v_frames() const { + + return particles_anim_v_frames; +} + +void CanvasItemMaterial::set_particles_anim_loop(bool p_loop) { + + particles_anim_loop = p_loop; + VS::get_singleton()->material_set_param(_get_material(), shader_names->particles_anim_loop, particles_anim_loop); +} + +bool CanvasItemMaterial::get_particles_anim_loop() const { + + return particles_anim_loop; +} + void CanvasItemMaterial::_validate_property(PropertyInfo &property) const { + if (property.name.begins_with("particles_anim_") && !particles_animation) { + property.usage = 0; + } } RID CanvasItemMaterial::get_shader_rid() const { @@ -199,8 +281,25 @@ void CanvasItemMaterial::_bind_methods() { ClassDB::bind_method(D_METHOD("set_light_mode", "light_mode"), &CanvasItemMaterial::set_light_mode); ClassDB::bind_method(D_METHOD("get_light_mode"), &CanvasItemMaterial::get_light_mode); + ClassDB::bind_method(D_METHOD("set_particles_animation", "particles_anim"), &CanvasItemMaterial::set_particles_animation); + ClassDB::bind_method(D_METHOD("get_particles_animation"), &CanvasItemMaterial::get_particles_animation); + + ClassDB::bind_method(D_METHOD("set_particles_anim_h_frames", "frames"), &CanvasItemMaterial::set_particles_anim_h_frames); + ClassDB::bind_method(D_METHOD("get_particles_anim_h_frames"), &CanvasItemMaterial::get_particles_anim_h_frames); + + ClassDB::bind_method(D_METHOD("set_particles_anim_v_frames", "frames"), &CanvasItemMaterial::set_particles_anim_v_frames); + ClassDB::bind_method(D_METHOD("get_particles_anim_v_frames"), &CanvasItemMaterial::get_particles_anim_v_frames); + + ClassDB::bind_method(D_METHOD("set_particles_anim_loop", "loop"), &CanvasItemMaterial::set_particles_anim_loop); + ClassDB::bind_method(D_METHOD("get_particles_anim_loop"), &CanvasItemMaterial::get_particles_anim_loop); + ADD_PROPERTY(PropertyInfo(Variant::INT, "blend_mode", PROPERTY_HINT_ENUM, "Mix,Add,Sub,Mul,Premult Alpha"), "set_blend_mode", "get_blend_mode"); ADD_PROPERTY(PropertyInfo(Variant::INT, "light_mode", PROPERTY_HINT_ENUM, "Normal,Unshaded,Light Only"), "set_light_mode", "get_light_mode"); + ADD_PROPERTY(PropertyInfo(Variant::BOOL, "particles_animation"), "set_particles_animation", "get_particles_animation"); + + ADD_PROPERTY(PropertyInfo(Variant::INT, "particles_anim_h_frames", PROPERTY_HINT_RANGE, "1,128,1"), "set_particles_anim_h_frames", "get_particles_anim_h_frames"); + ADD_PROPERTY(PropertyInfo(Variant::INT, "particles_anim_v_frames", PROPERTY_HINT_RANGE, "1,128,1"), "set_particles_anim_v_frames", "get_particles_anim_v_frames"); + ADD_PROPERTY(PropertyInfo(Variant::BOOL, "particles_anim_loop"), "set_particles_anim_loop", "get_particles_anim_loop"); BIND_ENUM_CONSTANT(BLEND_MODE_MIX); BIND_ENUM_CONSTANT(BLEND_MODE_ADD); @@ -218,6 +317,11 @@ CanvasItemMaterial::CanvasItemMaterial() : blend_mode = BLEND_MODE_MIX; light_mode = LIGHT_MODE_NORMAL; + particles_animation = false; + + set_particles_anim_h_frames(1); + set_particles_anim_v_frames(1); + set_particles_anim_loop(false); current_key.key = 0; current_key.invalid_key = 1; diff --git a/scene/2d/canvas_item.h b/scene/2d/canvas_item.h index 36a0e4039a..9e2a93a8ee 100644 --- a/scene/2d/canvas_item.h +++ b/scene/2d/canvas_item.h @@ -70,6 +70,7 @@ private: struct { uint32_t blend_mode : 4; uint32_t light_mode : 4; + uint32_t particles_animation : 1; uint32_t invalid_key : 1; }; @@ -80,6 +81,14 @@ private: } }; + struct ShaderNames { + StringName particles_anim_h_frames; + StringName particles_anim_v_frames; + StringName particles_anim_loop; + }; + + static ShaderNames *shader_names; + struct ShaderData { RID shader; int users; @@ -95,6 +104,7 @@ private: mk.key = 0; mk.blend_mode = blend_mode; mk.light_mode = light_mode; + mk.particles_animation = particles_animation; return mk; } @@ -108,6 +118,11 @@ private: BlendMode blend_mode; LightMode light_mode; + bool particles_animation; + + int particles_anim_h_frames; + int particles_anim_v_frames; + bool particles_anim_loop; protected: static void _bind_methods(); @@ -120,6 +135,17 @@ public: void set_light_mode(LightMode p_light_mode); LightMode get_light_mode() const; + void set_particles_animation(bool p_particles_anim); + bool get_particles_animation() const; + + void set_particles_anim_h_frames(int p_frames); + int get_particles_anim_h_frames() const; + void set_particles_anim_v_frames(int p_frames); + int get_particles_anim_v_frames() const; + + void set_particles_anim_loop(bool p_frames); + bool get_particles_anim_loop() const; + static void init_shaders(); static void finish_shaders(); static void flush_changes(); diff --git a/scene/2d/cpu_particles_2d.cpp b/scene/2d/cpu_particles_2d.cpp index e6dcd643be..b6e2f4f5cd 100644 --- a/scene/2d/cpu_particles_2d.cpp +++ b/scene/2d/cpu_particles_2d.cpp @@ -29,8 +29,9 @@ /*************************************************************************/ #include "cpu_particles_2d.h" - -//#include "scene/resources/particles_material.h" +#include "particles_2d.h" +#include "scene/2d/canvas_item.h" +#include "scene/resources/particles_material.h" #include "servers/visual_server.h" void CPUParticles2D::set_emitting(bool p_emitting) { @@ -152,19 +153,13 @@ CPUParticles2D::DrawOrder CPUParticles2D::get_draw_order() const { return draw_order; } -void CPUParticles2D::_update_mesh_texture() { +void CPUParticles2D::_generate_mesh_texture() { - Size2 tex_size; - if (texture.is_valid()) { - tex_size = texture->get_size(); - } else { - tex_size = Size2(1, 1); - } PoolVector<Vector2> vertices; - vertices.push_back(-tex_size * 0.5); - vertices.push_back(-tex_size * 0.5 + Vector2(tex_size.x, 0)); - vertices.push_back(-tex_size * 0.5 + Vector2(tex_size.x, tex_size.y)); - vertices.push_back(-tex_size * 0.5 + Vector2(0, tex_size.y)); + vertices.push_back(Vector2(-0.5, -0.5)); + vertices.push_back(Vector2(0.5, -0.5)); + vertices.push_back(Vector2(0.5, 0.5)); + vertices.push_back(Vector2(-0.5, 0.5)); PoolVector<Vector2> uvs; uvs.push_back(Vector2(0, 0)); uvs.push_back(Vector2(1, 0)); @@ -198,7 +193,6 @@ void CPUParticles2D::set_texture(const Ref<Texture> &p_texture) { texture = p_texture; update(); - _update_mesh_texture(); } Ref<Texture> CPUParticles2D::get_texture() const { @@ -237,6 +231,14 @@ String CPUParticles2D::get_configuration_warning() const { String warnings; + CanvasItemMaterial *mat = Object::cast_to<CanvasItemMaterial>(get_material().ptr()); + + if (get_material().is_null() || (mat && !mat->get_particles_animation())) { + if (warnings != String()) + warnings += "\n"; + warnings += "- " + TTR("CPUParticles2D animation requires the usage of a CanvasItemMaterial with \"Particles Animation\" enabled."); + } + return warnings; } @@ -396,6 +398,7 @@ bool CPUParticles2D::get_particle_flag(Flags p_flag) const { void CPUParticles2D::set_emission_shape(EmissionShape p_shape) { emission_shape = p_shape; + _change_notify(); } void CPUParticles2D::set_emission_sphere_radius(float p_radius) { @@ -479,6 +482,15 @@ void CPUParticles2D::_validate_property(PropertyInfo &property) const { if (property.name == "emission_normals" && emission_shape != EMISSION_SHAPE_DIRECTED_POINTS) { property.usage = 0; } + + if (property.name == "emission_points" && emission_shape != EMISSION_SHAPE_POINTS && emission_shape != EMISSION_SHAPE_DIRECTED_POINTS) { + property.usage = 0; + } + + if (property.name == "emission_colors" && emission_shape != EMISSION_SHAPE_POINTS && emission_shape != EMISSION_SHAPE_DIRECTED_POINTS) { + property.usage = 0; + } + /* if (property.name.begins_with("orbit_") && !flags[FLAG_DISABLE_Z]) { property.usage = 0; @@ -531,7 +543,7 @@ void CPUParticles2D::_particles_process(float p_delta) { if (!local_coords) { emission_xform = get_global_transform(); velocity_xform = emission_xform; - emission_xform[2] = Vector2(); + velocity_xform[2] = Vector2(); } for (int i = 0; i < pcount; i++) { @@ -618,9 +630,12 @@ void CPUParticles2D::_particles_process(float p_delta) { p.velocity = rot * parameters[PARAM_INITIAL_LINEAR_VELOCITY] * Math::lerp(1.0f, float(Math::randf()), randomness[PARAM_INITIAL_LINEAR_VELOCITY]); float base_angle = (parameters[PARAM_ANGLE] + tex_angle) * Math::lerp(1.0f, p.angle_rand, randomness[PARAM_ANGLE]); - p.custom[0] = Math::deg2rad(base_angle); //angle - p.custom[1] = 0.0; //phase - p.custom[2] = (parameters[PARAM_ANIM_OFFSET] + tex_anim_offset) * Math::lerp(1.0f, p.anim_offset_rand, randomness[PARAM_ANIM_OFFSET]); //animation offset (0-1) + p.rotation = Math::deg2rad(base_angle); + + p.custom[0] = 0.0; // unused + p.custom[1] = 0.0; // phase [0..1] + p.custom[2] = (parameters[PARAM_ANIM_OFFSET] + tex_anim_offset) * Math::lerp(1.0f, p.anim_offset_rand, randomness[PARAM_ANIM_OFFSET]); //animation phase [0..1] + p.custom[3] = 0.0; p.transform = Transform2D(); p.time = 0; p.base_color = Color(1, 1, 1, 1); @@ -767,14 +782,9 @@ void CPUParticles2D::_particles_process(float p_delta) { } float base_angle = (parameters[PARAM_ANGLE] + tex_angle) * Math::lerp(1.0f, p.angle_rand, randomness[PARAM_ANGLE]); base_angle += p.custom[1] * lifetime * (parameters[PARAM_ANGULAR_VELOCITY] + tex_angular_velocity) * Math::lerp(1.0f, rand_from_seed(alt_seed) * 2.0f - 1.0f, randomness[PARAM_ANGULAR_VELOCITY]); - p.custom[0] = Math::deg2rad(base_angle); //angle - p.custom[2] = (parameters[PARAM_ANIM_OFFSET] + tex_anim_offset) * Math::lerp(1.0f, p.anim_offset_rand, randomness[PARAM_ANIM_OFFSET]) + p.custom[1] * (parameters[PARAM_ANIM_SPEED] + tex_anim_speed) * Math::lerp(1.0f, rand_from_seed(alt_seed), randomness[PARAM_ANIM_SPEED]); //angle - if (flags[FLAG_ANIM_LOOP]) { - p.custom[2] = Math::fmod(p.custom[2], 1.0f); //loop - - } else { - p.custom[2] = CLAMP(p.custom[2], 0.0f, 1.0); //0 to 1 only - } + p.rotation = Math::deg2rad(base_angle); //angle + float animation_phase = (parameters[PARAM_ANIM_OFFSET] + tex_anim_offset) * Math::lerp(1.0f, p.anim_offset_rand, randomness[PARAM_ANIM_OFFSET]) + p.custom[1] * (parameters[PARAM_ANIM_SPEED] + tex_anim_speed) * Math::lerp(1.0f, rand_from_seed(alt_seed), randomness[PARAM_ANIM_SPEED]); + p.custom[2] = animation_phase; } //apply color //apply hue rotation @@ -825,8 +835,8 @@ void CPUParticles2D::_particles_process(float p_delta) { } } else { - p.transform.elements[0] = Vector2(Math::cos(p.custom[0]), -Math::sin(p.custom[0])); - p.transform.elements[1] = Vector2(Math::sin(p.custom[0]), Math::cos(p.custom[0])); + p.transform.elements[0] = Vector2(Math::cos(p.rotation), -Math::sin(p.rotation)); + p.transform.elements[1] = Vector2(Math::sin(p.rotation), Math::cos(p.rotation)); } //scale by scale @@ -1058,8 +1068,7 @@ void CPUParticles2D::_notification(int p_what) { } void CPUParticles2D::convert_from_particles(Node *p_particles) { -#if 0 - Particles *particles = Object::cast_to<Particles>(p_particles); + Particles2D *particles = Object::cast_to<Particles2D>(p_particles); ERR_FAIL_COND(!particles); set_emitting(particles->is_emitting()); @@ -1074,7 +1083,12 @@ void CPUParticles2D::convert_from_particles(Node *p_particles) { set_fractional_delta(particles->get_fractional_delta()); set_speed_scale(particles->get_speed_scale()); set_draw_order(DrawOrder(particles->get_draw_order())); - set_mesh(particles->get_draw_pass_mesh(0)); + set_texture(particles->get_texture()); + + Ref<Material> mat = particles->get_material(); + if (mat.is_valid()) { + set_material(mat); + } Ref<ParticlesMaterial> material = particles->get_process_material(); if (material.is_null()) @@ -1091,15 +1105,14 @@ void CPUParticles2D::convert_from_particles(Node *p_particles) { } set_particle_flag(FLAG_ALIGN_Y_TO_VELOCITY, material->get_flag(ParticlesMaterial::FLAG_ALIGN_Y_TO_VELOCITY)); - set_particle_flag(FLAG_ROTATE_Y, material->get_flag(ParticlesMaterial::FLAG_ROTATE_Y)); - set_particle_flag(FLAG_DISABLE_Z, material->get_flag(ParticlesMaterial::FLAG_DISABLE_Z)); - set_particle_flag(FLAG_ANIM_LOOP, material->get_flag(ParticlesMaterial::FLAG_ANIM_LOOP)); set_emission_shape(EmissionShape(material->get_emission_shape())); set_emission_sphere_radius(material->get_emission_sphere_radius()); - set_emission_rect_extents(material->get_emission_rect_extents()); + Vector2 rect_extents = Vector2(material->get_emission_box_extents().x, material->get_emission_box_extents().y); + set_emission_rect_extents(rect_extents); - set_gravity(material->get_gravity()); + Vector2 gravity = Vector2(material->get_gravity().x, material->get_gravity().y); + set_gravity(gravity); #define CONVERT_PARAM(m_param) \ set_param(m_param, material->get_param(ParticlesMaterial::m_param)); \ @@ -1123,7 +1136,6 @@ void CPUParticles2D::convert_from_particles(Node *p_particles) { CONVERT_PARAM(PARAM_ANIM_OFFSET); #undef CONVERT_PARAM -#endif } void CPUParticles2D::_bind_methods() { @@ -1301,7 +1313,6 @@ void CPUParticles2D::_bind_methods() { ADD_PROPERTYI(PropertyInfo(Variant::REAL, "anim_offset", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_param", "get_param", PARAM_ANIM_OFFSET); ADD_PROPERTYI(PropertyInfo(Variant::REAL, "anim_offset_random", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_param_randomness", "get_param_randomness", PARAM_ANIM_OFFSET); ADD_PROPERTYI(PropertyInfo(Variant::OBJECT, "anim_offset_curve", PROPERTY_HINT_RESOURCE_TYPE, "Curve"), "set_param_curve", "get_param_curve", PARAM_ANIM_OFFSET); - ADD_PROPERTYI(PropertyInfo(Variant::BOOL, "anim_loop"), "set_particle_flag", "get_particle_flag", FLAG_ANIM_LOOP); BIND_ENUM_CONSTANT(PARAM_INITIAL_LINEAR_VELOCITY); BIND_ENUM_CONSTANT(PARAM_ANGULAR_VELOCITY); @@ -1385,7 +1396,7 @@ CPUParticles2D::CPUParticles2D() { update_mutex = Mutex::create(); #endif - _update_mesh_texture(); + _generate_mesh_texture(); } CPUParticles2D::~CPUParticles2D() { diff --git a/scene/2d/cpu_particles_2d.h b/scene/2d/cpu_particles_2d.h index 4f51eb1062..15b7642b5e 100644 --- a/scene/2d/cpu_particles_2d.h +++ b/scene/2d/cpu_particles_2d.h @@ -68,7 +68,6 @@ public: enum Flags { FLAG_ALIGN_Y_TO_VELOCITY, - FLAG_ANIM_LOOP, FLAG_MAX }; @@ -87,6 +86,7 @@ private: Transform2D transform; Color color; float custom[4]; + float rotation; Vector2 velocity; bool active; float angle_rand; @@ -168,7 +168,6 @@ private: PoolVector<Color> emission_colors; int emission_point_count; - bool anim_loop; Vector2 gravity; void _particles_process(float p_delta); @@ -178,7 +177,7 @@ private: void _update_render_thread(); - void _update_mesh_texture(); + void _generate_mesh_texture(); protected: static void _bind_methods(); @@ -223,6 +222,15 @@ public: void set_texture(const Ref<Texture> &p_texture); Ref<Texture> get_texture() const; + void set_h_frames(int p_frames); + int get_h_frames(); + + void set_v_frames(int p_frames); + int get_v_frames(); + + void set_loop_animation(bool p_loop); + bool get_loop_animation() const; + void set_normalmap(const Ref<Texture> &p_normalmap); Ref<Texture> get_normalmap() const; diff --git a/scene/2d/line_builder.cpp b/scene/2d/line_builder.cpp index a3f1b25e05..d5e8a33805 100644 --- a/scene/2d/line_builder.cpp +++ b/scene/2d/line_builder.cpp @@ -294,7 +294,6 @@ void LineBuilder::build() { if (texture_mode == Line2D::LINE_TEXTURE_TILE) { uvx1 = current_distance1 / (width * tile_aspect); } else if (texture_mode == Line2D::LINE_TEXTURE_STRETCH) { - uvx0 = current_distance0 / total_distance; uvx1 = current_distance1 / total_distance; } diff --git a/scene/2d/particles_2d.cpp b/scene/2d/particles_2d.cpp index 7e824cdf75..9c01d81c11 100644 --- a/scene/2d/particles_2d.cpp +++ b/scene/2d/particles_2d.cpp @@ -257,30 +257,6 @@ Ref<Texture> Particles2D::get_normal_map() const { void Particles2D::_validate_property(PropertyInfo &property) const { } -void Particles2D::set_v_frames(int p_count) { - - ERR_FAIL_COND(p_count < 1); - v_frames = p_count; - update(); -} - -int Particles2D::get_v_frames() const { - - return v_frames; -} - -void Particles2D::set_h_frames(int p_count) { - - ERR_FAIL_COND(p_count < 1); - h_frames = p_count; - update(); -} - -int Particles2D::get_h_frames() const { - - return h_frames; -} - void Particles2D::restart() { VS::get_singleton()->particles_restart(particles); } @@ -296,7 +272,7 @@ void Particles2D::_notification(int p_what) { if (normal_map.is_valid()) normal_rid = normal_map->get_rid(); - VS::get_singleton()->canvas_item_add_particles(get_canvas_item(), particles, texture_rid, normal_rid, h_frames, v_frames); + VS::get_singleton()->canvas_item_add_particles(get_canvas_item(), particles, texture_rid, normal_rid); #ifdef TOOLS_ENABLED if (Engine::get_singleton()->is_editor_hint() && (this == get_tree()->get_edited_scene_root() || get_tree()->get_edited_scene_root()->is_a_parent_of(this))) { @@ -361,12 +337,6 @@ void Particles2D::_bind_methods() { ClassDB::bind_method(D_METHOD("capture_rect"), &Particles2D::capture_rect); - ClassDB::bind_method(D_METHOD("set_v_frames", "frames"), &Particles2D::set_v_frames); - ClassDB::bind_method(D_METHOD("get_v_frames"), &Particles2D::get_v_frames); - - ClassDB::bind_method(D_METHOD("set_h_frames", "frames"), &Particles2D::set_h_frames); - ClassDB::bind_method(D_METHOD("get_h_frames"), &Particles2D::get_h_frames); - ClassDB::bind_method(D_METHOD("restart"), &Particles2D::restart); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "emitting"), "set_emitting", "is_emitting"); @@ -389,8 +359,6 @@ void Particles2D::_bind_methods() { ADD_GROUP("Textures", ""); ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "texture", PROPERTY_HINT_RESOURCE_TYPE, "Texture"), "set_texture", "get_texture"); ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "normal_map", PROPERTY_HINT_RESOURCE_TYPE, "Texture"), "set_normal_map", "get_normal_map"); - ADD_PROPERTY(PropertyInfo(Variant::INT, "h_frames", PROPERTY_HINT_RANGE, "1,1024,1"), "set_h_frames", "get_h_frames"); - ADD_PROPERTY(PropertyInfo(Variant::INT, "v_frames", PROPERTY_HINT_RANGE, "1,1024,1"), "set_v_frames", "get_v_frames"); BIND_ENUM_CONSTANT(DRAW_ORDER_INDEX); BIND_ENUM_CONSTANT(DRAW_ORDER_LIFETIME); @@ -413,8 +381,6 @@ Particles2D::Particles2D() { set_use_local_coordinates(true); set_draw_order(DRAW_ORDER_INDEX); set_speed_scale(1); - h_frames = 1; - v_frames = 1; } Particles2D::~Particles2D() { diff --git a/scene/2d/particles_2d.h b/scene/2d/particles_2d.h index af673841b1..6d52f8b28e 100644 --- a/scene/2d/particles_2d.h +++ b/scene/2d/particles_2d.h @@ -59,8 +59,6 @@ private: bool local_coords; int fixed_fps; bool fractional_delta; - int v_frames; - int h_frames; Ref<Material> process_material; @@ -118,12 +116,6 @@ public: virtual String get_configuration_warning() const; - void set_v_frames(int p_count); - int get_v_frames() const; - - void set_h_frames(int p_count); - int get_h_frames() const; - void restart(); Rect2 capture_rect() const; Particles2D(); diff --git a/scene/3d/cpu_particles.cpp b/scene/3d/cpu_particles.cpp index 35a2049bda..e17e65c97e 100644 --- a/scene/3d/cpu_particles.cpp +++ b/scene/3d/cpu_particles.cpp @@ -781,12 +781,6 @@ void CPUParticles::_particles_process(float p_delta) { base_angle += p.custom[1] * lifetime * (parameters[PARAM_ANGULAR_VELOCITY] + tex_angular_velocity) * Math::lerp(1.0f, rand_from_seed(alt_seed) * 2.0f - 1.0f, randomness[PARAM_ANGULAR_VELOCITY]); p.custom[0] = Math::deg2rad(base_angle); //angle p.custom[2] = (parameters[PARAM_ANIM_OFFSET] + tex_anim_offset) * Math::lerp(1.0f, p.anim_offset_rand, randomness[PARAM_ANIM_OFFSET]) + p.custom[1] * (parameters[PARAM_ANIM_SPEED] + tex_anim_speed) * Math::lerp(1.0f, rand_from_seed(alt_seed), randomness[PARAM_ANIM_SPEED]); //angle - if (flags[FLAG_ANIM_LOOP]) { - p.custom[2] = Math::fmod(p.custom[2], 1.0f); //loop - - } else { - p.custom[2] = CLAMP(p.custom[2], 0.0f, 1.0); //0 to 1 only - } } //apply color //apply hue rotation @@ -1151,7 +1145,6 @@ void CPUParticles::convert_from_particles(Node *p_particles) { set_particle_flag(FLAG_ALIGN_Y_TO_VELOCITY, material->get_flag(ParticlesMaterial::FLAG_ALIGN_Y_TO_VELOCITY)); set_particle_flag(FLAG_ROTATE_Y, material->get_flag(ParticlesMaterial::FLAG_ROTATE_Y)); set_particle_flag(FLAG_DISABLE_Z, material->get_flag(ParticlesMaterial::FLAG_DISABLE_Z)); - set_particle_flag(FLAG_ANIM_LOOP, material->get_flag(ParticlesMaterial::FLAG_ANIM_LOOP)); set_emission_shape(EmissionShape(material->get_emission_shape())); set_emission_sphere_radius(material->get_emission_sphere_radius()); @@ -1357,7 +1350,6 @@ void CPUParticles::_bind_methods() { ADD_PROPERTYI(PropertyInfo(Variant::REAL, "anim_offset", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_param", "get_param", PARAM_ANIM_OFFSET); ADD_PROPERTYI(PropertyInfo(Variant::REAL, "anim_offset_random", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_param_randomness", "get_param_randomness", PARAM_ANIM_OFFSET); ADD_PROPERTYI(PropertyInfo(Variant::OBJECT, "anim_offset_curve", PROPERTY_HINT_RESOURCE_TYPE, "Curve"), "set_param_curve", "get_param_curve", PARAM_ANIM_OFFSET); - ADD_PROPERTYI(PropertyInfo(Variant::BOOL, "anim_loop"), "set_particle_flag", "get_particle_flag", FLAG_ANIM_LOOP); BIND_ENUM_CONSTANT(PARAM_INITIAL_LINEAR_VELOCITY); BIND_ENUM_CONSTANT(PARAM_ANGULAR_VELOCITY); diff --git a/scene/3d/cpu_particles.h b/scene/3d/cpu_particles.h index 77a144b70b..2e83924dfc 100644 --- a/scene/3d/cpu_particles.h +++ b/scene/3d/cpu_particles.h @@ -70,7 +70,6 @@ public: FLAG_ALIGN_Y_TO_VELOCITY, FLAG_ROTATE_Y, FLAG_DISABLE_Z, - FLAG_ANIM_LOOP, FLAG_MAX }; @@ -170,7 +169,6 @@ private: PoolVector<Color> emission_colors; int emission_point_count; - bool anim_loop; Vector3 gravity; void _particles_process(float p_delta); diff --git a/scene/animation/animation_blend_tree.cpp b/scene/animation/animation_blend_tree.cpp index b85d4e541e..b037596fda 100644 --- a/scene/animation/animation_blend_tree.cpp +++ b/scene/animation/animation_blend_tree.cpp @@ -266,7 +266,6 @@ float AnimationNodeOneShot::process(float p_time, bool p_seek) { if (do_start) { remaining = os_rem; - do_start = false; } if (!p_seek) { @@ -770,8 +769,6 @@ float AnimationNodeTransition::process(float p_time, bool p_seek) { rem = blend_input(current, p_time, p_seek, 1.0 - blend, FILTER_IGNORE, false); } - switched = false; - if (p_seek) { // don't seek prev animation blend_input(prev, 0, false, blend, FILTER_IGNORE, false); time = p_time; diff --git a/scene/animation/animation_node_state_machine.cpp b/scene/animation/animation_node_state_machine.cpp index 5923ad7657..a7af3f687b 100644 --- a/scene/animation/animation_node_state_machine.cpp +++ b/scene/animation/animation_node_state_machine.cpp @@ -345,7 +345,6 @@ float AnimationNodeStateMachinePlayback::process(AnimationNodeStateMachine *sm, len_current = sm->blend_node(current, sm->states[current].node, 0, true, 1.0, AnimationNode::FILTER_IGNORE, false); pos_current = 0; loops_current = 0; - play_start = false; } if (!sm->states.has(current)) { diff --git a/scene/resources/material.cpp b/scene/resources/material.cpp index c3030ee741..a9d7b2adf7 100644 --- a/scene/resources/material.cpp +++ b/scene/resources/material.cpp @@ -612,7 +612,7 @@ void SpatialMaterial::_update_shader() { //handle animation code += "\tfloat particle_total_frames = float(particles_anim_h_frames * particles_anim_v_frames);\n"; code += "\tfloat particle_frame = floor(INSTANCE_CUSTOM.z * float(particle_total_frames));\n"; - code += "\tif (particles_anim_loop) particle_frame=clamp(particle_frame,0.0,particle_total_frames-1.0); else particle_frame=mod(particle_frame,float(particle_total_frames));\n"; + code += "\tif (!particles_anim_loop) particle_frame=clamp(particle_frame,0.0,particle_total_frames-1.0); else particle_frame=mod(particle_frame,float(particle_total_frames));\n"; code += "\tUV /= vec2(float(particles_anim_h_frames),float(particles_anim_v_frames));\n"; code += "\tUV += vec2(mod(particle_frame,float(particles_anim_h_frames)) / float(particles_anim_h_frames), floor(particle_frame / float(particles_anim_h_frames)) / float(particles_anim_v_frames));\n"; } break; @@ -1541,13 +1541,13 @@ int SpatialMaterial::get_particles_anim_v_frames() const { return particles_anim_v_frames; } -void SpatialMaterial::set_particles_anim_loop(int p_frames) { +void SpatialMaterial::set_particles_anim_loop(bool p_loop) { - particles_anim_loop = p_frames; - VS::get_singleton()->material_set_param(_get_material(), shader_names->particles_anim_loop, p_frames); + particles_anim_loop = p_loop; + VS::get_singleton()->material_set_param(_get_material(), shader_names->particles_anim_loop, particles_anim_loop); } -int SpatialMaterial::get_particles_anim_loop() const { +bool SpatialMaterial::get_particles_anim_loop() const { return particles_anim_loop; } @@ -1898,7 +1898,7 @@ void SpatialMaterial::_bind_methods() { ClassDB::bind_method(D_METHOD("set_particles_anim_v_frames", "frames"), &SpatialMaterial::set_particles_anim_v_frames); ClassDB::bind_method(D_METHOD("get_particles_anim_v_frames"), &SpatialMaterial::get_particles_anim_v_frames); - ClassDB::bind_method(D_METHOD("set_particles_anim_loop", "frames"), &SpatialMaterial::set_particles_anim_loop); + ClassDB::bind_method(D_METHOD("set_particles_anim_loop", "loop"), &SpatialMaterial::set_particles_anim_loop); ClassDB::bind_method(D_METHOD("get_particles_anim_loop"), &SpatialMaterial::get_particles_anim_loop); ClassDB::bind_method(D_METHOD("set_depth_deep_parallax", "enable"), &SpatialMaterial::set_depth_deep_parallax); diff --git a/scene/resources/material.h b/scene/resources/material.h index cf4d19b5a7..49b4a79d92 100644 --- a/scene/resources/material.h +++ b/scene/resources/material.h @@ -574,8 +574,8 @@ public: void set_particles_anim_v_frames(int p_frames); int get_particles_anim_v_frames() const; - void set_particles_anim_loop(int p_frames); - int get_particles_anim_loop() const; + void set_particles_anim_loop(bool p_loop); + bool get_particles_anim_loop() const; void set_grow_enabled(bool p_enable); bool is_grow_enabled() const; diff --git a/scene/resources/particles_material.cpp b/scene/resources/particles_material.cpp index ba48982fda..dacbe168fd 100644 --- a/scene/resources/particles_material.cpp +++ b/scene/resources/particles_material.cpp @@ -463,12 +463,6 @@ void ParticlesMaterial::_update_shader() { code += " base_angle += CUSTOM.y * LIFETIME * (angular_velocity + tex_angular_velocity) * mix(1.0, rand_from_seed(alt_seed) * 2.0 - 1.0, angular_velocity_random);\n"; code += " CUSTOM.x = base_angle * degree_to_rad;\n"; // angle code += " CUSTOM.z = (anim_offset + tex_anim_offset) * mix(1.0, anim_offset_rand, anim_offset_random) + CUSTOM.y * (anim_speed + tex_anim_speed) * mix(1.0, rand_from_seed(alt_seed), anim_speed_random);\n"; // angle - if (flags[FLAG_ANIM_LOOP]) { - code += " CUSTOM.z = mod(CUSTOM.z, 1.0);\n"; // loop - - } else { - code += " CUSTOM.z = clamp(CUSTOM.z, 0.0, 1.0);\n"; // 0 to 1 only - } code += " }\n"; // apply color // apply hue rotation @@ -1175,7 +1169,6 @@ void ParticlesMaterial::_bind_methods() { ADD_PROPERTYI(PropertyInfo(Variant::REAL, "anim_offset", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_param", "get_param", PARAM_ANIM_OFFSET); ADD_PROPERTYI(PropertyInfo(Variant::REAL, "anim_offset_random", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_param_randomness", "get_param_randomness", PARAM_ANIM_OFFSET); ADD_PROPERTYI(PropertyInfo(Variant::OBJECT, "anim_offset_curve", PROPERTY_HINT_RESOURCE_TYPE, "CurveTexture"), "set_param_texture", "get_param_texture", PARAM_ANIM_OFFSET); - ADD_PROPERTYI(PropertyInfo(Variant::BOOL, "anim_loop"), "set_flag", "get_flag", FLAG_ANIM_LOOP); BIND_ENUM_CONSTANT(PARAM_INITIAL_LINEAR_VELOCITY); BIND_ENUM_CONSTANT(PARAM_ANGULAR_VELOCITY); diff --git a/scene/resources/particles_material.h b/scene/resources/particles_material.h index 91fdcc0346..06ebb3c4dc 100644 --- a/scene/resources/particles_material.h +++ b/scene/resources/particles_material.h @@ -60,7 +60,6 @@ public: FLAG_ALIGN_Y_TO_VELOCITY, FLAG_ROTATE_Y, FLAG_DISABLE_Z, - FLAG_ANIM_LOOP, FLAG_MAX }; diff --git a/servers/visual/rasterizer.h b/servers/visual/rasterizer.h index 8c3736a1bf..f87f838fd6 100644 --- a/servers/visual/rasterizer.h +++ b/servers/visual/rasterizer.h @@ -800,8 +800,6 @@ public: RID particles; RID texture; RID normal_map; - int h_frames; - int v_frames; CommandParticles() { type = TYPE_PARTICLES; } }; diff --git a/servers/visual/shader_types.cpp b/servers/visual/shader_types.cpp index 69acf52e17..baafe2f8d0 100644 --- a/servers/visual/shader_types.cpp +++ b/servers/visual/shader_types.cpp @@ -199,6 +199,7 @@ ShaderTypes::ShaderTypes() { shader_modes[VS::SHADER_CANVAS_ITEM].functions["vertex"].built_ins["TIME"] = constt(ShaderLanguage::TYPE_FLOAT); shader_modes[VS::SHADER_CANVAS_ITEM].functions["vertex"].built_ins["INSTANCE_CUSTOM"] = constt(ShaderLanguage::TYPE_VEC4); shader_modes[VS::SHADER_CANVAS_ITEM].functions["vertex"].built_ins["AT_LIGHT_PASS"] = constt(ShaderLanguage::TYPE_BOOL); + shader_modes[VS::SHADER_CANVAS_ITEM].functions["vertex"].built_ins["TEXTURE_PIXEL_SIZE"] = constt(ShaderLanguage::TYPE_VEC2); shader_modes[VS::SHADER_CANVAS_ITEM].functions["vertex"].can_discard = false; shader_modes[VS::SHADER_CANVAS_ITEM].functions["fragment"].built_ins["FRAGCOORD"] = constt(ShaderLanguage::TYPE_VEC4); diff --git a/servers/visual/visual_server_canvas.cpp b/servers/visual/visual_server_canvas.cpp index 3c8088c75c..84b7504ad4 100644 --- a/servers/visual/visual_server_canvas.cpp +++ b/servers/visual/visual_server_canvas.cpp @@ -776,7 +776,7 @@ void VisualServerCanvas::canvas_item_add_mesh(RID p_item, const RID &p_mesh, RID canvas_item->commands.push_back(m); } -void VisualServerCanvas::canvas_item_add_particles(RID p_item, RID p_particles, RID p_texture, RID p_normal, int p_h_frames, int p_v_frames) { +void VisualServerCanvas::canvas_item_add_particles(RID p_item, RID p_particles, RID p_texture, RID p_normal) { Item *canvas_item = canvas_item_owner.getornull(p_item); ERR_FAIL_COND(!canvas_item); @@ -786,8 +786,6 @@ void VisualServerCanvas::canvas_item_add_particles(RID p_item, RID p_particles, part->particles = p_particles; part->texture = p_texture; part->normal_map = p_normal; - part->h_frames = p_h_frames; - part->v_frames = p_v_frames; //take the chance and request processing for them, at least once until they become visible again VSG::storage->particles_request_process(p_particles); diff --git a/servers/visual/visual_server_canvas.h b/servers/visual/visual_server_canvas.h index 966b51d341..d12bd520bf 100644 --- a/servers/visual/visual_server_canvas.h +++ b/servers/visual/visual_server_canvas.h @@ -186,7 +186,7 @@ public: void canvas_item_add_triangle_array(RID p_item, const Vector<int> &p_indices, const Vector<Point2> &p_points, const Vector<Color> &p_colors, const Vector<Point2> &p_uvs = Vector<Point2>(), const Vector<int> &p_bones = Vector<int>(), const Vector<float> &p_weights = Vector<float>(), RID p_texture = RID(), int p_count = -1, RID p_normal_map = RID()); void canvas_item_add_mesh(RID p_item, const RID &p_mesh, RID p_texture = RID(), RID p_normal_map = RID()); void canvas_item_add_multimesh(RID p_item, RID p_mesh, RID p_texture = RID(), RID p_normal_map = RID()); - void canvas_item_add_particles(RID p_item, RID p_particles, RID p_texture, RID p_normal, int p_h_frames, int p_v_frames); + void canvas_item_add_particles(RID p_item, RID p_particles, RID p_texture, RID p_normal); void canvas_item_add_set_transform(RID p_item, const Transform2D &p_transform); void canvas_item_add_clip_ignore(RID p_item, bool p_ignore); void canvas_item_set_sort_children_by_y(RID p_item, bool p_enable); diff --git a/servers/visual/visual_server_raster.h b/servers/visual/visual_server_raster.h index fc77dcc562..b33ef21e78 100644 --- a/servers/visual/visual_server_raster.h +++ b/servers/visual/visual_server_raster.h @@ -599,7 +599,7 @@ public: BIND10(canvas_item_add_triangle_array, RID, const Vector<int> &, const Vector<Point2> &, const Vector<Color> &, const Vector<Point2> &, const Vector<int> &, const Vector<float> &, RID, int, RID) BIND4(canvas_item_add_mesh, RID, const RID &, RID, RID) BIND4(canvas_item_add_multimesh, RID, RID, RID, RID) - BIND6(canvas_item_add_particles, RID, RID, RID, RID, int, int) + BIND4(canvas_item_add_particles, RID, RID, RID, RID) BIND2(canvas_item_add_set_transform, RID, const Transform2D &) BIND2(canvas_item_add_clip_ignore, RID, bool) BIND2(canvas_item_set_sort_children_by_y, RID, bool) diff --git a/servers/visual/visual_server_wrap_mt.h b/servers/visual/visual_server_wrap_mt.h index 0b435a26aa..137fcb55f4 100644 --- a/servers/visual/visual_server_wrap_mt.h +++ b/servers/visual/visual_server_wrap_mt.h @@ -516,7 +516,7 @@ public: FUNC10(canvas_item_add_triangle_array, RID, const Vector<int> &, const Vector<Point2> &, const Vector<Color> &, const Vector<Point2> &, const Vector<int> &, const Vector<float> &, RID, int, RID) FUNC4(canvas_item_add_mesh, RID, const RID &, RID, RID) FUNC4(canvas_item_add_multimesh, RID, RID, RID, RID) - FUNC6(canvas_item_add_particles, RID, RID, RID, RID, int, int) + FUNC4(canvas_item_add_particles, RID, RID, RID, RID) FUNC2(canvas_item_add_set_transform, RID, const Transform2D &) FUNC2(canvas_item_add_clip_ignore, RID, bool) FUNC2(canvas_item_set_sort_children_by_y, RID, bool) diff --git a/servers/visual_server.cpp b/servers/visual_server.cpp index b8477daa66..4b0e5cd28d 100644 --- a/servers/visual_server.cpp +++ b/servers/visual_server.cpp @@ -1978,7 +1978,7 @@ void VisualServer::_bind_methods() { ClassDB::bind_method(D_METHOD("canvas_item_add_triangle_array", "item", "indices", "points", "colors", "uvs", "bones", "weights", "texture", "count", "normal_map"), &VisualServer::canvas_item_add_triangle_array, DEFVAL(Vector<Point2>()), DEFVAL(Vector<int>()), DEFVAL(Vector<float>()), DEFVAL(RID()), DEFVAL(-1), DEFVAL(RID())); ClassDB::bind_method(D_METHOD("canvas_item_add_mesh", "item", "mesh", "texture", "normal_map"), &VisualServer::canvas_item_add_mesh, DEFVAL(RID())); ClassDB::bind_method(D_METHOD("canvas_item_add_multimesh", "item", "mesh", "texture", "normal_map"), &VisualServer::canvas_item_add_multimesh, DEFVAL(RID())); - ClassDB::bind_method(D_METHOD("canvas_item_add_particles", "item", "particles", "texture", "normal_map", "h_frames", "v_frames"), &VisualServer::canvas_item_add_particles); + ClassDB::bind_method(D_METHOD("canvas_item_add_particles", "item", "particles", "texture", "normal_map"), &VisualServer::canvas_item_add_particles); ClassDB::bind_method(D_METHOD("canvas_item_add_set_transform", "item", "transform"), &VisualServer::canvas_item_add_set_transform); ClassDB::bind_method(D_METHOD("canvas_item_add_clip_ignore", "item", "ignore"), &VisualServer::canvas_item_add_clip_ignore); ClassDB::bind_method(D_METHOD("canvas_item_set_sort_children_by_y", "item", "enabled"), &VisualServer::canvas_item_set_sort_children_by_y); diff --git a/servers/visual_server.h b/servers/visual_server.h index 4db6a6a39b..5af10ded28 100644 --- a/servers/visual_server.h +++ b/servers/visual_server.h @@ -895,7 +895,7 @@ public: virtual void canvas_item_add_triangle_array(RID p_item, const Vector<int> &p_indices, const Vector<Point2> &p_points, const Vector<Color> &p_colors, const Vector<Point2> &p_uvs = Vector<Point2>(), const Vector<int> &p_bones = Vector<int>(), const Vector<float> &p_weights = Vector<float>(), RID p_texture = RID(), int p_count = -1, RID p_normal_map = RID()) = 0; virtual void canvas_item_add_mesh(RID p_item, const RID &p_mesh, RID p_texture = RID(), RID p_normal_map = RID()) = 0; virtual void canvas_item_add_multimesh(RID p_item, RID p_mesh, RID p_texture = RID(), RID p_normal_map = RID()) = 0; - virtual void canvas_item_add_particles(RID p_item, RID p_particles, RID p_texture, RID p_normal_map, int p_h_frames, int p_v_frames) = 0; + virtual void canvas_item_add_particles(RID p_item, RID p_particles, RID p_texture, RID p_normal_map) = 0; virtual void canvas_item_add_set_transform(RID p_item, const Transform2D &p_transform) = 0; virtual void canvas_item_add_clip_ignore(RID p_item, bool p_ignore) = 0; virtual void canvas_item_set_sort_children_by_y(RID p_item, bool p_enable) = 0; |