Commit graph

562 commits

Author SHA1 Message Date
SnailRhymer
b0e31eeb4a Remove configuration warning from AnimationPlayer
Remove warning about animations in different libraries having the same name, since shared names are fine.

Also fix missing vformat argument when setting the name of an animation to one that does conflict with an animation in the same library.
2022-05-24 13:22:16 +01:00
Rémi Verschelde
bd8d91254c
Merge pull request #61106 from snailrhymer/animation-library-fixes
Fix errors and improve UX relating to new animation libraries
2022-05-24 10:51:31 +02:00
Rémi Verschelde
9923851370 Fix typos with codespell
Using codespell 2.2-dev from current git.
2022-05-23 21:32:19 +02:00
reduz
45af29da80 Add a new HashSet template
* Intended to replace RBSet in most cases.
* Optimized for iteration speed
2022-05-20 22:40:38 +02:00
Aaron Record
900c676b02 Use range iterators for RBSet in most cases 2022-05-19 12:09:16 +02:00
Haoyu Qiu
fc3b845c07 Add dedicated macros for property name extraction
* Replace case-by-case extraction with PNAME & GNAME
* Fix group handling when group hint begins with property name
* Exclude properties that are PROPERTY_USAGE_NO_EDITOR
* Extract missing ADD_ARRAY*, ADD_SUBGROUP* macros
2022-05-19 14:08:47 +08:00
Rémi Verschelde
5b3d596285
Merge pull request #60774 from TokageItLab/root-seek-mode
Fixed broken root motion calculation in internal process of `AnimationBlendTree` such as `NodeOneShot`
2022-05-18 15:24:21 +02:00
SnailRhymer
d79818acb6 Fix errors and improve UX relating to new animation libraries
- Fix a bug causing an error message when a scene containing an AnimationPlayer with a reset track is saved, by correctly referencing the temporary "default" library.
- Make library dropdown in new animation window assign correct library when creating an animation.
- Similarly allow choice of library when duplicating animation.
- Make library dropdown default to library of currently selected animation.
- Make library dropdown show when exactly one library exists, and it isn't [Global]. Include [Global] on the dropdown in this case (will be newly created if dialog is confirmed).
- When appending (x) to avoid New Anim name collisions, correctly check target library instead of [Global].
- Add parentheses when appending x when duplicating animations in the library editor, for consistency.
- Change titles and prompts to be distinct in name/rename/duplicate dialiogs.
- Fix bug in OprionButton.get_selectable_item(true) when last is not selectable.
- Fix issues where animation wasn't found on deletion/rename by correctly prepending library name.
- Remove an extraneous print_line from animation_track_editor.
- Add messages to errors when an animation isn't found.
2022-05-17 00:02:51 +01:00
reduz
746dddc067 Replace most uses of Map by HashMap
* Map is unnecessary and inefficient in almost every case.
* Replaced by the new HashMap.
* Renamed Map to RBMap and Set to RBSet for cases that still make sense
  (order matters) but use is discouraged.

There were very few cases where replacing by HashMap was undesired because
keeping the key order was intended.
I tried to keep those (as RBMap) as much as possible, but might have missed
some. Review appreciated!
2022-05-16 10:37:48 +02:00
reduz
8b7c7f5a75 Add a new HashMap implementation
Adds a new, cleaned up, HashMap implementation.

