Skip to content

Commit

Permalink
Nnnn apply target to source on change
Browse files Browse the repository at this point in the history
This PR reworks how "source to target" binding works.
Previously, any binding marked as "source to target" would run at every frame setting the value to the source, relying on the fact that, after the first frame, it would be setting the same value subsequently and nothing would change.
But that prevents changing the view model source value externally since it would be overwritten immediately.
This PR solves this by keeping track of value changes at the binding level.
It also addresses memory leaks by not creating a new data value on every frame.
And it renames some methods for clarity.

Diffs=
63642c62d4 Nnnn apply target to source on change (#9049)
e417bb4754 add support for state transition duration binding (#9061)
  • Loading branch information
bodymovin committed Feb 19, 2025
1 parent 84a1061 commit 5b60eef
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .rive_head
Original file line number Diff line number Diff line change
@@ -1 +1 @@
98cac08e6a7ae298cf620f3cbc05cdc9233de61c
63642c62d46f41939545609dd151b68d0f4f67fe
2 changes: 1 addition & 1 deletion wasm/submodules/rive-runtime
Submodule rive-runtime updated 35 files
+1 −1 .rive_head
+2 −1 dev/defs/animation/state_transition.json
+40 −8 include/rive/data_bind/context/context_value.hpp
+9 −2 include/rive/data_bind/context/context_value_boolean.hpp
+9 −1 include/rive/data_bind/context/context_value_color.hpp
+9 −1 include/rive/data_bind/context/context_value_enum.hpp
+9 −1 include/rive/data_bind/context/context_value_number.hpp
+9 −1 include/rive/data_bind/context/context_value_string.hpp
+9 −1 include/rive/data_bind/context/context_value_trigger.hpp
+1 −1 include/rive/data_bind/converters/data_converter.hpp
+1 −0 include/rive/data_bind/converters/data_converter_interpolator.hpp
+1 −0 include/rive/data_bind/converters/data_converter_operation_value.hpp
+4 −0 include/rive/data_bind/converters/data_converter_range_mapper.hpp
+3 −0 include/rive/data_bind/converters/data_converter_string_pad.hpp
+1 −0 include/rive/data_bind/converters/data_converter_string_trim.hpp
+2 −0 include/rive/data_bind/converters/data_converter_to_string.hpp
+1 −1 include/rive/data_bind/data_bind.hpp
+1 −0 include/rive/data_bind/data_values/data_value.hpp
+1 −1 src/animation/listener_viewmodel_change.cpp
+4 −0 src/animation/state_machine_instance.cpp
+42 −29 src/data_bind/context/context_value.cpp
+11 −4 src/data_bind/context/context_value_boolean.cpp
+11 −4 src/data_bind/context/context_value_color.cpp
+18 −9 src/data_bind/context/context_value_enum.cpp
+14 −9 src/data_bind/context/context_value_number.cpp
+11 −4 src/data_bind/context/context_value_string.cpp
+11 −4 src/data_bind/context/context_value_trigger.cpp
+1 −1 src/data_bind/converters/data_converter.cpp
+3 −1 src/data_bind/converters/data_converter_interpolator.cpp
+5 −0 src/data_bind/converters/data_converter_operation_value.cpp
+9 −1 src/data_bind/converters/data_converter_range_mapper.cpp
+7 −1 src/data_bind/converters/data_converter_string_pad.cpp
+3 −1 src/data_bind/converters/data_converter_string_trim.cpp
+5 −1 src/data_bind/converters/data_converter_to_string.cpp
+11 −3 src/data_bind/data_bind.cpp

0 comments on commit 5b60eef

Please sign in to comment.