Commit Graph

197 Commits

Author SHA1 Message Date
Zae
2febf0ccdb Make Animation::track_insert_key return key index 2022-07-31 17:38:49 +02:00
4211e68d80 rename and unify notation for spherical interpolation 2022-07-27 23:22:50 +09:00
95244f0e7a Fixes #62097: infinite loop in animation compress due to too small page size
Fixed an infinite loop caused when given page size is too small to store anything.

If, in the first step of compression, we attempt a rollback, we end up calling LocalVector::resize with AnimationCompressionDataState::validated_packet_count which is -1.  This resize function takes a uint, and there's a bitshift operation that assumes that by bitshifting enough times, we'll reach a number greater than or equal to the requested memory amount, which we'll never do for uint(-1), and this causes an infinite loop.

To fix, I'm adding an early failure in case the given page size isn't enough.
2022-07-01 01:03:13 +02:00
99ce0df3b1 Refactor bezier interpolation functions 2022-06-27 19:42:43 +02:00
4678736a39 Add suffixes to all nodes and resources 2022-06-11 09:41:05 -05:00
5dc3bfb80e Use suffixes for units in nodes and resources 2022-05-19 14:34:27 -05:00
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
28261b3da8 Add enum hint for Animation.loop_mode 2022-04-07 17:19:32 -05:00
f851c4aa33 Fix some issues found by cppcheck. 2022-04-06 14:34:37 +03:00
b2e19b2499 Animation: Silence false positive -Wstringop-overflow warning
And disable debug code which was wrongly left enabled.
2022-03-04 17:10:22 +01:00
f3895e7a67 Fixed cubic interpolate with loop 2022-02-20 15:46:58 +09:00
865da09871 Implement cubic_interpolate() as MathFunc for refactoring 2022-02-12 18:11:17 +09:00
8a0a3accee simplify formatting scripts, add a clang-tidy script, and run clang-tidy 2022-01-29 04:41:03 -06:00
0650846248 Make AnimationTree delta argument force double in core 2022-01-29 05:07:30 +09:00
d27f06a61b Merge pull request #56193 from kodiwills/fix-update-mode-not-refreshed-visually-on-undo 2022-01-05 10:53:34 +01:00
fe52458154 Update copyright statements to 2022
Happy new year to the wonderful Godot community!
2022-01-03 21:27:34 +01:00
a124f1effe Fix various typos
Found via ` codespell -q 3 -S ./thirdparty,*.po,./DONORS.md -L ackward,ang,ans,ba,beng,cas,childs,childrens,dof,doubleclick,expct,fave,findn,gird,hist,inout,leapyear,lod,nd,numer,ois,ony,paket,seeked,sinc,switchs,te,uint,varn`
Update editor/import/resource_importer_layered_texture.cpp

Co-authored-by: Raul Santos <raulsntos@gmail.com>
Update doc/classes/TileSetScenesCollectionSource.xml

Co-authored-by: Raul Santos <raulsntos@gmail.com>
Update scene/gui/graph_edit.cpp

Co-authored-by: Raul Santos <raulsntos@gmail.com>
Update scene/resources/animation.cpp

Co-authored-by: Raul Santos <raulsntos@gmail.com>
Update scene/resources/animation.cpp

Co-authored-by: Raul Santos <raulsntos@gmail.com>
Update scene/resources/animation.cpp

Co-authored-by: Raul Santos <raulsntos@gmail.com>
Update scene/gui/rich_text_label.cpp

Co-authored-by: Raul Santos <raulsntos@gmail.com>
Revert previously committed change
2022-01-02 01:03:58 -05:00
51db86d789 add missing emit_changed() to set update mode function 2021-12-23 07:53:36 -05:00
e9808e3d9a Add a double-precision editor build to CI 2021-12-09 09:52:48 -06:00
e078f970db Rename remove() to remove_at() when removing by index 2021-11-23 18:58:57 -07:00
2e6e3a8ed7 Change cast of int to num to int static cast 2021-11-20 11:58:55 -05:00
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
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
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
953a7bce7e reimplement ping-pong 2021-11-03 13:39:33 +09:00
3b11e33a09 clang-format: Disable alignment of operands, too unreliable
Sets `AlignOperands` to `DontAlign`.

