mirror of
https://mirror.ghproxy.com/https://github.com/dexyfex/CodeWalker
synced 2026-05-14 21:32:38 +08:00
Reset ped model to T pose when no animatino selected
This commit is contained in:
+11
-3
@@ -358,7 +358,15 @@ namespace CodeWalker.Rendering
|
||||
}
|
||||
|
||||
|
||||
|
||||
public void ResetBoneTransforms()
|
||||
{
|
||||
if (Bones == null) return;
|
||||
foreach (var bone in Bones)
|
||||
{
|
||||
bone.ResetAnimTransform();
|
||||
}
|
||||
UpdateBoneTransforms();
|
||||
}
|
||||
private void UpdateBoneTransforms()
|
||||
{
|
||||
if (Bones == null) return;
|
||||
@@ -390,6 +398,8 @@ namespace CodeWalker.Rendering
|
||||
UpdateAnim(ClipMapEntry); //animate skeleton/models
|
||||
}
|
||||
|
||||
UpdateBoneTransforms();
|
||||
|
||||
foreach (var model in HDModels)
|
||||
{
|
||||
if (model == null) continue;
|
||||
@@ -534,8 +544,6 @@ namespace CodeWalker.Rendering
|
||||
}
|
||||
|
||||
|
||||
UpdateBoneTransforms();
|
||||
|
||||
}
|
||||
private void UpdateAnimUV(ClipMapEntry cme, RenderableGeometry rgeom = null)
|
||||
{
|
||||
|
||||
@@ -2512,6 +2512,13 @@ namespace CodeWalker.Rendering
|
||||
rndbl.ClipDict = animClip.Clip?.Ycd;
|
||||
rndbl.HasAnims = true;
|
||||
}
|
||||
else if ((arche == null) && (rndbl.ClipMapEntry != null))
|
||||
{
|
||||
rndbl.ClipMapEntry = null;
|
||||
rndbl.ClipDict = null;
|
||||
rndbl.HasAnims = false;
|
||||
rndbl.ResetBoneTransforms();
|
||||
}
|
||||
|
||||
return RenderRenderable(rndbl, arche, entity);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user