/
Iterating through the agents of an agent group
Iterating through the agents of an agent group
Maya
from AtomsMaya.hostbridge.atomsgroup import MayaAtomsGroupHostBridge nh = MayaAtomsGroupHostBridge() nh.set_app_obj("tcAgentGroupNodeShape1") ag = nh.get_agent_group() # returns the group local ids of the agents ids = ag.agentLocalIds() print(ids) for agent_id in ids: # to double check the ids correspond to the right agent, get the agents with the '.agent' method and print the 'groupId' agent = ag.agent(agent_id) print(agent.metadata()["groupId"].value())
Houdini
from AtomsHoudini.hostbridge.atomsgroup import HoudiniAtomsGroupHostBridge nh = HoudiniAtomsGroupHostBridge() nh.set_app_obj("/obj/AgentGroupName") ag = nh.get_agent_group() # returns the group local ids of the agents ids = ag.agentLocalIds() print(ids) for agent_id in ids: # to double check the ids correspond to the right agent, get the agents with the '.agent' method and print the 'groupId' agent = ag.agent(agent_id) print(agent.metadata()["groupId"].value())
, multiple selections available,
Related content
Parsing atoms objects
Parsing atoms objects
Read with this
Creating agent groups
Creating agent groups
More like this
Metadata
Metadata
Read with this
Check if an agent is in a transition
Check if an agent is in a transition
More like this
Examples
Examples
Read with this
Reading the world joint matrices of an agent
Reading the world joint matrices of an agent
More like this
Copyright © 2017, Toolchefs LTD.