Example #1
0
 public void LoadAnimatedModel(out Model model, string filePath)
 {
     model = Game.Content.Load <Model>(filePath);
     foreach (ModelMesh mesh in model.Meshes)
     {
         foreach (ModelMeshPart part in mesh.MeshParts)
         {
             SkinnedEffect skinnedEffect = part.Effect as SkinnedEffect;
             if (skinnedEffect != null)
             {
                 CustomSkinnedEffect newEffect = new CustomSkinnedEffect(toonAnimatedEffect);
                 newEffect.CopyFromSkinnedEffect(skinnedEffect);
                 newEffect.LightPositions = camera.lightPositions;
                 part.Effect = newEffect;
             }
         }
     }
 }
Example #2
0
 public void LoadAnimatedModel(out Model model, string filePath)
 {
     model = Game.Content.Load<Model>(filePath);
     foreach (ModelMesh mesh in model.Meshes)
     {
         foreach (ModelMeshPart part in mesh.MeshParts)
         {
             SkinnedEffect skinnedEffect = part.Effect as SkinnedEffect;
             if (skinnedEffect != null)
             {
                 CustomSkinnedEffect newEffect = new CustomSkinnedEffect(toonAnimatedEffect);
                 newEffect.CopyFromSkinnedEffect(skinnedEffect);
                 newEffect.LightPositions = camera.lightPositions;
                 part.Effect = newEffect;
             }
         }
     }
 }