add frame length check
This commit is contained in:
1 parent
d6ec9ce9b3
commit
07b493afd2
1 file changed
+5
-1
@@ -15,7 +15,11 @@ class Animation {
|
|||||||
final Float32List? boneTransforms;
|
final Float32List? boneTransforms;
|
||||||
|
|
||||||
Animation(this.morphData, this.numMorphWeights, this.boneTransforms,
|
Animation(this.morphData, this.numMorphWeights, this.boneTransforms,
|
||||||
this.boneNames, this.meshNames, this.numFrames, this.frameLengthInMs);
|
this.boneNames, this.meshNames, this.numFrames, this.frameLengthInMs) {
|
||||||
|
if (morphData != null && morphData!.length != numFrames * numMorphWeights) {
|
||||||
|
throw Exception("Mismatched animation data with frame length");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Animation.from(
|
Animation.from(
|
||||||
{required List<List<double>> morphData,
|
{required List<List<double>> morphData,
|
||||||
|
|||||||
Reference in new issue
Block a user