-
Notifications
You must be signed in to change notification settings - Fork 198
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use artboard properties as transition conditions
Adding support for transition conditions based on artboard properties. transition_artboard_condition extends from transition_viewmodel_condition. It might be good to rename transition_viewmodel_condition to transition_property_condition at some point since it is extensible enough to support viewmodels, but also with other properties like here. Diffs= 93cc33b45 Use artboard properties as transition conditions (#7796) c5fc07de9 Init NestedAnimation's nestedArtboard as nullptr (#7857) fb7756072 added some simple windows build scripts to make building on windows from powershell or command prompt easier (#7800) ed56d2de6 editor: nine-slicing core data type definitions (#7840) Co-authored-by: hernan <hernan@rive.app>
- Loading branch information
Showing
4 changed files
with
79 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
4fb978a9230fc006b5e575364f062907e7dd2afe | ||
93cc33b45086e528b22d1245a8f7855bac299a21 |
19 changes: 19 additions & 0 deletions
19
lib/src/generated/animation/transition_artboard_condition_base.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
// Core automatically generated | ||
// lib/src/generated/animation/transition_artboard_condition_base.dart. | ||
// Do not modify manually. | ||
|
||
import 'package:rive/src/generated/animation/transition_condition_base.dart'; | ||
import 'package:rive/src/rive_core/animation/transition_viewmodel_condition.dart'; | ||
|
||
abstract class TransitionArtboardConditionBase | ||
extends TransitionViewModelCondition { | ||
static const int typeKey = 497; | ||
@override | ||
int get coreType => TransitionArtboardConditionBase.typeKey; | ||
@override | ||
Set<int> get coreTypes => { | ||
TransitionArtboardConditionBase.typeKey, | ||
TransitionViewModelConditionBase.typeKey, | ||
TransitionConditionBase.typeKey | ||
}; | ||
} |
54 changes: 54 additions & 0 deletions
54
lib/src/generated/animation/transition_property_artboard_comparator_base.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
// Core automatically generated | ||
// nullnull | ||
// t. | ||
// Do not modify manually. | ||
|
||
import 'package:rive/src/core/core.dart'; | ||
import 'package:rive/src/generated/animation/transition_comparator_base.dart'; | ||
import 'package:rive/src/rive_core/animation/transition_property_comparator.dart'; | ||
|
||
abstract class TransitionPropertyArtboardComparatorBase | ||
extends TransitionPropertyComparator { | ||
static const int typeKey = 496; | ||
@override | ||
int get coreType => TransitionPropertyArtboardComparatorBase.typeKey; | ||
@override | ||
Set<int> get coreTypes => { | ||
TransitionPropertyArtboardComparatorBase.typeKey, | ||
TransitionPropertyComparatorBase.typeKey, | ||
TransitionComparatorBase.typeKey | ||
}; | ||
|
||
/// -------------------------------------------------------------------------- | ||
/// PropertyType field with key 677. | ||
static const int propertyTypePropertyKey = 677; | ||
static const int propertyTypeInitialValue = 0; | ||
int _propertyType = propertyTypeInitialValue; | ||
|
||
/// Integer representation of the artboard's property used for condition | ||
int get propertyType => _propertyType; | ||
|
||
/// Change the [_propertyType] field value. | ||
/// [propertyTypeChanged] will be invoked only if the field's value has | ||
/// changed. | ||
set propertyType(int value) { | ||
if (_propertyType == value) { | ||
return; | ||
} | ||
int from = _propertyType; | ||
_propertyType = value; | ||
if (hasValidated) { | ||
propertyTypeChanged(from, value); | ||
} | ||
} | ||
|
||
void propertyTypeChanged(int from, int to); | ||
|
||
@override | ||
void copy(Core source) { | ||
super.copy(source); | ||
if (source is TransitionPropertyArtboardComparatorBase) { | ||
_propertyType = source._propertyType; | ||
} | ||
} | ||
} |
5 changes: 5 additions & 0 deletions
5
lib/src/rive_core/animation/transition_artboard_condition.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import 'package:rive/src/generated/animation/transition_artboard_condition_base.dart'; | ||
|
||
export 'package:rive/src/generated/animation/transition_artboard_condition_base.dart'; | ||
|
||
class TransitionArtboardCondition extends TransitionArtboardConditionBase {} |