Event fixes

Addresses issues brought up here:
https://2dimensions.slack.com/archives/CLLCU09T6/p1694766559770229

- Custom properties not updating when expected.
- Events not firing on first frame.

One important aspect of all of this:
- Custom properties on events update with LinearAnimation.apply.
- Events on timelines and state machines accrue/report during StateMachine/LinearAnimation.advance

These could happen when the state machine would transition to a layer with an animation. The first frame would apply with mix 0 meaning all non-mixable properties wouldn't be applied per https://github.com/rive-app/rive/pull/5960/files.

I took a slightly different approach. Now apply will always try to apply values. If mix is 0, non mixing properties will apply. I think semantically this makes more sense too. If you don't want to apply, don't apply. Apply with mix 0 is effectively a no-op as we had it before, so it was just a perf suck.

So I re-worked the various call sites for apply to not call it when attempting to mix in an effectively mixed-out animation. This has one caveat for blend states. Because the blend state advances all the animations in sync, .advance must still be called when mix is 0, so events will still report but custom property keyframes in mixed out animations will not update. I think that's reasonable, but may not be immediately apparent. We can opt to not report events when the mix is 0 by introducing a "reportEvents" boolean to advance, or add an option to the blend state for whether or not they should report.

Diffs=
236d788ea Event fixes (#5997)

Co-authored-by: Alex Gibson <agibson.uk@gmail.com>
Co-authored-by: Luigi Rosso <luigi-rosso@users.noreply.github.com>
diff --git a/.rive_head b/.rive_head
index 667a7e2..3622949 100644
--- a/.rive_head
+++ b/.rive_head
@@ -1 +1 @@
-05e1afaf3419e5c5c46a747690c5591174801de6
+236d788ea3cf8f184a026a1b69c14af60003169c
diff --git a/include/rive/animation/blend_state_instance.hpp b/include/rive/animation/blend_state_instance.hpp
index c95111a..fb52f12 100644
--- a/include/rive/animation/blend_state_instance.hpp
+++ b/include/rive/animation/blend_state_instance.hpp
@@ -63,6 +63,9 @@
         {
             if (animation.m_AnimationInstance.keepGoing())
             {
+                // Should animations with m_Mix == 0.0 advance? They will
+                // trigger events and the event properties (if any) will not be
+                // updated by animationInstance.apply
                 animation.m_AnimationInstance.advance(seconds, stateMachineInstance);
             }
         }
@@ -73,6 +76,10 @@
         for (auto& animation : m_AnimationInstances)
         {
             float m = mix * animation.m_Mix;
+            if (m == 0.0f)
+            {
+                continue;
+            }
             animation.m_AnimationInstance.apply(m);
         }
     }
diff --git a/src/animation/keyframe_id.cpp b/src/animation/keyframe_id.cpp
index 81a0a9e..dfa8fcc 100644
--- a/src/animation/keyframe_id.cpp
+++ b/src/animation/keyframe_id.cpp
@@ -5,9 +5,7 @@
 
 void KeyFrameId::apply(Core* object, int propertyKey, float mix)
 {
-    if (mix > 0) {
-        CoreRegistry::setUint(object, propertyKey, value());
-    }
+    CoreRegistry::setUint(object, propertyKey, value());
 }
 
 void KeyFrameId::applyInterpolation(Core* object,
@@ -16,7 +14,5 @@
                                     const KeyFrame* nextFrame,
                                     float mix)
 {
-    if (mix > 0) {
-        CoreRegistry::setUint(object, propertyKey, value());
-    }
+    CoreRegistry::setUint(object, propertyKey, value());
 }
\ No newline at end of file
diff --git a/src/animation/keyframe_string.cpp b/src/animation/keyframe_string.cpp
index fdbdcc3..7968dda 100644
--- a/src/animation/keyframe_string.cpp
+++ b/src/animation/keyframe_string.cpp
@@ -5,9 +5,7 @@
 
 void KeyFrameString::apply(Core* object, int propertyKey, float mix)
 {
-    if (mix > 0) {
-        CoreRegistry::setString(object, propertyKey, value());
-    }
+    CoreRegistry::setString(object, propertyKey, value());
 }
 
 void KeyFrameString::applyInterpolation(Core* object,
@@ -16,7 +14,5 @@
                                         const KeyFrame* nextFrame,
                                         float mix)
 {
-    if (mix > 0) {
-        CoreRegistry::setString(object, propertyKey, value());
-    }
+    CoreRegistry::setString(object, propertyKey, value());
 }
\ No newline at end of file
diff --git a/src/animation/nested_remap_animation.cpp b/src/animation/nested_remap_animation.cpp
index 55d6b24..92b9465 100644
--- a/src/animation/nested_remap_animation.cpp
+++ b/src/animation/nested_remap_animation.cpp
@@ -20,7 +20,7 @@
 
 void NestedRemapAnimation::advance(float elapsedSeconds)
 {
-    if (m_AnimationInstance != nullptr)
+    if (m_AnimationInstance != nullptr && mix() != 0.0f)
     {
         m_AnimationInstance->apply(mix());
     }
diff --git a/src/animation/nested_simple_animation.cpp b/src/animation/nested_simple_animation.cpp
index 50286d8..89ff29f 100644
--- a/src/animation/nested_simple_animation.cpp
+++ b/src/animation/nested_simple_animation.cpp
@@ -11,6 +11,9 @@
         {
             m_AnimationInstance->advance(elapsedSeconds * speed());
         }
-        m_AnimationInstance->apply(mix());
+        if (mix() != 0.0f)
+        {
+            m_AnimationInstance->apply(mix());
+        }
     }
 }
\ No newline at end of file
diff --git a/src/animation/state_machine_instance.cpp b/src/animation/state_machine_instance.cpp
index a01685d..54c337b 100644
--- a/src/animation/state_machine_instance.cpp
+++ b/src/animation/state_machine_instance.cpp
@@ -25,6 +25,7 @@
 #include "rive/shapes/shape.hpp"
 #include "rive/core/field_types/core_callback_type.hpp"
 #include "rive/generated/core_registry.hpp"
+#include "rive/math/math_types.hpp"
 #include <unordered_map>
 
 using namespace rive;