Let’s see… model which causes the exception gives the Matrix[] of size 73, so that’s one issue explained. Ticking “FixRealBoneRoot” doesn’t help, neither does “SwapWindingOrder” as per @DexterZ 's suggestion.
As requested, exception message is "Value does not fall within the expected range".
Stacktrace (formatted for readability):
at Microsoft.Xna.Framework.Graphics.SkinnedEffect.SetBoneTransforms(Matrix[] boneTransforms) at _3DFightTest.Game1.Draw(GameTime gameTime) in C:\\Users\\Matic\\Source\\Repos\\3DFightTest\\3DFightTest\\Game1.cs:line 109 at Microsoft.Xna.Framework.Game.DoDraw(GameTime gameTime) at Microsoft.Xna.Framework.Game.Tick() at Microsoft.Xna.Framework.SdlGamePlatform.RunLoop() at Microsoft.Xna.Framework.Game.Run(GameRunBehavior runBehavior) at _3DFightTest.Program.Main() in C:\\Users\\Matic\\Source\\Repos\\3DFightTest\\3DFightTest\\Program.cs:line 17
Blender file importer which I used, however, gives the array length of 51. Other model gives the same discrepancy, with .fbx giving 51 bones and .blend 44. I’ve managed to figure out what the discrepancy is with a couple of Debug.Write() statements; turns out my .fbx models have couple of leaf bones which are not present in the original (which ups the amount of bones in knight model beyond limit), so that’s probably the problem with export.
I’ve also managed to get model size in line by multiplying world matrix with scaling matrix, so only model deformation remains (“noodle limbs” being the most prominent). At this point, after reading post with similar issue, I’m suspecting it’s the problem with Blender itself. Will report if I fix things, but until then, I’m open for all additional suggestions.
EDIT: I found out the reason for deformation in one model I’ve been testing - part of the skeleton armature is missing in the model itself. More precisely, limbs do not have bones in them. Great. That still doesn’t explain the deformation of the other model…