* Uses Robin Hood Hashing (https://en.wikipedia.org/wiki/Hash_table#Robin_Hood_hashing).
* Keeps elements in a double linked list for simpler, ordered, iteration.
* Allows keeping iterators for later use in removal (Unlike Map<>, it does not do much
  for performance vs keeping the key, but helps replace old code).
* Uses a more modern C++ iterator API, deprecates the old one.
* Supports custom allocator (in case there is a wish to use a paged one).

This class aims to unify all the associative template usage and replace it by this one:
* Map<> (whereas key order does not matter, which is 99% of cases)
* HashMap<>
* OrderedHashMap<>
* OAHashMap<>
2022-05-12 11:21:29 +02:00
Silc Renew
ba8398f270 Fixed delta & Implement selection of whether or not to seek root 2022-05-09 08:28:32 +09:00
kobewi
45e4cb2bbf Fix error spam when tweened node leaves tree 2022-05-05 17:57:25 +02:00
Rémi Verschelde
931838b330
Merge pull request #60627 from aaronfranke/rename-elements
Rename Transform2D and Basis `elements` to `columns` and `rows` respectively
2022-05-03 14:40:01 +02:00
Rémi Verschelde
297241f368
Merge pull request #60714 from Calinou/typedef-remove-ref
Remove `RES` and `REF` typedefs in favor of spelled out `Ref<>`
2022-05-03 14:28:18 +02:00
Hugo Locurcio
180e5d3028
Remove RES and REF typedefs in favor of spelled out Ref<>
These typedefs don't save much typing compared to the full `Ref<Resource>`
and `Ref<RefCounted>`, yet they sometimes introduce confusion among
new contributors.
2022-05-03 01:43:50 +02:00
Guilherme Felipe
e7056c195d Improvements of state machine
- Open the menu to add new animation nodes by dragging the transitions to
empty areas and automatically connecting them.
- Adds box selection to the state machine.
- Add feature to group/ungroup selected nodes in a "sub" state machine.
- Add start/end node by default. In addition, add new color to these
nodes to differentiate then.
- Add tooltip for transitions to show the connection "from -> to".
- Add new "type" of transition line when multiple transitions are
grouped.
- Add popup to connect nodes in sub state machine.
- Add dialog to select which nodes can be deleted when they are grouped.
- Add classes:
	AnimationNodeStartState
	AnimationNodeEndState
	EditorAnimationMultiTransitionEdit
- Implements disabled transition

API Changes:
- Now it's posible to add transitions between state machines,
`AnimationNodeStateMachine::add_transition` will works with relative path,
this means you can use it like this `add_transition("Idle", "Walk", tr)`
or `add_transition("Idle", "StateMachine/Shoot)`.
2022-05-02 13:06:36 -03:00
kobewi
f473aab00d Improve Tween infinite loop detection 2022-05-01 00:24:07 +02:00
kobewi
7f0bc91844 Simplify Callable error text methods 2022-04-30 13:42:26 +02:00
Aaron Franke
1bf94dff3a
Rename Basis "elements" to "rows" 2022-04-29 08:02:56 -05:00
Aaron Franke
b831fb0a54
Rename Transform2D "elements" to "columns" 2022-04-29 08:02:39 -05:00
Rémi Verschelde
1eb09364f8
Merge pull request #60247 from ScottVMariotte/AnimationTree_atEndFix
Replaced `loops_current` with `end_loop` in `AnimationNodeStateMachinePlayback`
2022-04-28 18:22:23 +02:00
Haoyu Qiu
6c01ef8f4c Miscellaneous Tween fixes 2022-04-28 21:19:01 +08:00
Rémi Verschelde
1de51133c9
Merge pull request #60331 from KoBeWi/tween_static() 2022-04-27 13:20:11 +02:00
Rémi Verschelde
f40952e0ba
Merge pull request #60349 from TokageItLab/fix-rotated-root-motion-view 2022-04-27 12:41:24 +02:00
Rémi Verschelde
6c20ade250
Merge pull request #60440 from KoBeWi/Ȑ̶̛̘̻̹̪͙̇̍̔͐̊̆̏̏̓̈́̉͌͘Ȩ̸͉̳̘̬̣̩̽̈́́̅̈́̕͝ͅS̷͓̮̙̪̪̺̭̰̓̎̌́͗͆͌̈́̒͋͊͘Ë̷̡̨͔̻͈̺͓̘͉́̏̍̓͋̋͠T̶̠̙͍̱̠̱̟͎͇̬̥̞̘͛̔̄̏̆̽̄̌̅͝ͅ 2022-04-27 11:06:20 +02:00
Silc 'Tokage' Renew
df89969865 fixed rotated RootMotionView grid glitch 2022-04-24 15:46:39 +09:00
kobewi
cf74b36740 Fix RESET animation not being created 2022-04-22 22:28:15 +02:00
Silc 'Tokage' Renew
dd90a34e8a fixed init value in root motion rotation 2022-04-18 14:04:49 +09:00
kobewi
3017530e26 Make Tween.interpolate_value() static 2022-04-17 23:13:39 +02:00
Silc 'Tokage' Renew
3ce843c128 Discontinue exp map in blending 2022-04-17 04:34:28 +09:00
ScottVMariotte
c526ee6683 Replaced loops_current with end_loop 2022-04-14 18:18:00 -04:00
Silc 'Tokage' Renew
0fe723a1ac Fixed value track blend animation without RESET 2022-04-14 19:01:00 +09:00
Rémi Verschelde
8ada85ef1d
Merge pull request #60093 from TokageItLab/reset-blend
Make blend animation to use ResetTrack as default value
2022-04-13 22:46:45 +02:00
Rémi Verschelde
3c1c772b01
Merge pull request #59531 from TokageItLab/fix-init-root-motion
Fixed initialization of TRS Track in blend tree for root motion
2022-04-12 18:51:23 +02:00
reduz
6f401439f8 Implement Animation Libraries
* Instead of containing single animations, AnimationPlayer now contains libraries.
* Libraries, in turn, contain the animations.

This paves the way for implementing the possibility of importing scenes as animation libraries, finally allowing to import animations separate from the 3D models.

Missing (will be done on separate PRs):

* Make it possible to import scenes (dae/fbx/gltf) as animation libraries.
* Make it possible for AnimationTree to import animation libraries on its own, so it does not rely on AnimationPlayer for everything.
2022-04-11 12:51:54 +02:00
Silc 'Tokage' Renew
860fac4e6f Make blend animation to use ResetTrack as default value 2022-04-10 13:00:00 +09:00
Rémi Verschelde
6bbd4def45
Merge pull request #59415 from KoBeWi/tween_time() 2022-04-02 00:31:40 +02:00
kobewi
e04ae8c8bc Add get_total_elapsed_time() to Tween 2022-03-29 13:34:05 +02:00
Rémi Verschelde
7119d355eb String: Remove TTR and DTR defines in non-tools build
This ensures we don't use TTR in runtime code, as it's specifically meant
to source translations for the editor.
2022-03-28 20:26:35 +02:00
Rémi Verschelde
abbb0dc082
Merge pull request #59548 from akien-mga/obj-remove-unused-categories 2022-03-28 14:17:24 +02:00
kobewi
d48dea7158 Force final value at the end of Tween 2022-03-27 03:09:12 +02:00
Rémi Verschelde
5371009d8e Object: Remove unused category boilerplate
We might want to re-add something like this if/when we find a good use case
for it and do the effort to categorize all objects in the API properly.

Until then, it's better to remove that boilerplate since it's not needed.

Closes #18711.
2022-03-26 15:46:01 +01:00
Silc 'Tokage' Renew
013b81b93b Fixed initialization of TRS Track in blend tree for root motion 2022-03-26 09:24:56 +09:00
Haoyu Qiu
6a3bf65657 Fix inversed ADD_GROUP parameters in AnimationNodeOneShot 2022-03-18 12:53:34 +08:00
Silc 'Tokage' Renew
b06d253920 Fix blend animation to solve TRS track bug & blend order inconsistency 2022-03-16 05:11:55 +09:00
reduz
6f51eca1e3 Discern between virtual and abstract class bindings
* Previous "virtual" classes (which can't be instantiated) are not corretly named "abstract".
* Added a new "virtual" category for classes, they can't be instantiated from the editor, but can be inherited from script and extensions.
* Converted a large amount of classes from "abstract" to "virtual" where it makes sense.

Most classes that make sense have been converted. Missing:

* Physics servers
* VideoStream
* Script* classes.

which will go in a separate PR due to the complexity involved.
2022-03-10 12:28:11 +01:00
reduz
21637dfc25 Remove VARIANT_ARG* macros
* Very old macros from the time Godot was created.
* Limited arguments to 5 (then later changed to 8) in many places.
* They were replaced by C++11 Variadic Templates.
* Renamed methods that take argument pointers to have a "p" suffix. This was used in some places and not in others, so made it standard.
* Also added a dereference check for Variant*. Helped catch a couple of bugs.
2022-03-09 18:39:13 +01:00
Rémi Verschelde
b8b4580448
Style: Cleanup single-line blocks, semicolons, dead code
Remove currently unused implementation of TextureBasisU, could be re-added
later on if needed and ported.
2022-02-16 14:06:29 +01:00
Rémi Verschelde
0f5455230c
Use switch consistently in _notification (scene folder) 2022-02-15 18:44:55 +01:00
Anilforextra
adbe948bda String: Add contains(). 2022-02-04 01:28:02 +05:45