Commit graph

327 commits

Author SHA1 Message Date
Silc Renew
f7dd83ce60 Fix Quaternion Tween and implement ease baker 2022-08-22 19:04:58 +09:00
Silc Renew
dded7c72c1 Make cubic_interpolate() consider key time in animation 2022-08-19 14:48:37 +09:00
Rémi Verschelde
cf95056c91
Merge pull request #63245 from V-Sekai/animation_editor_read_only 2022-08-10 15:26:21 +02:00
Silc Renew
f70dfec535 improve animation track optimizer algorithm 2022-08-09 09:18:45 +09:00
Yuri Sizov
1c9ba5ef3e Remove excessive editor/property_editor.h includes 2022-08-01 17:19:11 +03:00
Juan Linietsky
d4433ae6d3 Remove Signal connect binds
Remove the optional argument p_binds from `Object::connect` since it was deprecated by Callable.bind().
Changed all uses of it to Callable.bind()
2022-07-29 16:26:13 +02:00
Rémi Verschelde
f99f5a5887
Merge pull request #48995 from KoBeWi/advanced_animation 2022-07-28 10:14:25 +02:00
Nathan Franke
488017f3cb
improve animation player warning for imported scenes 2022-07-24 16:49:57 -05:00
SaracenOne
7776b47489 Add read-only mode to AnimationEditor for foreign resources. 2022-07-21 14:46:58 +01:00
FireForge
97dfbea6ad Rename Control PRESET_WIDE to PRESET_FULL_RECT 2022-07-18 20:08:11 -05:00
Pedro J. Estébanez
b46a2aaa4b Create reset tracks with the right update mode 2022-07-17 19:51:15 +02:00
FireForge
e4067064ce Add ok_button_text to AcceptDialog and cancel_button_text to ConfirmationDialog 2022-07-09 10:47:08 -05:00
bruvzg
344ba0ffaf
Refactor Font configuration and import UI, and Font resources. 2022-07-06 14:12:36 +03:00
kobewi
798f9c8632 Advance animation after confirming 2022-06-29 13:55:23 +02:00
bruvzg
b5c96df277
Move duplicate AutoWrap, Overrun and VisibleChar behavior enums to the TextServer. 2022-06-16 16:49:37 +03:00
Rémi Verschelde
c8ce7e34e2 i18n: Misc fixes translation strings
Adds some translator comments to solve some questions raised on Weblate.
2022-06-08 12:57:54 +02: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
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
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
Rémi Verschelde
6f130768c7
Merge pull request #53356 from kleonc/animation-track-editor-root-removed-connection-fix 2022-05-09 15:47:21 +02:00
Silc Renew
ba8398f270 Fixed delta & Implement selection of whether or not to seek root 2022-05-09 08:28:32 +09: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
Rémi Verschelde
c273ddc3ee Style: Partially apply clang-tidy's cppcoreguidelines-pro-type-member-init
Didn't commit all the changes where it wants to initialize a struct
with `{}`. Should be reviewed in a separate PR.

Option `IgnoreArrays` enabled for now to be conservative, can be
disabled to see if it proposes more useful changes.

