Tool to combine xaf file?

thessa33
by thessa33 · 9 posts
4 months ago in General
Posted 4 months ago · Author
I have been seeing( xaf file) poses that are combined together….like for an example…..a ga kiss pose combined with an ap pose. I heard that there is a tool that can combine these xaf files? If anyone knows of such tool….please share. I am sure a lot would be interested to learn such tool….Thank you….stay safe everyone.
Posted 4 months ago
I remember there used to be a joiner program but I don't remember much else about it.

@Don Von Alpha Dom

If you could write up a quick design doc I could probably throw something together for
@thessa33
and maybe the market.
Posted 4 months ago · Author
DataMine wrote:
I remember there used to be a joiner program but I don't remember much else about it.@Don Von Alpha Dom
If you could write up a quick design doc I could probably throw something together for @thessa33 and maybe the market.

@DataMine


That would be great…..we are looking forward to it! You are the best!
Posted 4 months ago
@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
Code
<HEADER MAGIC="XAF" VERSION="910" />

Step 2: Append an animation tag.
Code
<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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Sign in

Already have an account? Sign in here

SIGN IN NOW

Create an account

Sign up for a new account in our community. It's easy!

REGISTER A NEW ACCOUNT