Control an Actor joint indirectly

Hi all,
I’ve been trying to indirectly control an actor’s joint. I know beforehand the geometric centre of the geometry that the joint controls and place a nodepath there. Then I obtain the control joint and parent it to the nodepath I just placed. That way, the transforms undergone by the nodepath should cascade down to the control joint:

pandaActos = Actor()
pandaActos.loadModel(fPath)
pandaActos.reparentTo(render)
gotJoints=pandaActos.getJoints()
indirectController=render.attachNewNode("indirect")
indirectController.setPos(jointCentre)
directController=indirectController.attachNewNode("direct")
gotJoints[0].applyControl(directController.node())
directController.setTransform(gotJoints[0].getTransformState())
#Try moving the indirectController:
indirectController.setH(40)

Yet nothing happens when I move the “indirectController”. Is what I’ve described possible in Panda3D? Can the controlJoint be parented to and affected by another nodepath? Or, can the controlJoint itself be given a different transform initially before the geometry it affects is parented to it?

Thanks in advance.

Is the joint being controlled attached to a parent-joint in the joint-hierarchy? If so, then that may be the reason for the issue: I don’t think that one can translate an attached joint–only rotate and scale.

(If you want to be able to translate such a joint, and you are in a position to modify the joint-hierarchy (such as in a 3D modelling application), then you might try disconnecting the joint from its parent, while leaving it nevertheless as a child of that parent.)

Hi, thanks, but that’s not what I’m asking. I’m asking if it’s possible to indirectly control a control joint. Some code expressed differently:

dummy=pandaActos.controlJoint(None, "modelRoot", joint.getName())
dummy.reparentTo(indirectController)
dummy.setTransform(joint.getTransformState())
#Joint isn't ultimately moved by this:
indirectController.setH(40)

Yes there is a joint hierarchy and yes translation is a transform that one can apply to a control joint usually. Hope that clarifies things.

Ah, I see. While I understood the question, I was guessing that you were perhaps translating the joint, not rotating it, and hence seeing no effect. But if it’s also not working with rotation then that is presumably not the problem, indeed!

Hmm… Playing around with it a little, it does seem that such an indirect control doesn’t work. I don’t know why, offhand–I would expect it to work! Perhaps it has to do with the underlying implementation of joint-control–maybe that’s done by simply copying the joint-node’s local values to the underlying joint, thus leaving the result affected by any parent-nodes.

No.

You’ll need to create a task to copy the net transform onto the controlJoint node.

1 Like