From 8e6bb1e5817986cb84d06dcbeaaec4c938d2d8d9 Mon Sep 17 00:00:00 2001 From: bodymovin Date: Sat, 5 Oct 2024 01:49:18 +0000 Subject: [PATCH] enable all viewmodels as source for a condition this extends state machine conditions to support any ViewModel property as the source of a condition instead of restricting it to the view model that is explicitly provided to the artboard. This mimics the same behavior that artboard objects have, where they can target any ViewModel as the source for data binding. This was surfaced from trying to build the fighters menu, where some properties are provided by the parent's data context, and not the component's data context itself. Diffs= 5d5d418b7 enable all viewmodels as source for a condition (#8284) Co-authored-by: hernan --- .rive_head | 2 +- src/nested_artboard.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.rive_head b/.rive_head index cb523f27..9218a09b 100644 --- a/.rive_head +++ b/.rive_head @@ -1 +1 @@ -7bef90845ad58f2787c92e1e5dc191dae2b8f8fb +5d5d418b7316aa555edb7f8ada7f20714430bdfe diff --git a/src/nested_artboard.cpp b/src/nested_artboard.cpp index 7e4e76f8..7d80dcc5 100644 --- a/src/nested_artboard.cpp +++ b/src/nested_artboard.cpp @@ -298,7 +298,7 @@ void NestedArtboard::dataContextFromInstance(ViewModelInstance* viewModelInstanc { if (animation->is()) { - animation->as()->dataContextFromInstance(viewModelInstance); + animation->as()->dataContext(artboardInstance()->dataContext()); } } } \ No newline at end of file