Commit graph

476 commits

Author SHA1 Message Date
kobewi 11e7963a14 Refactor and move easing equations 2021-09-24 13:47:13 +02:00
Rémi Verschelde be63fdff80
Merge pull request #52605 from TokageItLab/fixed-vtype-in-node-oneshot
Fixed value type and applied small change in `AnimationNodeOneShot`
2021-09-21 10:49:10 +02:00
Rémi Verschelde 132ad85670
Merge pull request #52555 from TokageItLab/fixed-discrete-animation-seek
Fixed seeking behavior of property track with discrete interpolation
2021-09-20 14:42:34 +02:00
Rémi Verschelde d54635d9b0
Merge pull request #52543 from TokageItLab/fixed-transition-when-xfade-time-is-zero
Fixed `AnimationNodeTransition`'s behavior when xfade time is zero
2021-09-20 13:19:29 +02:00
kobewi 266955d15f Improvements to Tweens' Variant types 2021-09-16 02:08:26 +02:00
Espeute Clement aa72af4f46
Fixed Animation Playback Track not seeking properly
Fixes #38093.
2021-09-15 10:02:11 +02:00
Rémi Verschelde 195ea41a7a
Merge pull request #51237 from KoBeWi/tween_fix()
Various fixes to Tween code
2021-09-14 10:29:50 +02:00
Silc 'Tokage' Renew 662da453a4 Fixed value type and applied small change in AnimationNodeOneShot 2021-09-13 02:31:57 +09:00
Silc 'Tokage' Renew 6613d9cf67 Fixed seeking behavior of property track with discrete interpolation 2021-09-11 06:10:23 +09:00
Silc 'Tokage' Renew 02d8166427 fixed AnimationNodeTransition when xfade time is zero 2021-09-11 02:26:40 +09:00
PouleyKetchoupp aae50da074 Fix AnimationBlendTree reset on resource loading
When reset_state was called on an existing AnimationBlendTree, the
output node would disappear, causing some errors in the editor and
preventing animations to play properly.

This change ensures the output node is always present in the node tree.
2021-08-26 09:07:13 -07:00
reduz 3682978aee Replace BIND_VMETHOD by new GDVIRTUAL syntax
* New syntax is type safe.
* New syntax allows for type safe virtuals in native extensions.
* New syntax permits extremely fast calling.

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

Added a new method flag METHOD_FLAG_OBJECT_CORE, used internally. Allows to not dump the core virtuals like `_notification` to the json API, since each language will implement those as it is best fits.
2021-08-22 08:23:58 -03:00
Rémi Verschelde 81512a3732
Style: Cleanup code using text_editor/completion/use_single_quotes 2021-08-13 21:27:57 +02:00
Aaron Franke 430ad75963
Some work on double support 2021-08-09 17:43:48 -05:00
Aaron Franke 78d33a6e24
Use doubles for time in animation code 2021-08-09 14:04:25 -05:00
kobewi e092a132fe Various fixes to Tween code 2021-08-06 13:07:34 +02:00
kobewi 053f20be76 Add null check to Tween.bind_node() 2021-08-02 14:15:40 +02:00
Hugo Locurcio 07dbe2045a
Use bullet points in the editor instead of dashes where relevant 2021-07-28 19:40:45 +02:00
Rémi Verschelde 92299989bd
Use Ref<T> references as iterators where relevant
And const when possible.
2021-07-26 19:27:11 +02:00
Rémi Verschelde ac3322b0af
Use const references where possible for List range iterators 2021-07-25 12:22:25 +02:00
Aaron Franke 4e6efd1b07
Use C++ iterators for Lists in many situations 2021-07-23 17:38:28 -04:00
Aaron Franke 78b0a7da03
Use is_equal_approx in more places 2021-07-21 00:32:37 -04:00
Rémi Verschelde b4baec08cf
Merge pull request #50206 from groud/undoredo_increase_args_count
Increase the number of arguments accepted by UndoRedo methods
2021-07-20 09:50:01 +02:00
reduz 6631f66c2a Optimize StringName usage
* Added a new macro SNAME() that constructs and caches a local stringname.
* Subsequent usages use the cached version.
* Since these use a global static variable, a second refcounter of static usages need to be kept for cleanup time.
* Replaced all theme usages by this new macro.
* Replace all signal emission usages by this new macro.
* Replace all call_deferred usages by this new macro.