Also fixed manually a handful of other missing initializations / moved
some from constructors.
2022-05-02 16:28:25 +02:00
Rémi Verschelde
6c20ade250
Merge pull request #60440 from KoBeWi/Ȑ̶̛̘̻̹̪͙̇̍̔͐̊̆̏̏̓̈́̉͌͘Ȩ̸͉̳̘̬̣̩̽̈́́̅̈́̕͝ͅS̷͓̮̙̪̪̺̭̰̓̎̌́͗͆͌̈́̒͋͊͘Ë̷̡̨͔̻͈̺͓̘͉́̏̍̓͋̋͠T̶̠̙͍̱̠̱̟͎͇̬̥̞̘͛̔̄̏̆̽̄̌̅͝ͅ 2022-04-27 11:06:20 +02:00
Rémi Verschelde
8dfa12cae7
Merge pull request #59979 from bruvzg/cpp_check2 2022-04-27 10:08:26 +02:00
Rémi Verschelde
e35ce44853
Merge pull request #60446 from KoBeWi/animation_extermination
Remove RESET tracks after removing tracks
2022-04-26 08:18:15 +02:00
FireForge
3073b85de9 Rename theme properties to include underscores
- check_vadjust -> check_v_adjust
- close_h_ofs -> close_h_offset
- close_v_ofs -> close_v_offset
- commentfocus -> comment_focus
- hseparation -> h_separation
- ofs -> offset
- selectedframe -> selected_frame
- state_machine_selectedframe -> state_machine_selected_frame
- table_hseparation -> table_h_separation
- table_vseparation -> table_v_separation
- vseparation -> v_separation
2022-04-23 11:16:18 -05:00
kobewi
e96b773c81 Remove RESET tracks after removing tracks 2022-04-23 00:40:28 +02:00
kobewi
cf74b36740 Fix RESET animation not being created 2022-04-22 22:28:15 +02:00
bruvzg
de4c97758a
Fix more issues found by cppcheck. 2022-04-20 10:34:00 +03:00
Hugo Locurcio
f064258aee
Highlight hovered keyframes in the animation track editor
Both unselected and selected keyframes feature hover feedback.

This currently only affects standard keyframes (i.e. not booleans,
colors or audio tracks which use custom icons).
2022-04-08 01:43:21 +02:00
Rémi Verschelde
748fde8df0
Merge pull request #59396 from Calinou/animation-track-editor-improve-drawing
Improve the animation track editor drawing
2022-04-08 01:18:42 +02:00
Hendrik Brucker
314430b868 Cleanup EditorNode and EditorData
Co-authored-by: Eric M <itsjusteza@gmail.com>
2022-03-30 20:12:26 +02:00
Hugo Locurcio
313c672dc8
Improve the animation track editor drawing
- Draw a background on alternate lines to ease readability of
  animations with many tracks.
- Draw a background on the currently hovered line.
- Use the editor focus stylebox instead of a custom rectangle
  for the focused track.
2022-03-21 23:52:48 +01:00
Aaron Franke
918b09cabc
Initialize bools in the headers in editor 2022-03-12 13:34:06 -06:00
Markus Sauermann
4a8a6f892f Use get_cursor_shape for identifying the cursor shape in AnimationTimelineEdit
get_cursor_shape() is used in cases where a Control displays different cursors in different areas.
There is no need to set the default cursor shape on every mouse move event.
2022-03-11 10:18:27 +01:00
Haoyu Qiu
83828c7d1b Fix some Animation panel icons not updating after theme change 2022-03-10 14:46:03 +08:00
Rémi Verschelde
33c907f9f5
Merge pull request #58929 from reduz/remove-variant-arg-macros
Remove VARIANT_ARG* macros
2022-03-09 20:48:45 +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
Haoyu Qiu
25d93200c8 Add missing i18n to various strings 2022-03-07 21:50:49 +08:00
kobewi
2057ea2883 Remove duplicate editor settings definitions 2022-03-06 22:05:49 +01:00
kobewi
7d44bb8f06 Remove set_as_minsize() 2022-03-06 00:57:42 +01:00
jmb462
dcd2a92af3 Port existing _notification code to use switch statements (part 1/3) 2022-02-16 11:38:24 +01:00
Rémi Verschelde
760a95e86a
Merge pull request #57877 from bruvzg/subpixel_gl_pos 2022-02-15 13:58:38 +01:00
jmb462
64ca6a0696 Fix AnimationTrack mouse wheel zooming at low zoom level 2022-02-13 00:24:35 +01:00
bruvzg
29199579f7
Add sub-pixel glyph positioning support. 2022-02-12 19:55:52 +02:00
Hendrik Brucker
b396fd4eef Improve compilation speed (forward declarations/includes cleanup) 2022-02-12 02:46:22 +01:00
Francois Belair
52649d5402 Fix selecting keys in Track Edit 2022-02-10 17:57:08 -05:00
Francois Belair
13a0d9177d Implement drawing and editing all anim beziers
* Move bezier edit from track to button in toolbar
* Draw, edit all bezier curves simultaneously
* Add click on curve to select tracks
* Tie track editor's filter view to bezier editor
* Implement visibility and locking
* Fix editor spacing issues
* Fix track buttons spacing
* Add keyframe focus and (de)select all key handling
2022-02-09 19:48:22 -05:00
Rémi Verschelde
8161e28512
Merge pull request #55899 from groud/fix_rotation_track_wrong_type
Fixes rotation 3D track inspector not using the correct type
2022-02-09 22:17:07 +01:00
Rémi Verschelde
fc076ece3d
Revert "Add missing SNAME macro optimization to all theme methods call"
This reverts commit a988fad9a0.

