Notifications
Clear all

[Closed] Batch processing *.xaf export

Hi,

Is there a simple way to export each BIP animation within the motion mixer into an *.xaf file?
As far as my experience goes, I have to mixdown (or manually load) each *.bip, select all and export it to *.xaf.
I have several characters though whose whole animation sets consist of like 30 single animations each.

I tried to write a MaxScript, but I couldnt figure out to access the animations files within the mixer.

So, is there any way to automate this? Any other ideas to batch export/convert *.bip files into an XML format?

Thanks in advance!
-Marco

1 Reply

I found a way, for anyone who’s interested:


fn exportCharClips bip clipPath =
(
	cMixer = bip.transform.controller.mixer
	theTG = (getTrackGroup cMixer 1)
	theTracks = #()
	theClips = #()
	nodeArray = selection

	bip.controller.figureMode = false

	for i = 1 to theTG.numTracks do
	(
		append theTracks (getTrack theTG i)	
	)

	for i = 1 to theTracks.count do
	(
		for j = 1 to (theTracks[i].numclips) do
		(
			append theClips (getClip theTracks[i] j)
		)
	)

	userAttr = #()
	userVal = #()

	for i = 1 to theClips.count do
	(
		clipNameArr = (filterString theClips[i].filename "\\")
		clipName = clipNameArr[clipNameArr.count]
		clipName = (substring clipName 1 (clipName.count-4))
		format "Exporting clip: %
" clipName
		biped.loadBipFile bip.transform.controller (theClips[i].filename)
			
		theKeys = bip[3][1].keys		
		animLength = theKeys[theKeys.count].time
		
		LoadSaveAnimation.saveAnimation (clipPath + clipName + ".xaf") (nodeArray) userAttr userVal animatedTracks:true keyableTracks:false includeConstraints:false saveSegment:true segInterval:(interval 0f animLength) segKeyPerFrame:false
	)
)