actorNode becomes PandaNode when loaded from BAM

Hi there!
In-between school and work I’ve been finding very little time to work on my P3D project. One thing that I haven’t been able to wrap my head around is the Panda Physics system. I was able to get my character to fall downwards initially, but I’ve somehow broken that along the way, and I can’t figure out what I’m doing wrong now.

I think I broke my physics when I decided to load my actorNode and Collison nodes from a BAM file instead of generating it at runtime, every single time. I modified my code to save a BAM file with all the relevant nodes as follows:

class pcColliders():
    def __init__(self):
        an = ActorNode("charaCenter")

        centerNode = render.attachNewNode(an)
        

        cn = CollisionNode("charaColHolder")
        charaLine = CollisionSegment(0, 0, 0.25, 0, 0, -0.25)
        charaBox = CollisionBox(Point3(0, 0, 0.01), 0.25, 0.25, 0.24)
        cn.addSolid(charaLine)
        cn.addSolid(charaBox)
        charaColl = NodePath(cn)
        charaColl.reparentTo(centerNode)

        
        centerNode.writeBamFile("testboxes.bam")

I would then load testboxes.bam in with loader.loadModel(), but as ls() shows:

image
charaCenter is listed as a PandaNode. I also get errors when trying to treat it as an actorNode.

I do know I’m missing something from my physics code, namely

base.physicsMgr.attachPhysicalNode(an)

however, I understand neither what this does nor why charaCenter is now a PandaNode.
Is my only option to continue generating it at runtime?
I could understand if loading an actorNode from a BAM file would sidestep some necessary processes.

It seems that the problem is that the ActorNode object is not inherited from TypedWritable, and therefore cannot be written as a class.

ActorNode does in fact inherit from TypedWritable, because it inherits from PandaNode, which (obviously) inherits from TypedWritable.

The problem is simply that the built-in physics system doesn’t implement the methods necessary for .bam serialisation. Feel free to put in a feature request for this, but this would not be a trivial change. I would suggest that you change your approach not to require serialisation of the ActorNode objects.