How can I know the type of animation key using MXS?


#1

Hi guys,
This is my first post on this forum so I hope that I writte in the correct spot.

I’m trying to check the type of keys using MaxScript. The idea is to copy/paste animations in biped but I need to also paste FreeKeys, SlidingKeys and PlantedKeys, the thing is that I don’t want to save an (.bip) file.

Searching on google and also on this forum I found this:

https://forums.cgsociety.org/t/check-if-a-object-has-a-animation/1553054

The thing is that I’m working with biped and I want to check is there is a Sliding key for example.
The code to create a sliding key is ( biped.setSlidingKey ) but I don’t kwow how check using MXS if the key in( X frame) is an position key or a PlantedKey instead.

Any help would be greatly appreciated.

Thanks in advance.


#2

Searching on internet I found this code. Is there any better solution to do the job?

   for t = animationRange.start to animationRange.end do
     (
    	at time t
    	(
    		gki = getKeyIndex $.controller t
    		if gki > 0 then
    		(
    			gbk = biped.getkey $.controller gki
    			if  gbk.ikBlend  == 1.0 then print "sliding key" else print "The Black Keys" 
    		)
    	)
     )

#3

That is the proper way to check. Also, for a planted key check Join To Previous Key (ikJoinedPivot).


#4

Thank you Martinez to take the time to answer. I’m going to try it and let see what I get.