Commit graph

170 commits

Author SHA1 Message Date
kobewi
fd5646856d Remove PropertyTweener start warning 2025-07-08 15:53:53 +02:00
Malcolm Anderson
914480e256 Skip killed/invalid subtween 2025-07-02 10:10:02 -07:00
kobewi
b615c7b3db Block Tween custom_step() during step 2025-06-26 12:27:53 +02:00
Silc Lizard (Tokage) Renew
678fb63451 Fix ambiguous AnimationNode's parameter type in default value
Co-authored-by: Tomasz Chabora <kobewi4e@gmail.com>
2025-06-05 10:02:22 +09:00
Thaddeus Crews
819bb61710
Merge pull request #103198 from Naputt1/fix-tween.kill()-isValid()-return-false
Fix `Tween.is_valid()` returning `true` after calling `kill()`
2025-04-10 10:18:21 -05:00
kobewi
bc9d0c7835 Add templated version of ObjectDB::get_instance() 2025-03-27 15:43:23 +01:00
kobewi
8f657977fc Fix final tween value with custom interpolator 2025-03-24 22:55:57 +01:00
Thaddeus Crews
1cb3cfaa8e
Style: Convert namespaces to PascalCase 2025-03-23 19:10:24 -05:00
naputt1
0c7b4fd057 Fix tween.isValid return true after kill 2025-02-23 00:47:49 +00:00
kobewi
ccc134fd1b Tween code improvements 2025-01-07 01:21:23 +01:00
Malcolm Anderson
be266138d7 Add tween_subtween method for nesting Tweens
No actual functionality yet

Actual subtween functionality implemented

Added documentation for Tween.tween_subtween and SubtweenTweener

Implemented some additional functions

`set_ease`, `set_trans`, and `set_delay`
Documentation only for `set_delay` so far, since I have tested it

Removed set_ease and set_trans

Upon further investigation, the way they are implemented for Tween doesn't appear to work here

Fixed indentation in documentation

Reset subtween when parent loops

Fix return type of `SubtweenTweener.set_delay`

Add notes to documentation

Apply suggestions from code review

Co-authored-by: Tomasz Chabora <kobewi4e@gmail.com>

Apply some suggested changes

- Remove excessive documentation
- Add Tween constructor that takes in SceneTree
- Make `SubtweenTweener::subtween` public so that `Tween` doesn't have to be a friend class

Remove unneeded friend class SceneTree

Remove superfluous documentation describing subtween behavior

Apply suggestions from code review

Co-authored-by: Tomasz Chabora <kobewi4e@gmail.com>

Apply suggestions from code review

Co-authored-by: Thaddeus Crews <repiteo@outlook.com>

Apply suggestions from code review

Co-authored-by: A Thousand Ships <96648715+AThousandShips@users.noreply.github.com>

Early return from `tween_subtween` if the subtween is `null`
2025-01-03 14:28:48 -08:00
tvenclovas96_bigblackc
dbc0cc1437 Add Tween::ignore_time_scale 2024-12-22 18:39:54 +02:00
BlackShift
1abd67caac Fix Tweeners to emit finished() when underlying object is deleted 2024-08-29 14:53:45 -04:00
kobewi
761d988d47 Add internal _finish() method to Tweener 2024-08-15 08:41:51 +02:00
kobewi
413c11357d Use Core/Scene stringnames consistently 2024-05-13 23:41:07 +02:00
A Thousand Ships
92814bafb7
[Animation] Improvements to Tween memory management
Using `ObjectID` instead of manually breaking reference cycles.
2024-02-26 18:58:03 +01:00
Rémi Verschelde
e45cc1781b
Merge pull request #82306 from KoBeWi/tween_literally_anything
Add `set_custom_interpolator()` to PropertyTweener
2024-02-17 00:22:45 +01:00
jsjtxietian
3c596094ab Fix pass int to tween's from with float property will be forced to interpolate as int 2024-01-22 10:47:52 +08:00
kobewi
20aecefd9b Fix Tween loop initial value 2023-12-02 20:20:50 +01:00
Silc Lizard (Tokage) Renew
80c9533810 Rework blending method in Variant animation for Int/Array/String 2023-11-16 21:37:18 +09:00
Rémi Verschelde
0e6160a00f
Merge pull request #81525 from KoBeWi/tweening_the_impossible
Check if property exists before tweening
2023-11-09 20:03:53 +01:00
kobewi
58f4984d60 Add set_custom_interpolator() to PropertyTweener 2023-10-12 16:41:51 +02:00
Mai Lavelle
5e15586ec2 Fixes to allow object-less callables throughout Godot
This fixes #81887
2023-10-06 16:31:35 -04:00
kobewi
bf9d971215 Check if property exists before tweening 2023-09-11 12:59:43 +02:00
kobewi
598d9972c8 Prevent errors if Tween callback's object is freed 2023-08-29 14:50:53 +02:00
kobewi
1660575bd8 Fix initial value with delay in PropertyTweener 2023-08-17 10:28:26 +02:00
kobewi
dbecf8bd1a Improve and clarify paused Tweens 2023-07-25 13:29:30 +02:00
Rakka Rage
780e21bcac Add TRANS_SPRING to Tween 2023-05-17 17:54:37 -04:00
kobewi
20f03884f2 Various Tween code improvements 2023-04-03 15:40:02 +02:00
John Pennycook
4cb2085543 Add get_loops_left() function to Tween
Implements godotengine/godot-proposals#5141.

