private EngineNS.Graphics.Mesh.Animation.CGfxAnimationSequence CreateAnimation(EngineNS.GamePlay.Actor.GActor actor, RName animationName) { var rc = EngineNS.CEngine.Instance.RenderContext; var animationCom = new EngineNS.GamePlay.Component.GAnimationInstance(RName.GetRName("delisha.skt")); actor.AddComponent(animationCom); var animationSege = new EngineNS.Graphics.Mesh.Animation.CGfxAnimationSequence(); animationSege.Init(EngineNS.CEngine.Instance.RenderContext, animationName);//RName.GetRName("Mesh/fouraxisanim" + CEngineDesc.AnimationSegementExtension) var meshComp = actor.GetComponent <EngineNS.GamePlay.Component.GMeshComponent>(); //var pose = EngineNS.CEngine.Instance.SkeletonAssetManager.GetSkeleton(rc, RName.GetRName("delisha.skt")).BoneTab.Clone(); var skinModifier = meshComp.SceneMesh.MdfQueue.FindModifier <EngineNS.Graphics.Mesh.CGfxSkinModifier>(); skinModifier.AnimationPose = animationCom.AnimationPose; animationSege.AnimationPose = animationCom.AnimationPose; animationCom.AnimationNode = animationSege; return(animationSege); }
private EngineNS.Graphics.Mesh.Animation.CGfxAnimationBlendSpace CreateAnimationBlenSpace2D(EngineNS.GamePlay.Actor.GActor actor) { RName first = RName.GetRName("Mesh/Crouch_Aim_LD45" + CEngineDesc.AnimationSequenceExtension); RName second = RName.GetRName("Mesh/Crouch_Aim_RD45" + CEngineDesc.AnimationSequenceExtension); RName third = RName.GetRName("Mesh/Crouch_Aim_Center" + CEngineDesc.AnimationSequenceExtension); RName forth = RName.GetRName("Mesh/walk" + CEngineDesc.AnimationSequenceExtension); var rc = EngineNS.CEngine.Instance.RenderContext; var animationCom = new EngineNS.GamePlay.Component.GAnimationInstance(RName.GetRName("robot2.skt")); actor.AddComponent(animationCom); var firstAnim = new EngineNS.Graphics.Mesh.Animation.CGfxAnimationSequence(); firstAnim.Init(EngineNS.CEngine.Instance.RenderContext, first); var secondAnim = new EngineNS.Graphics.Mesh.Animation.CGfxAnimationSequence(); secondAnim.Init(EngineNS.CEngine.Instance.RenderContext, second); var thirdAnim = new EngineNS.Graphics.Mesh.Animation.CGfxAnimationSequence(); thirdAnim.Init(EngineNS.CEngine.Instance.RenderContext, third); var forthAnim = new EngineNS.Graphics.Mesh.Animation.CGfxAnimationSequence(); forthAnim.Init(EngineNS.CEngine.Instance.RenderContext, forth); var blendSpace = new EngineNS.Graphics.Mesh.Animation.CGfxAnimationBlendSpace(); blendSpace.AnimationPose = animationCom.AnimationPose; var meshComp = actor.GetComponent <EngineNS.GamePlay.Component.GMutiMeshComponent>(); foreach (var subMesh in meshComp.Meshes) { var skinModifier = subMesh.Value.MdfQueue.FindModifier <EngineNS.Graphics.Mesh.CGfxSkinModifier>(); skinModifier.AnimationPose = animationCom.AnimationPose; } blendSpace.AddSample(firstAnim, Vector3.Zero); blendSpace.AddSample(secondAnim, new Vector3(100, 0, 0)); blendSpace.AddSample(thirdAnim, new Vector3(0, 100, 0)); blendSpace.AddSample(forthAnim, new Vector3(100, 100, 0)); animationCom.AnimationNode = blendSpace; return(blendSpace); }
private EngineNS.Graphics.Mesh.Animation.CGfxAnimationSequence CreateMutiMeshAnimation(EngineNS.GamePlay.Actor.GActor actor, RName animationName) { var rc = EngineNS.CEngine.Instance.RenderContext; var animationCom = new EngineNS.GamePlay.Component.GAnimationInstance(RName.GetRName("robot2.skt")); actor.AddComponent(animationCom); var animationSege = new EngineNS.Graphics.Mesh.Animation.CGfxAnimationSequence(); animationSege.Init(EngineNS.CEngine.Instance.RenderContext, animationName);//RName.GetRName("Mesh/fouraxisanim" + CEngineDesc.AnimationSegementExtension) var meshComp = actor.GetComponent <EngineNS.GamePlay.Component.GMutiMeshComponent>(); foreach (var subMesh in meshComp.Meshes) { var skinModifier = subMesh.Value.MdfQueue.FindModifier <EngineNS.Graphics.Mesh.CGfxSkinModifier>(); skinModifier.AnimationPose = animationCom.AnimationPose; } animationSege.AnimationPose = animationCom.AnimationPose; animationCom.AnimationNode = animationSege; return(animationSege); }