Jump to content

  • Log In with Google      Sign In   
  • Create Account


xnaAnimationLibrary , XML


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
2 replies to this topic

#1 mrmohadnan   Members   -  Reputation: 279

Like
0Likes
Like

Posted 23 April 2013 - 08:36 AM

Hello , 

 

I have error in XNA 4.0 xml file , I am using XNA 4.0 + xna Animation Library for loading skinned models , because xna 4.0 fbx file does not support multiple animation clips , I create xml file to split the the "Take 001" clip like the following 
 

  <RemoveAfterTasks />     <SplitTask>       <Name>Walk</Name>       <StartFrame>2</StartFrame>       <EndFrame>14</EndFrame>     </SplitTask>
  <SplitTask>       <Name>Run</Name>       <StartFrame>16</StartFrame>       <EndFrame>26</EndFrame>     </SplitTask>

 


So , when run the program I have an error :
"The given key was not present in the dictionary. "

the XML file :

 

<?xml version="1.0" encoding="utf-8" ?> 
<Animations> 
  <Animation> 
    <Name>Take 001</Name> 
    <Framerate>30</Framerate> 
 
    <RemoveAfterTasks /> 
    <SplitTask> 
      <Name>Walk</Name> 
      <StartFrame>2</StartFrame> 
      <EndFrame>14</EndFrame> 
    </SplitTask> 
 
    <SplitTask> 
      <Name>Run</Name> 
      <StartFrame>16</StartFrame> 
      <EndFrame>26</EndFrame> 
    </SplitTask> 
 
    <SplitTask> 
      <Name>Jump</Name> 
      <StartFrame>28</StartFrame> 
      <EndFrame>40</EndFrame> 
    </SplitTask> 
 
    <SplitTask> 
      <Name>Jump2</Name> 
      <StartFrame>42</StartFrame> 
      <EndFrame>54</EndFrame> 
    </SplitTask> 
 
    <SplitTask> 
      <Name>CrouchDown</Name> 
      <StartFrame>56</StartFrame> 
      <EndFrame>59</EndFrame> 
    </SplitTask> 
 
    <SplitTask> 
      <Name>Crouch</Name> 
      <StartFrame>60</StartFrame> 
      <EndFrame>69</EndFrame> 
    </SplitTask> 
 
    <SplitTask> 
      <Name>GetUp</Name> 
      <StartFrame>70</StartFrame> 
      <EndFrame>74</EndFrame> 
    </SplitTask> 
 
    <SplitTask> 
      <Name>BattleIdle1</Name> 
      <StartFrame>75</StartFrame> 
      <EndFrame>88</EndFrame> 
    </SplitTask> 
 
    <SplitTask> 
      <Name>BattleIdle2</Name> 
      <StartFrame>90</StartFrame> 
      <EndFrame>110</EndFrame> 
    </SplitTask> 
 
    <SplitTask> 
      <Name>Attack1</Name> 
      <StartFrame>112</StartFrame> 
      <EndFrame>126</EndFrame> 
    </SplitTask> 
 
    <SplitTask> 
      <Name>Attack2</Name> 
      <StartFrame>128</StartFrame> 
      <EndFrame>142</EndFrame> 
    </SplitTask> 
 
    <SplitTask> 
      <Name>Attack3</Name> 
      <StartFrame>144</StartFrame> 
      <EndFrame>160</EndFrame> 
    </SplitTask> 
 
    <SplitTask> 
      <Name>Attack4</Name> 
      <StartFrame>162</StartFrame> 
      <EndFrame>180</EndFrame> 
    </SplitTask> 
 
    <SplitTask> 
      <Name>Attack5</Name> 
      <StartFrame>182</StartFrame> 
      <EndFrame>192</EndFrame> 
    </SplitTask> 
 
    <SplitTask> 
      <Name>Block</Name> 
      <StartFrame>194</StartFrame> 
      <EndFrame>210</EndFrame> 
    </SplitTask> 
 
    <SplitTask> 
      <Name>Die1</Name> 
      <StartFrame>212</StartFrame> 
      <EndFrame>227</EndFrame> 
    </SplitTask> 
 
    <SplitTask> 
      <Name>Die2</Name> 
      <StartFrame>230</StartFrame> 
      <EndFrame>251</EndFrame> 
    </SplitTask> 
 
    <SplitTask> 
      <Name>Yes</Name> 
      <StartFrame>253</StartFrame> 
      <EndFrame>272</EndFrame> 
    </SplitTask> 
 
    <SplitTask> 
      <Name>No</Name> 
      <StartFrame>274</StartFrame> 
      <EndFrame>290</EndFrame> 
    </SplitTask> 
 
    <SplitTask> 
      <Name>Idle1</Name> 
      <StartFrame>292</StartFrame> 
      <EndFrame>325</EndFrame> 
    </SplitTask> 
 
    <SplitTask> 
      <Name>Idle2</Name> 
      <StartFrame>327</StartFrame> 
      <EndFrame>360</EndFrame> 
    </SplitTask> 
 
  </Animation> 
</Animations> 

 

 



Sponsor:

#2 mrmohadnan   Members   -  Reputation: 279

Like
0Likes
Like

Posted 24 April 2013 - 01:31 PM

XNAnimation with XNA 4.0
 
Has anyone managed to use multiple animation clips with XNAnimation on XNA 4.0?
 
I added the XNAnimation projects (dev) to my project and it works on Windows and Xbox360. However, only one animation is available for StartClip and the .fbx clearly has more than one. Multiple animations worked with the same model on 3.1. Anyone knows why?

If I try to play an animation that used to work on 3.1, I get a KeyNotFoundException was unhandled : The given key was not present in the dictionary. in XNAnimation.ReadOnlyDictionary.

I'm using this line  to play the animation : 

m_animationController.StartClip(m_model.AnimationClips["walk"]); Which works on 3.1

 

This one works on 4.0 and 3.1

m_animationController.StartClip(m_model.AnimationClips["hit"]);

 

I have also tried with the sample model (PlayerMarine.fbx) and get the same error, only the "Idle" animation seems to be available, the dictionary only contains one Item (Idle).



#3 mrmohadnan   Members   -  Reputation: 279

Like
0Likes
Like

Posted 25 April 2013 - 03:21 AM

8x6lda07jcnf3na6g.jpg






Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS