apart objects parents


This is more a technic question about what to do when a sprite has some elements and when not…

For example a king and a cup in your hand.

Have done a king modeled, but he has only the textures (clothes, etc), no elements are with him. Apart i have a gold cup at his left but is not part of the king mesh, but this cup must to stay for ever with the king parented to his left hand. What to do?,

a) - join both meshes into one, move the cup to left hand and then make the armature process (cup is part of body) or

b) - make it apart, export both separately, one egg per mesh and then parent the cup to the body.

The king at beginning does not have the cup in hand, but when i make an action or press a button (for instance), the cup parents to his hand instantly.

The “a” option will force that i must to make two king meshes, one with the cup in hand and one not, maybe is easier but will waste memory, i think…

About the “b”, is smarter, but can´t imagine how to parent the cup to the left hand and not to the entire body, if parent to body will have inconsistent movements…

thank you !

Have you seen the “Looking and Gripping” sample program? That should show you exactly what you want to do.
Basically, it reparents an arbitrary mesh to the joint in the skeleton that controls the hand - somewhat like “b”, above.

i wasn’t see that sample, now that i looked, guess the attribute to make it is exposeJoint.

self.rightHand = self.eve.exposeJoint(None, 'modelRoot', 'RightHand')

In this line, is “RightHand” string the name of the right hand´s bone? or is just a random name.

a random name wouldn’t make much sense here…

here’s the documentation for that function:
panda3d.org/apiref.php?page= … xposeJoint