Engines/FlatRedBallXNA/FlatRedBall.Content/ModelAnimation/AnimationProcessor.cs
/// <summary>
/// Produces ModelAnimationInfo from skeleton and animations.
/// </summary>
/// <param name="input">skeleton</param>
/// <param name="context">The context for this processor</param>
/// <returns>AnimationContentDictionary</returns>
Produces ModelAnimationInfo from skeleton and animations.
Produces ModelAnimationInfo from skeleton and animations .
public override AnimationContentDictionary Process(BoneContent input, ContentProcessorContext context)
        {
            inputSkeleton = input;
            inputSkeleton.Identity.FragmentIdentifier = "";
            this.context = context;
            string modelFilePath = GetModelFilePath(inputSkeleton.Identity);
            if (modelFilePath != null)
            {
                context.Logger.LogWarning("", inputSkeleton.Identity,
                    "animation will be checked against model " + modelFilePath);
                ExternalReference<NodeContent> er = new ExternalReference<NodeContent>(modelFilePath);
                model = (NodeContent)context.BuildAndLoadAsset<NodeContent, Object>(er, "PassThroughProcessor");
                modelSkeleton = MeshHelper.FindSkeleton(model);
                CheckBones(modelSkeleton, inputSkeleton);
            }
            else
            {
                context.Logger.LogWarning("", inputSkeleton.Identity,
                    "corresponding model not found");
                context.Logger.LogWarning("", inputSkeleton.Identity,
                    "animation filename should follow the <modelName>_<animationName>.<ext> pattern to get animation skeleton checked against model");
            }
            AnimationContentDictionary animations = Interpolate(input.Animations);
            return animations;
        }
public override AnimationContentDictionary Process ( BoneContent input , ContentProcessorContext context ) { inputSkeleton = input ; inputSkeleton . Identity . FragmentIdentifier = " " ; this . context = context ; string modelFilePath = GetModelFilePath ( inputSkeleton . Identity ) ; if ( modelFilePath != null ) { context . Logger . LogWarning ( " " , inputSkeleton . Identity , " " + modelFilePath ) ; ExternalReference < NodeContent > er = new ExternalReference < NodeContent > ( modelFilePath ) ; model = ( NodeContent ) context . BuildAndLoadAsset < NodeContent , Object > ( er , " " ) ; modelSkeleton = MeshHelper . FindSkeleton ( model ) ; CheckBones ( modelSkeleton , inputSkeleton ) ; } else { context . Logger . LogWarning ( " " , inputSkeleton . Identity , " " ) ; context . Logger . LogWarning ( " " , inputSkeleton . Identity , " " ) ; } AnimationContentDictionary animations = Interpolate ( input . Animations ) ; return animations ; }
Produces ModelAnimationInfo from skeleton and animations.
Produces ModelAnimationInfo from skeleton and animations .
None
input
BoneContent
None
context
ContentProcessorContext
The context for this processor
The context for this processor