Remap animation at runtime


given the following situation:

actor = Actor('somemodel.egg',{'someanim': 'someanimfile.egg'})

is there a way to assign another file (‘someanimfile2.egg’) to ‘someanim’ at runtime?

I can say there is a way…

def loadActor(model,anims):
     return Actor(model,anims)

I’m not sure what happens during animation when you overwrite one of the models.
But you can defintely reload them on demand if you call that function on some button click or other event.

Thank you, I’ll try this :slight_smile:

I use it when for instance in my network code. When a player joins the server, the server loads the actor and sends it to all connected clients.
Obviously the models loading will depend on player’s character/outfit settings so I load the models at runtime when they are not known ahead of time.

However, I am not ‘overwriting’ any model or trying to change one individual animation.
So maybe the character will flicker/stutter for a single frame but I don’t know.