/
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
Extract agents from an agent group
Extract agents from an agent group
More like this
Creating agent groups
Creating agent groups
More like this
Extract agents from an agent group - Houdini
Extract agents from an agent group - Houdini
More like this
Check if an agent is in a transition
Check if an agent is in a transition
More like this
Reading the world joint matrices of an agent
Reading the world joint matrices of an agent
More like this
Parsing atoms objects
Parsing atoms objects
Read with this
Copyright © 2017, Toolchefs LTD.