Access the state in animation graph state machine

I’m trying to find an event driven way to know when a state completes (skelanim clip or motion matching), or when a transition begins in the animation graph state machine. I suspect polling is the only way, but hopeful I’m missing something.

I’d prefer to be able to do this directly in a behavior script but I’m open to the action graph if necessary.

In the case where event driven is not possible, any other ideas for a performant way to get current state would be much appreciated.

I was hoping that character.is_node_active() would give me the state, but so far it does not seem to work on state machine nodes, it always returns ‘false’ unless I’m using it incorrectly.

    def on_update(self, current_time: float, delta_time: float):
        # Initialize
        if not self.character:
            self.character = ag.get_character(str(self.prim_path))
            if not self.character:
                return
            else:
                self.full_initialize()
        # Test is_node_active() using relative paths.
        idle_active = self.character.is_node_active("StateMachine/Idle")
        pick_active = self.character.is_node_active("StateMachine/Pick")
        carb.log_info(f"Idle active: {idle_active}, Pick active: {pick_active}")

Ok let me see if I can ask the ActionGraph team.

Hi, did you hear anything back?

At this point, any way to get the current state would be super useful, I’m not picky about how. Currently, we have to write code to infer state and and manage cases where it could get out of sync. It feels like we must be missing something.

Sorry, I’m still trying to track down and answer on this. I know the engineers been very busy preparing for GTC.