Commit graph

494 commits

Author SHA1 Message Date
Rémi Verschelde 06a33e590f
Merge pull request #53819 from TokageItLab/re-implement-ping-pong
Reimplement ping-pong animation and reverse playback
2021-11-09 22:11:04 +01:00
Hugo Locurcio c012fbc8b2
Rename PROPERTY_USAGE_NOEDITOR to PROPERTY_USAGE_NO_EDITOR
This is consistent with other constants that include `NO`,
such as `PROPERTY_HINT_COLOR_NO_ALPHA`.
2021-11-03 23:06:17 +01:00
Silc 'Tokage' Renew 953a7bce7e reimplement ping-pong 2021-11-03 13:39:33 +09:00
Rémi Verschelde 5945f43cc8
Merge pull request #54391 from DavidSichma/doc_interpolate_value 2021-11-01 22:38:42 +01:00
David Sichma b9c7c52a29
Fixed Tween::interpolate_value argument order. 2021-10-29 17:29:28 +02:00
kobewi 3ed20a2f5d Fix parallel Tweens not ending correctly 2021-10-28 21:04:22 +02:00
reduz d03b7fbe09 Refactored Node3D rotation modes
* Made the Basis euler orders indexed via enum.
* Node3D has a new rotation_order property to choose Euler rotation order.
* Node3D has also a rotation_mode property to choose between Euler, Quaternion and Basis

Exposing these modes as well as the order makes Godot a lot friendlier for animators, which can choose the best way to interpolate rotations.
The new *Basis* mode makes the (exposed) transform property obsolete, so it was removed (can still be accessed by code of course).
2021-10-25 14:34:00 -03:00
Marcel Admiraal 87a4ba492e Remove unimplemented methods 2021-10-21 18:44:25 +01:00
reduz ae1c016547 Implement Animation Blend Shape Tracks
* New track type BLEND_SHAPE
* Blend shapes are imported via this new track type
* Processing is more optimized (no longer relies on variants)
* Modified the Blend Shape API in MeshInstance3D to use indices rather than StringNames (more optimizes)
* Promo: Fixed a small bug in gizmo updating in Node3D that affected performance

Dedicated BlendShape tracks are required for both optimization and eventually implementing them in animation compression.
2021-10-16 08:36:05 -03:00
reduz 2dc823273e Remove REST transform influence in skeleton bones
* Animations and Skeletons are now pose-only.
* Rest transform is kept as reference (when it exists) and for IK
* Improves 3D model compatibility (non uniform transforms will properly work, as well as all animations coming from Autodesk products).
2021-10-13 14:51:29 -03:00
reduz ec19ed3723 Remove animation 3D transform track, replace by loc/rot/scale tracks.
* `Animation.TYPE_TRANSFORM3D` track is gone.
* Added POSITION_3D, ROTATION_3D, SCALE_3D tracks.
* GLTF2, Collada, FBX importers will only import the track types found.
* Skeleton3D bone poses are now Pos/Rot/Scale, pose matrix removed.
* AnimationPlayer and AnimationTree animate these tracks separately, only when found.
* Removed BakeReset code, is useless with these changes.

This is the first in a series of commits designed to make the animation system in Godot more useful, which includes:

* Better compatibility with Autodesk products
* Better reusability of animations across models (including retargeting).
* Proper animation compression.
* etc.

*Note* GLTF2 animation saving went broken with this PR, needs to be fixed in a subsequent one.
2021-10-12 20:08:42 -03:00
Juan Linietsky 610de0974d
Revert "Implement reverse playback and ping-pong loop in AnimationPlayer and NodeAnimation" 2021-10-11 19:27:50 -03:00
Tokage 372ba76663 implement ping-pong loop in animation
Co-authored-by: Chaosus <chaosus89@gmail.com>
2021-10-09 18:08:43 +09:00
Rémi Verschelde b85dfd990e
GDScript completion: Handle quote style ad-hoc to remove editor dependency
`core` and `scene` shouldn't depend on `editor`, so they can't query this style
setting in `get_argument_options`. But we can handle it after the fact in
GDScript's completion code.

Also cleans up a couple extra unused invalid includes in `core`.
2021-10-04 16:16:05 +02:00
Rémi Verschelde 75d3a10a23
Merge pull request #44964 from Dragoncraft89/animation_tree_bug 2021-10-03 12:43:03 +02:00
Lightning_A c63b18507d Use range iterators for Map 2021-09-30 15:09:12 -06:00
Lightning_A e4dfa69bcf Fix non-const iterators in const methods 2021-09-30 15:07:30 -06:00
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