`clang-format` developers seem to mostly care about space-based indentation and
every other version of clang-format breaks the bad mismatch of tabs and spaces
that it seems to use for operand alignment. So it's better without, so that it
respects our two-tabs `ContinuationIndentWidth`.
2021-10-28 15:19:35 +02:00
5ff0624a07 Fix GCC 12 -Werror=type-limits in animation compression code
Fixup to #54050, CI's GCC builds didn't catch it.
2021-10-25 17:59:07 +02:00
24fdedfe94 Merge pull request #54050 from reduz/animation-compression 2021-10-25 14:27:58 +02:00
653e2a550c Fixed animation insertion in SkeletonEditor 2021-10-23 16:50:00 +09:00
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
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
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
610de0974d Revert "Implement reverse playback and ping-pong loop in AnimationPlayer and NodeAnimation" 2021-10-11 19:27:50 -03:00
372ba76663 implement ping-pong loop in animation
Co-authored-by: Chaosus <chaosus89@gmail.com>
2021-10-09 18:08:43 +09:00
ffe54af0db Calculate proper animation length. 2021-08-24 18:50:22 -07:00
e4b29cb6be Fix 3d animations doesn't play
Add comment


Fix


ff
2021-08-22 23:19:26 +03:00
430ad75963 Some work on double support 2021-08-09 17:43:48 -05:00
78d33a6e24 Use doubles for time in animation code 2021-08-09 14:04:25 -05:00
8acd13a456 Rename Quat to Quaternion 2021-06-04 18:14:32 +01:00
125d1a7cd3 Rename Animation TYPE_TRANSFORM to TYPE_TRANSFORM3D 2021-06-03 21:11:54 -04:00
91181c2086 Fixes small typos and grammar correction 2021-03-12 19:05:16 +05:30
f8d03b98e7 Improve resource load cache
-Added a new method in Resource: reset_state , used for reloading the same resource from disk
-Added a new cache mode "replace" in ResourceLoader, which reuses existing loaded sub-resources but resets their data from disk (or replaces them if they chaged type)
-Because the correct sub-resource paths are always loaded now, this fixes bugs with subresource folding or subresource ordering when saving.
2021-02-11 15:44:28 -03:00
7961a1dea3 Initialize class variables with default values in scene/ [2/2] 2021-02-09 18:24:36 +01:00
b5334d14f7 Update copyright statements to 2021
Happy new year to the wonderful Godot community!

2020 has been a tough year for most of us personally, but a good year for
Godot development nonetheless with a huge amount of work done towards Godot
4.0 and great improvements backported to the long-lived 3.2 branch.

We've had close to 400 contributors to engine code this year, authoring near
7,000 commit! (And that's only for the `master` branch and for the engine code,
there's a lot more when counting docs, demos and other first-party repos.)

Here's to a great year 2021 for all Godot users 🎆
2021-01-01 20:19:21 +01:00
b7367ac426 Add animation reset track feature
As a bonus, to have consistency between use Beziers and create insert tracks, use Beziers also gets a default via editor settings that is used when the confirmation dialog is disabled, instead of just falling back to creating non-Bezier tracks.
2020-12-20 12:45:08 +01:00
f5a3cbda19 Rename Animation::track_remove_key_at_position to track_remove_key_at_time 2020-12-14 18:00:11 +00:00
02161aad5a Remove empty lines around braces with the formatting script 2020-11-16 23:38:11 -05:00
ff4af94414 Expose Animation::value_track_interpolate to GDscript 2020-10-01 14:27:09 +02:00
e1a1bb0a6e Keep transition value when replacing key 2020-07-23 22:59:04 +02:00
4313a7bdc8 Fix issues with custom tracks on reimport 2020-07-02 16:08:20 -07:00