try:
                self.animations[action][direction] = animation
            except KeyError:
                self.animations[action] = {direction: animation}