diff --git a/direct/src/actor/Actor.py b/direct/src/actor/Actor.py index 8213a98512..8e30c71408 100644 --- a/direct/src/actor/Actor.py +++ b/direct/src/actor/Actor.py @@ -1242,6 +1242,25 @@ class Actor(DirectObject, NodePath): return None return joint.getDefaultValue() + def getJointTransformState(self, partName, jointName, lodName='lodRoot'): + partBundleDict=self.__partBundleDict.get(lodName) + if not partBundleDict: + Actor.notify.warning("no lod named: %s" % (lodName)) + return None + + subpartDef = self.__subpartDict.get(partName, Actor.SubpartDef(partName)) + partDef = partBundleDict.get(subpartDef.truePartName) + if partDef: + bundle = partDef.getBundle() + else: + Actor.notify.warning("no part named %s!" % (partName)) + return None + + joint = bundle.findChild(jointName) + if joint == None: + Actor.notify.warning("no joint named %s!" % (jointName)) + return None + return joint.getTransformState() def controlJoint(self, node, partName, jointName, lodName="lodRoot"): """The converse of exposeJoint: this associates the joint with