mirror of
https://mirror.ghproxy.com/https://github.com/dexyfex/CodeWalker
synced 2025-01-09 23:15:09 +08:00
Reset ped model to T pose when no animatino selected
This commit is contained in:
parent
8bea5281f0
commit
629ee125a5
@ -937,9 +937,14 @@ namespace CodeWalker.GameFiles
|
|||||||
//SkinTransform = Matrix.Identity;//(for testing)
|
//SkinTransform = Matrix.Identity;//(for testing)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void ResetAnimTransform()
|
||||||
|
{
|
||||||
|
AnimRotation = Rotation;
|
||||||
|
AnimTranslation = Translation;
|
||||||
|
AnimScale = Scale;
|
||||||
|
UpdateAnimTransform();
|
||||||
|
UpdateSkinTransform();
|
||||||
|
}
|
||||||
|
|
||||||
public static uint ElfHash_Uppercased(string str)
|
public static uint ElfHash_Uppercased(string str)
|
||||||
{
|
{
|
||||||
|
@ -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()
|
private void UpdateBoneTransforms()
|
||||||
{
|
{
|
||||||
if (Bones == null) return;
|
if (Bones == null) return;
|
||||||
@ -390,6 +398,8 @@ namespace CodeWalker.Rendering
|
|||||||
UpdateAnim(ClipMapEntry); //animate skeleton/models
|
UpdateAnim(ClipMapEntry); //animate skeleton/models
|
||||||
}
|
}
|
||||||
|
|
||||||
|
UpdateBoneTransforms();
|
||||||
|
|
||||||
foreach (var model in HDModels)
|
foreach (var model in HDModels)
|
||||||
{
|
{
|
||||||
if (model == null) continue;
|
if (model == null) continue;
|
||||||
@ -534,8 +544,6 @@ namespace CodeWalker.Rendering
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
UpdateBoneTransforms();
|
|
||||||
|
|
||||||
}
|
}
|
||||||
private void UpdateAnimUV(ClipMapEntry cme, RenderableGeometry rgeom = null)
|
private void UpdateAnimUV(ClipMapEntry cme, RenderableGeometry rgeom = null)
|
||||||
{
|
{
|
||||||
|
@ -2512,6 +2512,13 @@ namespace CodeWalker.Rendering
|
|||||||
rndbl.ClipDict = animClip.Clip?.Ycd;
|
rndbl.ClipDict = animClip.Clip?.Ycd;
|
||||||
rndbl.HasAnims = true;
|
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);
|
return RenderRenderable(rndbl, arche, entity);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user