mirror of
https://github.com/GTA-ASM/SanAndreasUnity
synced 2024-11-14 00:07:15 +00:00
support loading anims which have invalid bone ids
This commit is contained in:
parent
ee2922b241
commit
e8581c0fee
2 changed files with 10 additions and 2 deletions
|
@ -58,9 +58,12 @@ namespace SanAndreasUnity.Importing.Conversion
|
|||
|
||||
foreach (var bone in animation.Bones)
|
||||
{
|
||||
if (-1 == bone.BoneId) // what are these used for ?
|
||||
if (!frames.HasBoneWithId(bone.BoneId)) // what are these used for ?
|
||||
{
|
||||
Debug.LogWarning($"Bone with id {bone.BoneId} does not exist");
|
||||
continue;
|
||||
|
||||
}
|
||||
|
||||
var bFrames = bone.Frames;
|
||||
var frame = frames.GetByBoneId(bone.BoneId);
|
||||
|
||||
|
|
|
@ -49,6 +49,11 @@ namespace SanAndreasUnity.Behaviours
|
|||
return _frames[index];
|
||||
}
|
||||
|
||||
public bool HasBoneWithId(int boneId)
|
||||
{
|
||||
return _boneIdDict.ContainsKey(boneId);
|
||||
}
|
||||
|
||||
public Frame GetByBoneId(int boneId)
|
||||
{
|
||||
return _boneIdDict[boneId];
|
||||
|
|
Loading…
Reference in a new issue