Panda3D won't do animations anymore in a new file

Hey guys, very experienced coder here but Panda3D isn’t putting up with me anymore. Trying to do this very simple beginner-style script I wrote to use as a reference tool later on and it just puts the model in it’s default state (like no animation is being used), using any animation, and will not throw any error codes. Reinstalled as I thought it was a corrupted Panda installation, but it didn’t do anything. getCurrentAnim() returns with the animation name (did this to test), the Actor just won’t actually do the animation.

There are no errors or warnings in the console window through the process or after letting it idle for a while.

Passed the code off to some fellow Panda3D-using friends for a second opinion on that and my code (as we can all be “blind” sometimes, hah) and they were all baffled why it wouldn’t work as well. Using Panda3D 1.8.1 like I have been for years. As I said, I just did a fresh install and it didn’t do anything. (Actually, after I saw this was using a custom Astron build on my PATH but switched it to use stock 1.8.1 and it still gave the same result anyways so it’s not related)

Animations still work perfectly fine in another game running off of the same exact python & Panda locations. Am I doing something wrong and none of us caught it?

import sys,os
from panda3d.core import *
from direct.task import Task
from import Actor
from direct.gui.DirectGui import *
from pandac.PandaModules import *
import direct.directbase.DirectStart

class animate():
	def __init__(self):
		self.Suit = Actor("phase_3.5/models/char/suitA-mod.bam", {'slip':'phase_4/models/char/suitA-slip-backward.bam'})
		self.Suit.setPos(0, 0, 0)
		print self.Suit.getCurrentAnim()


For it to work you need to keep a pointer to the Actor instance around (as explained here, in “Actor Basics”). Looking at your animate class, it might seem like that’s what you’re doing, but you are not keeping a reference to the animate class instance itself, which is why it isn’t working.

So you could just do this:

a = animate()

Hope this helps.

That fixed it. Thanks.