Home Coding, Scripting, Shaders

[MaxScript] Accessing motion mixer clips on a non biped object

The Flying Monk
polycounter lvl 18
Offline / Send Message
The Flying Monk polycounter lvl 18
I'm trying to access the names, start and end frames of a bunch of motion mixer clips using maxscript.

Our animators are using a custom bone rig and using motion mixer to bring in all the external animations into one file for export. What I want to do is have a script that will output the names and frame info of these into a text file to plug into the game.

I've been able to do this in the past when we used biped. If a biped object is using the motion mixer I can do this;
myMixer = bipObj.transform.controller.mixer
And from there pull out the animation clips.

But the bone objects where using now are using a standard position, rotation, scale transform controller. So I have no idea what's driving their animations or how to get any info out of it.

So has anyone had any experience doing anything like this? From all of my googling it seems like anything to do with maxscript and biped only ends in tears and frustration.

Replies

  • monster
    Options
    Offline / Send Message
    monster polycounter
    I don't know how to access the name displayed for the clips in the motion mixer, but this seems to work for me.
    clearListener()
    
    --ITERATE THROUGH MIXERS
    for m = 1 to theMixer.numMaxMixers() do
    (
    	currentMixer = themixer.getMaxMixer m
    	
    	--ITERATE THROUGH TRACKGROUPS
    	for t = 1 to currentMixer.numTrackgroups do
    	(
    		tg = getTrackgroup currentMixer t
    		
    		trackCount = tg.numTracks
    		
    		--ITERATE THROUGH TRACKS
    		for tC = 1 to trackCount do
    		(
    			currentTrack = getTrack tg tc
    			
    			--ITERATE THROUGH CLIPS
    			for c = 1 to currentTrack.numClips do
    			(
    				currentClip = getClip currentTrack c
    				
    				format "Name: %\n" currentClip.filename 
    				format "\tStart: %\n" currentClip.globstart
    				format "\tEnd: %\n" currentClip.globend
    			)
    		)
    	)
    )
    
  • The Flying Monk
    Options
    Offline / Send Message
    The Flying Monk polycounter lvl 18
    That looks like what I need.
    Cheers, I'll try that out when I get back to work.
  • MitKu
    Options
    Offline / Send Message

    Pheww!

    Finally, I found some code of mixer for the sample, with this topic 10 years ago 🤣

    Thank you so much @monster

Sign In or Register to comment.