@DataMine
Someone posted source code for an XMF joiner.
I've never seen an XAF joiner before.
An XAF joiner would need to accept two XAF files. We will refer to these files as: AnimationA and AnimationB
It will output one XAF file. We will refer to this file as AnimationC
Building AnimationC:
Step 1: Append a header tag
<HEADER MAGIC="XAF" VERSION="910" />
Step 2: Append an animation tag.
<ANIMATION DURATION="{DURATION}" NUMTRACKS="{NUMTRACKS}">
</ANIMATION>
Step 3: Replace {DURATION} with the sum of AnimationA's duration + AnimationB's duration
Step 4: Replace {DURATION} with the sum of AnimationA's duration + AnimationB's duration
Step 5: Search AnimationA for BONEID="#" and add each instance to HashSet<string> Bones
Step 6: Search AnimationB for BONEID="#" and add each instance to HashSet<string> Bones
Step 7: HashSet<string> Bones will now contain a list of unique bones that the animations contain tracks for
Replace {NUMTRACKS} with the length of HashSet<string> Bones
Step 8: Loop through instances of TIME="#" inside of AnimationB and in each instance, add AnimationA's duration to #
Step 9: For each element of HashSet<string> Bones, nest a Bone tag inside of AnimationC's ANIMATION tag, retaining the same value for attribute BONEID="#"
Then nest the KEYFRAME tags of both AnimationA followed by AnimationB into AnimationC's copy of the same tag.
Step 10: For each Bone tag inside of AnimationC, count the number of child KEYFRAME tags and replace the Bone tag's NUMKEYFRAMES="#" attribute value with the count.
That should be it.