mirror of
https://github.com/rive-app/rive-flutter.git
synced 2025-06-28 02:37:16 +08:00
Getting state machine and bones working with nnbd.
This commit is contained in:
@ -27,8 +27,7 @@ class StateMachineLayerImporter extends ImportStackObject {
|
|||||||
int artboardAnimationIndex = state.animationId;
|
int artboardAnimationIndex = state.animationId;
|
||||||
assert(artboardAnimationIndex >= 0 &&
|
assert(artboardAnimationIndex >= 0 &&
|
||||||
artboardAnimationIndex < artboardImporter.animations.length);
|
artboardAnimationIndex < artboardImporter.animations.length);
|
||||||
state.animationId =
|
state.animation = artboardImporter.animations[artboardAnimationIndex];
|
||||||
artboardImporter.animations[artboardAnimationIndex].id;
|
|
||||||
}
|
}
|
||||||
for (final transition in state.transitions) {
|
for (final transition in state.transitions) {
|
||||||
// At import time the stateToId is an index relative to the entire layer
|
// At import time the stateToId is an index relative to the entire layer
|
||||||
|
@ -23,12 +23,4 @@ class AnimationState extends AnimationStateBase {
|
|||||||
void animationIdChanged(int from, int to) {
|
void animationIdChanged(int from, int to) {
|
||||||
animation = id == Core.missingId ? null : context.resolve(to);
|
animation = id == Core.missingId ? null : context.resolve(to);
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
|
||||||
void onAddedDirty() {
|
|
||||||
super.onAddedDirty();
|
|
||||||
if (animationId != Core.missingId) {
|
|
||||||
animation = context.resolve(animationId);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -56,6 +56,12 @@ class Skin extends SkinBase {
|
|||||||
(parent as Skinnable).addSkin(this);
|
(parent as Skinnable).addSkin(this);
|
||||||
parent!.markRebuildDependencies();
|
parent!.markRebuildDependencies();
|
||||||
}
|
}
|
||||||
|
_worldTransform[0] = xx;
|
||||||
|
_worldTransform[1] = xy;
|
||||||
|
_worldTransform[2] = yx;
|
||||||
|
_worldTransform[3] = yy;
|
||||||
|
_worldTransform[4] = tx;
|
||||||
|
_worldTransform[5] = ty;
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
@ -5,7 +5,7 @@ export 'package:rive/src/generated/bones/tendon_base.dart';
|
|||||||
|
|
||||||
class Tendon extends TendonBase {
|
class Tendon extends TendonBase {
|
||||||
final Mat2D _bind = Mat2D();
|
final Mat2D _bind = Mat2D();
|
||||||
Mat2D? _inverseBind = Mat2D();
|
Mat2D? _inverseBind;
|
||||||
SkeletalComponent _bone = SkeletalComponent.unknown;
|
SkeletalComponent _bone = SkeletalComponent.unknown;
|
||||||
SkeletalComponent get bone => _bone;
|
SkeletalComponent get bone => _bone;
|
||||||
Mat2D get inverseBind {
|
Mat2D get inverseBind {
|
||||||
@ -22,6 +22,12 @@ class Tendon extends TendonBase {
|
|||||||
void onAddedDirty() {
|
void onAddedDirty() {
|
||||||
super.onAddedDirty();
|
super.onAddedDirty();
|
||||||
_bone = context.resolveWithDefault(boneId, SkeletalComponent.unknown);
|
_bone = context.resolveWithDefault(boneId, SkeletalComponent.unknown);
|
||||||
|
_bind[0] = xx;
|
||||||
|
_bind[1] = xy;
|
||||||
|
_bind[2] = yx;
|
||||||
|
_bind[3] = yy;
|
||||||
|
_bind[4] = tx;
|
||||||
|
_bind[5] = ty;
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
@ -6,8 +6,6 @@ import 'package:rive/src/rive_core/shapes/path_vertex.dart';
|
|||||||
import 'package:rive/src/generated/shapes/points_path_base.dart';
|
import 'package:rive/src/generated/shapes/points_path_base.dart';
|
||||||
export 'package:rive/src/generated/shapes/points_path_base.dart';
|
export 'package:rive/src/generated/shapes/points_path_base.dart';
|
||||||
|
|
||||||
enum PointsPathEditMode { off, creating, editing }
|
|
||||||
|
|
||||||
class PointsPath extends PointsPathBase with Skinnable {
|
class PointsPath extends PointsPathBase with Skinnable {
|
||||||
final List<PathVertex> _vertices = [];
|
final List<PathVertex> _vertices = [];
|
||||||
PointsPath() {
|
PointsPath() {
|
||||||
|
Reference in New Issue
Block a user