Bones Orientation Problem


For my characters I use 3ds max and bones system. I use IK as it makes everything more easy to animate but that is not compatible with FBX to export. I have found this tutorial Motion capture on custom rig / bones - YouTube and its prety good to transfer the motion from a skeleton with IK to a copy of the same skeleton without IK. It works fine. If I try to transfer the motion from a biped like in the tutorial, the orientation of the bones it will become a mess . It seems like in my sceleton the bones doesnt have all the same axis orientation. Maybe for one the Y axis is up and for another one is left…I cant find what I do wrong in the constraction of my skeleton…reset XForm is not a solution for the bones system like in the other objects. Any idea it will be helpfull