337 Commits

Author SHA1 Message Date
a989837116 Fix diacritics
The big churn is from bumping us to Harfbuzz 6.0.0 (we were on a master from June 2022, 6.0.0 was released December 2022) as it fixes some diacritic positioning with Arabic text.

The main fix, however, comes from marshaling the glyph offsets to Dart (and storing them in C++ which we weren't doing). This is a translation offset within the local space (baseline and advance) of the glyph. It was causing our Arabic diacritics (the "accents" if you will) to be positioned incorrectly.

Prior to the fix:
![image](https://user-images.githubusercontent.com/454182/235834041-a683851a-96b0-4c72-adb9-f68c97682c14.png)

Post fix:
![image](https://user-images.githubusercontent.com/454182/235834074-23db8fab-08be-4529-98b3-f8a04ebe623a.png)

Same word displayed in Google Fonts (confirming correctness, also confirmed by an Arabic reader  on our Discord):
![CleanShot 2023-05-02 at 21 43 33@2x](https://user-images.githubusercontent.com/454182/235834273-9e423c7f-9dc2-48c3-afec-c7f7a9986416.png)

Diffs=
a8c1e3e75 Fix diacritics (#5200)
c7ecbe025 Run clang-format on .glsl files (#5180)
9945a7d2d Merge sbs_render_and_advance into master (#5181)
542e320d2 Discard empty verbs from RawPath (#5166)
2023-05-03 21:39:19 +00:00
4c81d5b0f4 Create add_to_project.yml
Adds all new issues to project board
2023-04-19 14:36:10 -07:00
86846ca956 Minor changes for publishing rive_flutter to pub.dev
Diffs=
8115f9a07 Minor changes for publishing rive_flutter to pub.dev (#5117)
abc600932 Propagate collapse to path composer. (#5116)
9266e0d30 Fix for runtime crash with skins nested in solo nodes. (#5109)
2023-04-14 00:17:17 +00:00
8379e840da Blend animation direct change
- silence a few linter issues
- update default blend animation mix value to be 100. its either 0 or 100, 1 made no sense. i think 100 is right.
- made a clamped input converter to set values between 0 & 100 nicely & it rounds values when you drag

adds option for selecting setting the mix input or the mix value on uat @alxgibsn, what do we want this to say? "Set Blend Value? "Set Mix Value?

<img width="320" alt="image" src="https://user-images.githubusercontent.com/1216025/229121083-d8233155-4bce-475e-bdb3-697ebd951360.png">

can have both by input and by value, they look very subtlely different
<img width="272" alt="image" src="https://user-images.githubusercontent.com/1216025/229121329-f8bd8596-0247-42f9-bd82-1979778b8ad3.png">

Diffs=
d9fc7d927 Blend animation direct change (#5080)
2023-04-03 12:14:44 +00:00
a7ba0546b9 add directBlendState by mix value, bypassing setting inputs
fixes https://github.com/rive-app/rive/issues/5039

lets you set integer values as input

https://user-images.githubusercontent.com/1216025/228241518-2d08812d-c283-4a15-a94d-9bb72544ecc3.mp4

todo (leaving because i want feedback first):
- [x] add tests
- [x] update cpp runtime
- [x] run `generate_core_runtime.sh`
- [x] run `generate_core.sh` for cpp

Diffs=
6df791fe4 add directBlendState by mix value, bypassing setting inputs (#5053)
2023-03-30 14:25:22 +00:00
6fa4cca892 Adds solo support to flutter runtime.
Diffs=
011f9ab58 Adds solo support to flutter runtime. (#5068)
d9952ae77 Fix clipping issue caused by wrong fillRule (#5067)
2023-03-29 22:36:54 +00:00
de05d9b449 Fixing solo nesting.
Fixes some visibility conditions JC caught while attempting to nest multiple solos into other solos a few times. Added tests for these conditions to both the editor and the C++ runtime.

Diffs=
2bc4acfba Fixing solo nesting. (#5066)
2023-03-29 20:12:22 +00:00
428b1a6dad Solos
So far:
- [x] Editor
- [x] Dart Tests
- [x] Flutter Runtime
- [x] C++ Runtime
- [x] C++ Tests

Hierarchy interaction:
<img width="280" alt="CleanShot 2023-03-24 at 21 44 53@2x" src="https://user-images.githubusercontent.com/454182/227696646-09f9cbe5-c482-4bab-aae9-b0b36c16047e.png">

Nesting:
<img width="394" alt="CleanShot 2023-03-24 at 21 45 23@2x" src="https://user-images.githubusercontent.com/454182/227696653-b1132ba1-5471-4c6d-9b59-20387389ae12.png">

Inspector active solo selection:
<img width="253" alt="CleanShot 2023-03-24 at 21 45 33@2x" src="https://user-images.githubusercontent.com/454182/227696660-6676acfa-15ab-4ae2-a866-4b7898bc1f52.png">

Animatable with timeline hierarchy value too:
<img width="510" alt="CleanShot 2023-03-24 at 21 46 07@2x" src="https://user-images.githubusercontent.com/454182/227696686-255064c9-43fd-4213-9e3f-9cd46cca9de3.png">

Diffs=
daaf140ba Solos (#5047)
44ef23f7e Text fix variable and opacity (#5017)
3c396d3b8 Text style variation at runtime. (#5014)
2023-03-28 23:39:09 +00:00
94344e123a remove a bunch of generated files
havent really done much to test things work, kinda hoping tests will fail/ windows will stop being able to be built. everything else is an example

Diffs=
41b699beb remove a bunch of generated files (#5002)
c0c8a45ae Reduce github log pollution (#5011)
ccab8df36 Pre-count array sizes in ContourMeasureIter::tryNext (#5010)
f4046e60b Rename reset to rewind. (#5004)
c6caafc24 Import Wang's formula for contour measuring (#5005)
72c5d2084 Port PLS to wasm (#5003)
2023-03-17 18:45:51 +00:00
ae4f4e71dd prepping flutter runtime release
just prepping for a rive-flutter runtime release

Diffs=
ea255ef1b prepping flutter runtime release (#4994)
6e95e7e1f fix up the viewer to progress time even when we miss a frame or two (#4912)
b90ac530a Decompose accounts for 0 scale, adds test. (#4975)
2023-03-13 19:19:49 +00:00
fbe1850620 force blend states to keepGoing
makes blend states keepGoing!

fixes a regression introduced when looking at keep going of states when deciding if to advance them. for blend states specifically mixing is done as well as animating animation instances, and if the mix value changes we need to apply this change.

@luigi-rosso struggled to build state machines into an automated test on the cpp side before. going to add one loading a `.riv` for this I think, at least to cover some basics here.

btw, I assume we also want this behaviour for direct blend states

https://2dimensions.slack.com/archives/CHMAP278R/p1677820699177779

Diffs=
2504d2ab2 force blend states to keepGoing (#4922)
2023-03-03 18:08:36 +00:00
fe57e817f3 Fix negative speeds in state machines
look commit by commit potentially, last couple of commits are running core generator

& its quite a small change code wise, so it'd be good to get feedback on the actual change sooner rather than later

there are at least a couple of changes in there that should make you question if this is a good idea so i expect some feedback.

add to cpp: (i just got it working in the viewer, probably broke some things)
- [x] negative time fix
- [x] combine state speed to determine time for state
- [x] no longer carry spilled time into new advances

add test
- [x] negative time fix to state machines
- [x] negative combined time state fix to state machines
- [ ] no longer carry spilled time into new advances @luigi-rosso i tried adding tests for this, but i was not really able to construct a state machine instance (with an animations, an animation state and the right transition) in tests I had to add a bunch of public methods all over the place, can you show me the way? probably not a blocker for merging this)

apply changes to rive_flutter
- [x] run script (ran both core generator and core generator runtime, the runtime one wanted to remove a load of comments so i didnt let those bits be committed. but still.. annoying)

Diffs=
bc6c6f467 Fix negative speeds in state machines (#4887)
040a27c1c Generate Android builds directly from premake (#4871)
12285f625 Put SIMD perf warnings behind a flag (#4861)
157a399d2 update id in code (#4855)
2023-02-28 11:53:47 +00:00
236ae26640 Speed 4793
adds speed on states!

currently just to animation states 👇
<img width="1121" alt="image" src="https://user-images.githubusercontent.com/1216025/217915050-0bea976f-88b1-4aef-aeb0-bed6f36cc577.png">

I've called this 'AdvanceableState', which we could make blendstates/etc inherit from to give em the powers... not sure if there's a better name people can come up with here... also not sure if that empty lookin' class is the right way to do it, so i'd love feedback on that (and if there's a different example somewhere that would be super helpful to see as well)

also fixed up the generator scripts for dart 3, at least the dart ones, the cpp ones were beyond my patience, gotta dart 2.12 for those...

also fixed an issue where we were checking speed against playing backwards, not speed and direction!

@alxgibsn going to bug you for some styling input

works in both editor and viewer!

going to look about adding a test.. or two....

https://user-images.githubusercontent.com/1216025/217915843-6126d3cf-bf19-4a9d-9a95-adb3a498e75d.mov

https://user-images.githubusercontent.com/1216025/217915852-252d4f78-280e-4a63-838c-39d6b27e3e31.mov

Diffs=
ffeb9afaf Speed 4793 (#4806)
2023-02-16 10:29:00 +00:00
27be816a46 Update flutter runtime
- ran ```dev/generate_core_runtime.sh build```
- cleaned up a lot of accumulated changes from the last few months that needed to be stripped/modified for the rutnime
- removed no longer supported lining options from analysis files
- fixed up defs for some editor only features so they don't transpile
- added some more details to changelog
- bumped pubspec version

Diffs=
aa8c750bd Update flutter runtime (#4835)
2023-02-15 23:47:35 +00:00
3941b7e932 Update ObjC formatting to look more similar to the C++
Also update the auto formatter to run on *.m and *.mm files, and effectively ban breaking on return types entirely, as I think this is ugly.

Diffs=
c7d125c7d Update ObjC formatting to look more similar to the C++
2023-02-15 17:24:54 +00:00
00798ca173 Perf/flutter runtime opacity check
- Adds checks to see if a drawable has a 0% opacity before performing draw commands
- Add skinning example

Diffs=
a61f4c6b5 apply changes to rive_core
8152b8a02 docs: update CHANGELOG
b8f61022c perf: check if opacity is 0 before drawing
4c4826e67 chore: add typedef argument names
ff94982f9 docs: add skinning sample
f1ddd88d4 Fix artboard pieces slowly popping in. (#4818)
3039909c2 Update to using deployment workflow similar to ios
53a8f9517 Fix direction when looping. (#4786)
4c5a576ad Fix ping pong hang (#4776)
ae1e02afc Fix tess test linking (#4773)
4ecbf9321 Fix remap based on issue JC caught. (#4771)
89e38b700 allow negative speed (#4770)
4d115b4c6 Adding GLSL100 for tess renderer. (#4767)
31a3972aa ios shaders for tess (#4765)
686e5125b Add dependency to correct grand parent for linear gradients. (#4753)
e737ee427 Revert "Update to using deployment workflow similar to ios"
de0e57d55 Update to using deployment workflow similar to ios
051769242 Runtime Text! (#4741)
331ad0d55 Build cleanups
2538229d6 Use Rive's libpng premake dependency in golden testing
42a0377bc Fix condition with trim paths where all contours are 0 length. (#4722)
ea1c83d02 Use os.copyfile() instead of the '{COPY}' command
5c03e1640 Remove forcing arch to arm64 for libpng (#4715)
404a04d35 Cleaning up libpng premake to be isolated/stand-alone. (#4713)
2023-02-13 18:13:08 +00:00
61df92e56f Publishing rive-app/flutter-wasm
Allows the editor to load it from unpkg.

Diffs=
a82894157 Publishing rive-app/flutter-wasm (#4693)
599748ccb Variable Fonts! (#4686)
2023-01-19 00:42:07 +00:00
9d2fe267da Published rive_flutter 0.10.1
Some minor updates that I made when publishing 0.10.1

Diffs=
f39fc2bb8 Published rive_flutter 0.10.1 (#4657)
2023-01-11 21:54:05 +00:00
0767844a56 style: updated example and readme
Diffs=
a259b57b2 style: clean up example app
483978f10 docs: update readme
2023-01-11 21:04:30 +00:00
82e5dc984c perf: fix didUpdateWidget and artboard config
This resolves a performance and usability issue where certain conditions would result in Rive needlessly reconfiguring/initializing the Rive artboard (as well as downloading/loading Rive files). If `onInit`, `animations`, `controllers`, or `stateMachines` were passed in as an argument to `RiveAnimation` the above issue is triggered on each widget rebuild. Under certain conditions this could result in an animation constantly restarting, bad performance, or Flutter ending up in a `setState` callback loop.

This PR also clears the list of local controllers each time init is called.

Resolves: https://github.com/rive-app/rive-flutter/issues/277

This also fixes bugs in our example app
- Play/Pause not working
- One shot animation behaving oddly

Diffs=
9af05d044 docs: update changelog
cb7fd6d14 test: add rive animation onInit tests
107ae16bc refactor: naming and call logic
6857aa691 docs: add additional code docs
f3ba4f015 perf: fix didUpdateWidget configure loop
7d0aaaff3 Adjust RiveAnimation didUpdateWidget condition (https://github.com/rive-app/rive-flutter/issues/278)
d4c6dd4ab Add more helper functions
6a8f9e249 Fix tess for C++11 and add to github action (#4571)
c8b5fdadd More SIMD features
87f079a10 RawPath::Iter improvements
2023-01-10 08:59:52 +00:00
cac78883af Value Graph Export + Runtime Support!!
- Renamed CubicInterpolator to CubicEaseInterpolator so that CubicInterpolator can now be the base class for both CubicEaseInterpolator and CubicValueInterpolator.
- Added CubicValueInterpolator to cpp and Flutter runtimes.
- Test in cpp runtime for the new cubic value interpolation.

Diffs=
1e80ad08f Value Graph Export + Runtime Support!! (#4524)
c532f8658 Shorten harfbuzz/SheenBidi directory paths
312a6c778 Drop the runtime to C++11
de4fe4d71 export MAKE_SKIA_FILE from all top-level scripts that build Skia
75a6b74b8 Beef up testing in tools/*
79f98695a Don't show interactive download progress when premaking on bots
b7fd1d825 Move golden testing into tools/
2022-12-14 22:15:43 +00:00
66d5fbb9cc first stab at having lottie assets behave as a folder
mostly want to show the interaction @alxgibsn

I still need to add tests, I also want to deal with uploading assets multiple times...

https://user-images.githubusercontent.com/1216025/204879568-ac9c53c9-1ced-486b-a78a-d7918ba30be1.mov

(as you can see in the video, assets get added individually as subassets, which get uploaded and takes a while, this is something i'm going to address first, so that we don't get stuck re uploading assets, there's also some drag and drop that was included with assets, you can reorder assets inside the lottie asset with this.. i'm not sure if its really worth having, or if i should see if we can disable it)

Diffs=
49df25d5a first stab at having lottie assets behave as a folder (#4483)
2a53e702a Get Rive tests compiling and running on MSVC
1733f0c5a Add Mat2D::mapPoints, optimized in SIMD
18aaa8cb5 explicitly include <iterator> for linux builds (#4467)
a954c197a Core text editing (#4446)
df91086ce Only __builtin_reduce_add for integer types
4e221ab4f Add Mat2D::findMaxScale()
362c448b3 Add more features to simd.hpp
210e0ab14 Add gradient animation steps (#4451)
5d661f39a Text in core (#4439)
2022-12-02 16:31:00 +00:00
af6e7d4c07 rive_common package
I started adding Text features to rive_core and realized that the dependency structure is going to be very difficult to manage here. Here's why:

## rive_core
 - has most of the runtime logic for things like IK, mesh, shapes, etc

## rive_flutter
 - depends on rive_core (not directly but we transpile rive_core to rive_flutter)
 - also includes the FFI/WASM text runtime

The problem is that rive_core needs the FFI/WASM text runtime. So we have a cyclic dependency. We've dealt with something similar (not quite as extreme) by abstracting things like nested artboards, but it gets very complex for a verbose API like the text one.

## rive_common
What this PR does is reworks a lot of shared logic like Math (Vec2D, Mat2D, etc), low-level text runtime (FFI/WASM), etc into a "rive_common" package. We've had shared packages before but none that have been shared by rive_flutter and rive_editor. I think it's finally time to bite the bullet here.

This will make it much easier to work through some of the obtuse abstraction patterns we've had to do to disambiguate if you're using a Vec2D from the runtime or the editor, for example.

Yes, this means we'll only have one set of math classes, one set of binary writer/readers, etc. I only did the bare minimum necessary to move text into rive_common in this first pass but we can do more as we go forward.

## TODO:
- [x] move Text WASM & FFI to rive_common
- [x] move Math used by text (Mat2D, Vec2D, TransformComponents, PathInterface, etc) to rive_common
- [x] move utilities used by text (binary reader/writer) to rive_common
- [x] fix core_generator and core_generator_runtime
- [x] fix github actions to use new paths
- [x] publish rive_common to pub.dev and unlist it

Diffs=
12c6ee130 rive_common package (#4434)
5a24e63d0 Initialize isClosed on TessRenderPath (#4431)
2022-11-19 20:19:05 +00:00
e618def5cd Text
Uses it in the artboard title but also updates the flutter runtime massively to support FFI & WASM C++ Rive Text. PRing to let the tests run.

Diffs=
3be5ff0d8 Text (#4372)
90245a5e1 Fix the Android debug build
0a0f3c267 Fix for missing animation in a blend state. (#4415)
440512dca Add simd::if_then_else (#4403)
ec9fb5bfc Revert "Update SIMD booleans to use bitwise logic operators"
701d8dee2 Update SIMD booleans to use bitwise logic operators
e98b93a61 Add SIMD fallbacks for missing builtins
466f68e3a Add some more core math and SIMD functions
2022-11-15 23:07:11 +00:00
0418b7310c Push rive-flutter downstream!
Re-enabling pushing downstream and making a small change to readme.

Diffs=
f15304279 Push rive-flutter downstream! (#4369)
2022-11-04 17:50:38 +00:00
01b864536a Update .rive_head 2022-11-04 10:48:12 -07:00
56e9c53211 Adding rive_head 2022-11-03 13:46:40 -07:00
85d6b04212 Changes from PR#258 2022-10-26 09:51:26 -07:00
6d229dcdd9 add simple test & an example showing selection of different rive files 2022-08-26 18:16:13 +01:00
fd7911330e Allow initialiing a Rive Animation providing the RiveFile.
Provide a way to set the Key, and check the widget to reconfigure the Rive animation if attributes changed
2022-08-26 18:16:13 +01:00
8f62c6b629 Updating for latest rive editor changes (events & nested animation sync). 2022-08-15 14:51:06 -07:00
7289978fa9 Adding support for align listener action. 2022-06-18 16:11:30 -07:00
9146fc0482 Prepping for publish. 2022-06-16 15:51:45 -07:00
e7262ee544 New corner radius logic. 2022-06-16 15:51:45 -07:00
6e97a2c076 Support for nested inputs. 2022-06-16 15:51:45 -07:00
ef8e8d63f5 cleanup for publish 2022-06-14 09:08:05 -07:00
4a5a49bae3 Rename events to listeners. 2022-05-30 17:10:04 -07:00
a2dabd6c41 antialiasing typo fixed
There is a typo on the `antialiasing` description.
2022-05-26 16:06:37 -07:00
7b15ea0cad fix warnings while maintaining compatibility 2022-05-26 16:05:25 -07:00
2ac9a3c5a0 Fixing origin 2022-05-26 15:24:55 -07:00
5b752605f6 Consider artboard origin when computed artboard local coord. 2022-05-26 15:24:55 -07:00
590d584a2f Fixes for nested state machines. 2022-05-26 13:15:59 -07:00
483f5b15f1 Changes for nested state machines. 2022-05-26 13:13:28 -07:00
b04b4a6469 Add missing lightswitch asset 2022-05-23 10:52:36 -04:00
fef6090e78 Cleanup based on previous PR 2022-05-18 11:15:37 -07:00
338d739bf7 Add a Listener to the RiveAnimation widget when a StateMachineController has events. 2022-05-18 11:15:37 -07:00
f31b576209 update binary writer to deal with large file sizes better 2022-05-18 10:51:31 -07:00
a5d9763aa8 Remove print 2022-05-16 15:30:16 +01:00
d6af3e1598 Add image decode listeners 2022-05-16 15:30:16 +01:00
cfc5a5d10e Upgrade Android Flutter app to work with newer version 2022-05-16 15:30:16 +01:00