Reading the world joint matrices of an agent

Maya

from AtomsMaya.hostbridge.atomsgroup import MayaAtomsGroupHostBridge
import AtomsCore

# the shape name of the agent group
ag_name = "AgentGroupName"
 
ag = MayaAtomsGroupHostBridge()
ag.set_app_obj(ag_name)

ag = ag.get_agent_group()

# we are using the first agent only
a = ag.agents()[0]
poser = AtomsCore.Poser(a.agentType().skeleton())

wm = poser.getAllWorldMatrix(a.pose())
for w in wm:
	# printing the translation of the joints
    print(w.translation())




Houdini

from AtomsHoudini.hostbridge.atomsgroup import HoudiniAtomsGroupHostBridge
import AtomsCore

# the full path of the agent group
ag_name = "/obj/AgentGroupName"
 
ag = HoudiniAtomsGroupHostBridge()
ag.set_app_obj(ag_name)

ag = ag.get_agent_group()

# we are using the first agent only
a = ag.agents()[0]
poser = AtomsCore.Poser(a.agentType().skeleton())

wm = poser.getAllWorldMatrix(a.pose())
for w in wm:
	# printing the translation of the joints
    print(w.translation())

Copyright © 2017, Toolchefs LTD.