Adds a new get_loops_left() function to Tween, allowing developers to
reason about how many times a tweening sequence will repeat and whether
to expect finished or loop_finished as the next signal.

Co-authored-by: Tomek <kobewi4e@gmail.com>
2023-03-20 20:49:31 -07:00
kobewi
45f4d59fa4 Check for type mismatch in PropertyTweener.from() 2023-02-28 17:16:56 +01:00
kobewi
17fe5c2b23 Fix tween_method() type validation 2023-02-12 22:08:25 +01:00
VolTer
5313bc90f6 Fix error messages of {}Tweener.new() 2023-01-30 17:58:20 +01:00
kobewi
1260cb0bfb Improve empty Tween error message 2023-01-16 10:30:21 +01:00
kobewi
f64dd732b8 Improve some Tween internals 2023-01-11 14:08:14 +01:00
Rémi Verschelde
d95794ec8a
One Copyright Update to rule them all
As many open source projects have started doing it, we're removing the
current year from the copyright notice, so that we don't need to bump
it every year.

It seems like only the first year of publication is technically
relevant for copyright notices, and even that seems to be something
that many companies stopped listing altogether (in a version controlled
codebase, the commits are a much better source of date of publication
than a hardcoded copyright statement).

We also now list Godot Engine contributors first as we're collectively
the current maintainers of the project, and we clarify that the
"exclusive" copyright of the co-founders covers the timespan before
opensourcing (their further contributions are included as part of Godot
Engine contributors).

Also fixed "cf." Frenchism - it's meant as "refer to / see".
2023-01-05 13:25:55 +01:00
kobewi
a6e02f149f Improve RefCounted support in Tween 2023-01-01 18:45:17 +01:00
bruvzg
0103af1ddd
Fix MSVC warnings, rename shadowed variables, fix uninitialized values, change warnings=all to use /W4. 2022-10-07 11:32:33 +03:00
Dave Palais
0c46068af0 Change time parameters and variables to double type
Addresses #65313
2022-09-26 13:52:54 -05:00
kobewi
1a462bc84e Fix crash when playing Tween right after finishing 2022-09-16 14:20:12 +02:00
Silc Renew
9d47e079b7 Move some methods to Animation from Variant for refactoring 2022-09-15 04:52:43 +09:00
Micky
2b18a4002c Cast between float and ints in Tween.tween_property() 2022-08-30 10:53:31 +02:00
Silc Renew
f7dd83ce60 Fix Quaternion Tween and implement ease baker 2022-08-22 19:04:58 +09: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
reduz
455c06ecd4 Implement Vector4, Vector4i, Projection
Implement built-in classes Vector4, Vector4i and Projection.

* Two versions of Vector4 (float and integer).
* A Projection class, which is a 4x4 matrix specialized in projection types.

These types have been requested for a long time, but given they were very corner case they were not added before.
Because in Godot 4, reimplementing parts of the rendering engine is now possible, access to these types (heavily used by the rendering code) becomes a necessity.

**Q**: Why Projection and not Matrix4?
**A**: Godot does not use Matrix2, Matrix3, Matrix4x3, etc. naming convention because, within the engine, these types always have a *purpose*. As such, Godot names them: Transform2D, Transform3D or Basis. In this case, this 4x4 matrix is _always_ used as a _Projection_, hence the naming.
2022-07-23 14:00:01 +02: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
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