As discussed in #57725 and clarified in #57788, `SNAME` is not meant to be used
everywhere but only in critical code paths. For theme methods specifically, it
was by design that only getters use `SNAME` and not setters.
2022-02-08 10:17:25 +01:00
jmb462
a988fad9a0 Add missing SNAME macro optimization to all theme methods call 2022-02-06 23:06:11 +01:00
jmb462
1ce81dc5f2 Add missing SNAME macro optimization in some function calls 2022-02-06 15:54:04 +01:00
Gilles Roudière
73e784de1e Remove get_focus_owner() from Control, replaced by get_viewport()->gui_get_focus_owner() 2022-02-03 11:59:32 +01:00
Anilforextra
fc27636999 Vectors: Use clear() and has().
Use clear() instead of resize(0).

Use has() instead of "find(p_val) != -1".
2022-02-02 00:11:09 +05:45
kobewi
98692d68c3 Minor tweaks and fixes to panning 2022-01-23 13:49:53 +01:00
Rémi Verschelde
e363f404a5
Merge pull request #57000 from KoBeWi/UNLIMITED_PANNING 2022-01-23 00:47:52 +01:00
kobewi
74bfe88267 Add ViewPanner to 2D editor 2022-01-21 18:35:06 +01:00
Rémi Verschelde
cfb986c631
Merge pull request #51452 from omar-polo/fix-macros 2022-01-20 22:50:39 +01:00
Omar Polo
bd448e5535 Rename or refactor macros to avoid leading underscores
These are not used consistently and some can conflict with
system-specific defines.  While here, also delete some unused macros.
2022-01-20 20:29:15 +01:00
trollodel
aa1102fc53 Store panels and docks singletons in their own classes 2022-01-20 20:13:26 +01:00
Fabio Alessandrelli
7e14548fc6 [Editor] Move some animation specific keying logic out of inspector.
Most of the custom logic to handle special keying cases is now inside
the AnimationPlayerEditorPlugin.

