Notifications
Clear all

[Closed] appending .bip files to biped via mixer

You cannot combine bip files by loading multiple .bips onto a biped (only one at a time).
However, you can combine bip files together using the mixer.

I’ve found very few resources (help, online, theArea, etc…) discussing this.
So, here is an example for people who come looking for a reference in the future:


(	--how to combine 2 or more bip files
	resetMaxFile #noPrompt; clearListener()	
	--acquire script's fileaddress
	local sfn = getSourceFileName()
	local sfnp = getFilenamePath sfn
	--setup the default character&bip directories
	local theBipDir = (sfnp + @"BIPS\")
	--setup bip file addresses
	local bipFile1 = (theBipDir + @"squatting1.bip")
	local bipFile2 = (theBipDir + @"standing1.bip")
	--create a bip
	bipObj = biped.createNew 100 100 [0,0,50]
	bip = bipObj.transform.controller
	--get an instance of the mixer class, create and select 1st track
	local myBipMixer = bip.mixer
	appendTrackgroup myBipMixer 
	local theTG = getTrackgroup myBipMixer 1
	local myTrk = getTrack theTG 1
	--load bip file into first track
	appendClip myTrk bipFile1 false 0f 
	--load another bip file into first track with offset
	local myOffset = 5f
	appendClip myTrk bipFile2 false myOffset 
	--mixdown tracks to keyframes on biped
	mixdown myBipMixer true true 100 true 180.0
	--mixdown<mixer> <KeyPerFrame:boolean> <EnforceIkConstraints:boolean> <ContinuityRange:integer> <FilterHyperExtLegs:boolean> <MaxKneeAngle:float>
	copyMixdownToBiped myBipMixer --this will update the biped in the viewport
	deleteTrackgroup myBipMixer 1 --cleanup leftover mixers track
)	

Hope this snippet helps someone.