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()
#Try moving the indirectController:
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())
#Joint isn't ultimately moved by this:
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.
You’ll need to create a task to copy the net transform onto the controlJoint node.