The EditorInspector now emits a signal when inspecting a new object.
2022-01-19 11:08:25 +01:00
kobewi
fbb5580b3d Add ViewPanner to more editors 2022-01-14 13:09:39 +01:00
Rémi Verschelde
fe52458154
Update copyright statements to 2022
Happy new year to the wonderful Godot community!
2022-01-03 21:27:34 +01:00
Rémi Verschelde
1032c2c434
Merge pull request #55487 from YeldhamDev/scroll_bikeshedding 2022-01-03 14:10:41 +01:00
Gilles Roudière
c77dd7b96f Fixes rotation 3D track inspector not using the correct type 2021-12-13 12:25:08 +01:00
Nathan Franke
49403cbfa0
Replace String comparisons with "", String() to is_empty()
Also:
- Adds two stress tests to test_string.h
- Changes to .empty() on std::strings
2021-12-09 04:48:38 -06:00
Nathan Franke
41a20171eb
align to horizontal_alignment, valign to vertical_alignment, related 2021-12-09 01:38:46 -06:00
kobewi
841a9ef820 ScrollContainer's scrollbar visibility is now enum 2021-12-07 18:27:12 +01:00
Rémi Verschelde
75ac048e4b
Merge pull request #55662 from KoBeWi/update_minimum_size_changed_to_update_minimum_size 2021-12-06 18:28:46 +01:00
kobewi
b7d83689e4 Fix error when adding RESET key for new track 2021-12-06 17:36:25 +01:00
Rémi Verschelde
e8082003f1
Merge pull request #52280 from jmb462/fix-bad-popup-offset-with-single-window-off 2021-12-06 16:05:10 +01:00
jmb462
81efebb3a1
Fix bad popups offset in editor with single window off
Co-authored-by: Gil Arasa Verge <gilarasaverge@gmail.com>
Co-authored-by: Tomasz Chabora <kobewi4e@gmail.com>
2021-12-06 14:29:48 +01:00
kobewi
ea7cc1dea9 Rename minimum_size_changed() method 2021-12-06 14:02:34 +01:00
kobewi
f77a494d22 Allow to add RESET values from existing keys 2021-12-06 13:35:54 +01:00
kobewi
9cb66cac2d Add a constant StringName for RESET animation 2021-12-06 12:26:42 +01:00
Michael Alexsander
ec4f4c6cda Rename all methods that return ScrollBar nodes to get_*_scroll_bar() 2021-11-30 13:46:36 -03:00
Nathan Lovato
a5d0a74b65 Make bezier handle type a property of keyframes, update interface
- Replaced unused code related to old close icon with a button
- Add bezier handle options to right-click menu
- Remove mirror handle mode, only keep balanced
- Update animation reference
2021-11-16 09:26:35 -05:00
Hugo Locurcio
d7cd44418d
Use a different icon for eased keyframes in the animation editor
This makes easing tracks easier to recognize, in a way similar
to curved lines in the Path2D editor.
2021-11-15 13:16:21 +01:00
Aaron Franke
3c0fdcc8ac
Use "enum class" for input enums 2021-11-12 15:37:54 -06:00
Silc 'Tokage' Renew
953a7bce7e reimplement ping-pong 2021-11-03 13:39:33 +09:00
Rémi Verschelde
24fdedfe94
Merge pull request #54050 from reduz/animation-compression 2021-10-25 14:27:58 +02:00
Wilson E. Alvarez
fc30f6350a
Fix max argument count on AnimationTrackEdit spinbox 2021-10-24 10:05:01 -04:00
Silc 'Tokage' Renew
653e2a550c Fixed animation insertion in SkeletonEditor 2021-10-23 16:50:00 +09:00
reduz
a69541da4c Implement Animation Compression
Roughly based on https://github.com/godotengine/godot-proposals/issues/3375 (used format is slightly different).

* Implement bitwidth based animation compression (see animation.h for format).
* Can compress imported animations up to 10 times.
* Compression format opens the door to streaming.
* Works transparently (happens all inside animation.h)
2021-10-21 18:27:34 -03: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
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
Silc 'Tokage' Renew
7a447026c2 fixed insert track queue in AnimationTrackEditor doesn't work correctly 2021-10-07 07:30:36 +09:00
Silc Renew
f2e9867e9f Implemented SkeletonEditorGizmo
Co-authored-by: Lyuma <xn.lyuma@gmail.com>
2021-10-07 01:07:46 +09:00
kleonc
2ede2bac0b AnimationTrackEditor Fix signal connection on root exiting the tree 2021-10-03 14:49:18 +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
reduz
5cecdfa8af Entirely removes BIND_VMETHOD in favor of GDVIRTUAL
* `_gui_input`, `_input`, `_unhandled_input` and `_unhandled_key_input` are now regular C++ virutal functions.
* Everything else converted to GDVIRTUAL
* BIND_VMETHOD is gone, always use the new syntax from now on.

Creating `_gui_input` method and using the binder to register events will no longer work, simply override the virtual function now.
2021-08-23 08:10:13 -03:00
Hugo Locurcio
4a4d977bea
Improve the animation bezier editor
- Allow snapping bezier handles to the timeline.
- Allow precise snapping when holding Shift for keyframes and handles.
  - Previously, it was only allowed for seeking the timeline.
  - This change also impacts the animation track editor,
    not just the bezier editor.
- Invert the Ctrl + mouse wheel behavior to match the zoom direction
  in the animation track editor.
- Increase the line spacing between the "Time:" and "Value:" texts
  to improve readability.
- Tweak box selection styling to match the animation track editor.
- Adjust line widths for hiDPI displays.
2021-08-14 22:04:45 +02:00
Aaron Franke
fa3a32a2d6
Use Key enum instead of plain integers 2021-08-10 16:26:55 -05:00