Multiple Animations with different keys???

Hello I have at the moment 6 working animation: Jumping, Running, Walking, Turnleft, Turnright and neutral.
and one that doesn’t work: Draw
Cat = Actor(“phase_2/models/char/mp_2000.bam”,
{“running-jump-idle”:“phase_2/models/char/mp_jump.bam”,
“walk”:“phase_2/models/char/mp_walk.bam”,
“turnLeft1”:“phase_2/models/char/mp_turn_left.bam”,
“turnRight2”:“phase_2/models/char/mp_turn_left.bam”,
“neutral”:“phase_5/models/char/mp_dualcutlass_idle_sp_gp4.bam”,
“draw”:“phase_5/models/char/mp_dualcutlass_draw_sp_gp4.bam”,
“run”:“phase_5/models/char/mp_dualcutlass_walk_sp_gp4.bam”})

I use Keymap:
def getAirborneHeight():
return offset + 0.025000000000000001
walkControls = GravityWalker(legacyLifter=True)
walkControls.setWallBitMask(wallBitmask)
walkControls.setFloorBitMask(floorBitmask)
walkControls.setWalkSpeed(15.0, 30.0, 30.0, 80.0)
walkControls.initializeCollisions(base.cTrav, Cat, floorOffset=0.025, reach=4.0)
walkControls.setAirborneHeightFunc(getAirborneHeight)
walkControls.enableAvatarControls()
Cat.physControls = walkControls

def setWatchKey(key, input, keyMapName):
def watchKey(active=True):
if active == True:
inputState.set(input, True)
keyMap[keyMapName] = 1
else:
inputState.set(input, False)
keyMap[keyMapName] = 0
base.accept(key, watchKey, [True])
base.accept(key+’-up’, watchKey, [False])

keyMap = {‘draw’:0, ‘left’:0, ‘right’:0, ‘forward’:0, ‘backward’:0, ‘space’:0}

setWatchKey(‘s’, ‘forward’, ‘forward’)
setWatchKey(‘w’, ‘reverse’, ‘backward’)
setWatchKey(‘a’, ‘turnLeft’, ‘left’)
setWatchKey(‘d’, ‘turnRight’, ‘right’)
setWatchKey(‘arrow_down’, ‘forward’, ‘forward’)
setWatchKey(‘arrow_up’, ‘reverse’, ‘backward’)
setWatchKey(‘arrow_left’, ‘turnLeft’, ‘left’)
setWatchKey(‘arrow_right’, ‘turnRight’, ‘right’)
setWatchKey(‘space’, ‘jump’, ‘space’)
setWatchKey(‘f1’, ‘draw’, ‘draw’)

movingNeutral, movingForward = (False, False)
movingRotation, movingBackward = (False, False)
movingJumping = False

def setMovementAnimation(loopName, playRate=1.0):
global movingNeutral
global movingForward
global movingRotation
global movingBackward
global movingJumping
if ‘jump’ in loopName:
movingJumping = True
movingForward = False
movingNeutral = False
movingRotation = False
movingBackward = False
if’draw’ in loopName:
movingJumping = False
movingForward = False
movingNeutral = True
movingRotation = False
movingBackward = False
elif loopName == ‘run’:
movingJumping = False
movingForward = True
movingNeutral = False
movingRotation = False
movingBackward = False
elif loopName == ‘walk’:
movingJumping = False
movingForward = False
movingNeutral = False
if playRate == -1.0:
movingBackward = True
movingRotation = False
elif loopName == ‘turnLeft1’:
movingJumping = False
movingForward = False
movingNeutral = False
movingRotation = True
movingBackward = False
elif loopName == ‘turnRight2’:
movingJumping = False
movingForward = False
movingNeutral = False
movingRotation = True
movingBackward = False
elif loopName == ‘neutral’:
movingJumping = False
movingForward = False
movingNeutral = True
movingRotation = False
movingBackward = False
else:
movingJumping = False
movingForward = False
movingNeutral = False
movingRotation = False
movingBackward = False
ActorInterval(Cat, loopName, playRate=playRate).loop()

