Skip to content

Commit

Permalink
Use artboard properties as transition conditions
Browse files Browse the repository at this point in the history
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
bodymovin and bodymovin committed Aug 16, 2024
1 parent 76b5584 commit a0216e0
Show file tree
Hide file tree
Showing 4 changed files with 79 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .rive_head
Original file line number Diff line number Diff line change
@@ -1 +1 @@
4fb978a9230fc006b5e575364f062907e7dd2afe
93cc33b45086e528b22d1245a8f7855bac299a21
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
};
}
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;
}
}
}
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 {}

0 comments on commit a0216e0

Please sign in to comment.