This is part of ongoing work to optimize GUI and the editor.
2021-07-18 21:20:02 -03:00
Rémi Verschelde f2ad067509
Merge pull request #48375 from bowling-allie/discrete-carry-bug 2021-07-13 10:33:34 +02:00
Gilles Roudière 2f9a0268dd Increase the number of arguments accepted by UndoRedo methods 2021-07-06 18:52:28 +02:00
Aaron Franke 2508fd0533
Use PROPERTY_USAGE_NONE instead of 0 for no property usage
Also use const more often.
2021-07-01 14:13:27 -04:00
Rémi Verschelde 270f9d4c88
Merge pull request #50014 from reduz/remove-immediate
Deprecate ImmediateGeometry
2021-06-30 20:18:59 +02:00
reduz 85cf99f28e Deprecate ImmediateGeometry
* Removed entirely from RenderingServer.
* Replaced by ImmediateMesh resource.
* ImmediateMesh replaces ImmediateGeometry, but could use more optimization in the future.
* Sprite3D and AnimatedSprite3D work again, ported from Godot 3.x (though a lot of work was needed to adapt them to Godot 4).
* RootMotionView works again.
* Polygon3D editor works again.
2021-06-30 14:14:41 -03:00
reduz 75688772b3 Fix editor suffixes and degrees conversion
* Functions to convert to/from degrees are all gone. Conversion is done by the editor.
* Use PROPERTY_HINT_ANGLE instead of PROPERTY_HINT_RANGE to edit radian angles in degrees.
* Added possibility to add suffixes to range properties, use "min,max[,step][,suffix:<something>]" example "0,100,1,suffix:m"
* In general, can add suffixes for EditorSpinSlider
Not covered by this PR, will have to be addressed by future ones:

* Ability to switch radians/degrees in the inspector for angle properties (if actually wanted).
* Animations previously made will most likely break, need to add a way to make old ones compatible.
* Only added a "px" suffix to 2D position and a "m" one to 3D position, someone needs to go through the rest of the engine and add all remaining suffixes.
* Likely also need to track down usage of EditorSpinSlider outside properties to add suffixes to it too.
2021-06-30 12:38:25 -03:00
Lightning_A e28fd07b2b Rename instance()->instantiate() when it's a verb 2021-06-19 20:49:18 -06:00
Rémi Verschelde 9c182b0f45
Merge pull request #41794 from KoBeWi/shiny_new_tweens 2021-06-20 00:35:28 +02:00
Tomasz Chabora 900b2e0fdc Complete rewrite of Tweens
* Tweens were changed from Node to RefCounted. New API is inspired by DOTween.
* Tweens are created and managed by SceneTree, similar to SceneTreeTimer, which makes them ultra cheap to use a lot.
* Animating with Tweens is done by creating sequences of Tweeners. You create them from code and they autostart by default (fire-and-forget).
* There are 4 Tweeners that cover the former Tween functionality: PropertyTweener, IntervalTweener, CallbackTweener and MethodTweener.
* The methods were simplified a lot. Long argument lists are replaced with chained calls on Tweens and Tweeners.
* Tweeners by default execute in sequence, so it's easy to create complex chained animations.
* You can bind a Tween to a node. Tween will be removed automatically when the bound node is freed.
2021-06-19 12:08:50 +02:00
Aaron Franke 8b692e8872
Add PROPERTY_USAGE_NONE and use it 2021-06-17 19:10:26 -04:00
kobewi 7ff135b015 Consistently prefix bound virtual methods with _ 2021-06-12 00:55:52 +02:00
Pedro J. Estébanez 04688b92ff Rename Reference to RefCounted 2021-06-11 18:48:42 +02:00
Marcel Admiraal 8acd13a456 Rename Quat to Quaternion 2021-06-04 18:14:32 +01:00
Aaron Franke bbd49dec23
Disable Skeleton3D when compiling without 3D
Make animation code not depend on Skeleton3D or even Node3D
2021-06-04 08:33:50 -04:00
Aaron Franke 125d1a7cd3
Rename Animation TYPE_TRANSFORM to TYPE_TRANSFORM3D 2021-06-03 21:11:54 -04:00
Aaron Franke 08a85352fb
Rename Variant TRANSFORM to TRANSFORM3D
Also _transform to _transform3d
2021-06-03 07:30:01 -04:00
Aaron Franke de3f6699a5
Rename Transform to Transform3D in core 2021-06-03 07:30:01 -04:00
Hugo Locurcio 87f503310b
Tweak dozens of editor property hints for consistency
- Update Viewport MSAA property hints to match the currently
  exposed values.
- Add some performance hints to property hints.
2021-05-25 02:50:35 +02:00
Rémi Verschelde a4e8da8d0b
Merge pull request #41416 from TokageItLab/fix_animation_tree_cache
fix unintentional object rotation by anim tree
2021-05-09 13:57:18 +02:00
bowling-allie bcb1e2b79f Fixes BlendSpace2D BLEND_MODE_DISCRETE_CARRY.
When BlendSpace2D switches animations, it will now correctly
calculate the previous animation position and length and
apply is to the new animation.
2021-05-06 18:25:59 -07:00
Nathan Franke 2a8c59c171
Use Array for node configuration warnings
Previously, the warnings were passed as a string and delimitation of which were hard coded at each implementation.
2021-04-11 23:25:38 -05:00
Marcel Admiraal 755c70b871 Rename Array.invert() to Array.reverse()
Does the same internally for List and Vector<>, which includes all
PackedArray types.
2021-03-21 10:20:08 +00:00
Kongfa Waroros 981ca8045f Check AnimationNode to update properties 2021-03-17 18:33:29 +07:00
Anshul7sp1 91181c2086 Fixes small typos and grammar correction 2021-03-12 19:05:16 +05:30
jmb462 b3d7adc7d6 fix no tween repeat after stop_all() and start() again 2021-03-03 00:55:17 +01:00
Christoffer Sundbom 5b2100d85c Tween: Add null check for target object
Fixes #45399.
2021-02-24 13:37:55 +01:00