and these are the working codes except the draw one.

global movingNeutral, movingBackward
global movingRotation, movingForward, movingJumping
	if keyMap['space'] == 1:
 	if keyMap['forward'] or keyMap['backward'] or keyMap['left'] or keyMap['right']:
 		if movingJumping == False:
			if Cat.physControls.isAirborne:
				setMovementAnimation('running-jump-idle')
			else:
				if keyMap['backward']:
					if movingForward == False:
						setMovementAnimation('run')
				elif keyMap['forward']:
					if movingBackward == False:
						setMovementAnimation('walk', playRate=-1.0)
				elif keyMap['left']:
					if movingRotation == False:
						setMovementAnimation('turnLeft1', playRate=1.0)
				elif keyMap['right']:
					if movingRotation == False:
						setMovementAnimation('turnRight2', playRate=1.0)
		else:
			if not Cat.physControls.isAirborne:
				if keyMap['backward']:
					if movingForward == False:
						setMovementAnimation('run')
				elif keyMap['forward']:
					if movingBackward == False:
						setMovementAnimation('walk', playRate=-1.0)
				elif keyMap['left']:
					if movingRotation == False:
						setMovementAnimation('turnLeft1', playRate=1.0)
				elif keyMap['right']:
					if movingRotation == False:
						setMovementAnimation('turnRight2', playRate=1.0)
	else:
		if movingJumping == False:
			if Cat.physControls.isAirborne:
				setMovementAnimation('running-jump-idle')
			else:
				if movingNeutral == False:
					setMovementAnimation('neutral')
		else:
			if not Cat.physControls.isAirborne:
				if movingNeutral == False:
					setMovementAnimation('neutral')
elif keyMap['backward'] == 1:
	if movingForward == False:
		if not Cat.physControls.isAirborne:
			setMovementAnimation('run')
			fswalk.setLoop(True)
			fswalk.play()
			fswalk.setVolume(0.125)

elif keyMap['forward'] == 1:
	if movingBackward == False:
		if not Cat.physControls.isAirborne:
			setMovementAnimation('walk', playRate=-1.0)
elif keyMap['left']:
	if movingRotation == False:
		if not Cat.physControls.isAirborne:
			setMovementAnimation('turnLeft1', playRate=1.0)
elif keyMap['right']:
	if movingRotation == False:
		if not Cat.physControls.isAirborne:
			setMovementAnimation('turnRight2', playRate=1.0)
else:
	if not Cat.physControls.isAirborne:
		if movingNeutral == False:
			setMovementAnimation('neutral')
			fswalk.stop()
return Task.cont

base.taskMgr.add(handleMovement, ‘controlManager’)

def collisionsOn():
Cat.physControls.setCollisionsActive(True)
Cat.physControls.isAirborne = True
def collisionsOff():
Cat.physControls.setCollisionsActive(False)
Cat.physControls.isAirborne = True
def toggleCollisions():
if Cat.physControls.getCollisionsActive():
Cat.physControls.setCollisionsActive(False)
Cat.physControls.isAirborne = True
else:
Cat.physControls.setCollisionsActive(True)
Cat.physControls.isAirborne = True
Cat.collisionsOn = collisionsOn
Cat.collisionsOff = collisionsOff
Cat.toggleCollisions = toggleCollisions

the problem is: I can’t get the draw one working.

what I want is that when I press F1 ye character will do a draw animation and stops auto when it’s done.
But I also want it that when you move forward, backward, spin and when it’s done it will auto change to the last
animation. so not when ye jump.(that must be blocked somehow)

The bugs I have got:1. Ye are freezing from the beginning, but ye can’t move.
2. The animation will only show when I keep pressing the button and ye will have 1 frame of the animation that doesn’t move.

does anyone know the right codes?

I wanna add a animation that activates one pressing f1, and it has to render the full animtion before and auto stops and than I can use other animations.
I can’t get the codes working