Skip to end of metadata
Go to start of metadata
You are viewing an old version of this content. View the current version.
Compare with Current
View Version History
Version 1
Current »
Maya
import Atoms
smi = Atoms.StateMachines.instance()
from AtomsMaya.hostbridge.atomsgroup import MayaAtomsGroupHostBridge
from AtomsMaya.hostbridge.commands import MayaCommandsHostBridge
nh = MayaAtomsGroupHostBridge()
nh.set_app_obj("tcAgentGroupNodeShape1")
ag = nh.get_agent_group()
ids = ag.agentLocalIds()
for agent_id in ids:
agent = ag.agent(agent_id)
sm = smi.stateMachine(agent.agentType().metadata()["stateMachine"].value())
if not sm:
continue
state = agent.metadata()["state"].value()
current_state = agent.metadata()["currentState"].value()
if current_state != state:
print(sm.connections()[(current_state, state)].name())
Houdini
import Atoms
smi = Atoms.StateMachines.instance()
from AtomsHoudini.hostbridge.atomsgroup import HoudiniAtomsGroupHostBridge
from AtomsHoudini.hostbridge.commands import HoudiniCommandsHostBridge
nh = HoudiniAtomsGroupHostBridge()
nh.set_app_obj("tcAgentGroupNodeShape1")
ag = nh.get_agent_group()
ids = ag.agentLocalIds()
for agent_id in ids:
agent = ag.agent(agent_id)
sm = smi.stateMachine(agent.agentType().metadata()["stateMachine"].value())
if not sm:
continue
state = agent.metadata()["state"].value()
current_state = agent.metadata()["currentState"].value()
if current_state != state:
print(sm.connections()[(current_state, state)].name())