CharacterMaker in c++

This does look like the right way to do it but I still cant get it to work. When I use part.set_mat the part gets messed up and set in wrong position again. Any ideas whats wrong? Maybe set_mat doesnt work correct or some other part of the code is wrong?

I can assure you that set_mat() works correctly; that’s fundamental to almost all of Panda’s scene graph operations.

It’s hard for me to diagnose what’s going wrong in your particular case. Try working with a simpler model and simpler code sample. Create a simple character model with just one animated joint, and try replacing the animation on that joint. Then increase the complexity until it goes wrong–this is usually a pretty good way to understand at what point something is breaking.

David

I finaly figured this out! set_mat didnt work in VS2008 and works great in VS2005. I was using 2008 since other stuff was working ok with it but i guess some functions dont. Thanks for quick replies btw :slight_smile:

Really? It’s hard to imagine how set_mat() could fail to work just because it was compiled with VS2008. In fact, I compile my own Panda with VS2008 and it works fine.

Unless you’re talking about mixing-and-matching, where part of your suite is compiled with VS2005 and part of it is compiled with VS2008? I’m pretty sure that won’t work; the two compilers are not compatible. Everything has to be built with the same compiler.

David

Hi,
I’ve been working on c++ development with panda3d, sorting out the looking and grab example, etc. So far so good.

Now I’m trying to control joints. I tried out the code snippets in this thread to get control of a joint:

  ModelRoot* eveN = DCAST(ModelRoot, eve.node()); // get model root
  NodePath eveChNP = eve.find("**/+Character"); // find node charater definition
  Character* eveCH = DCAST(Character, eveChNP.node()); // pointer to character
  
  CharacterJointBundle* eveBundle = eveCH->get_bundle(0); // pointer to character joint bundle
  
  NodePath eveJointNP = eve.attach_new_node("EveJoint"); // add node to control neck
  eveBundle->control_joint("RightWrist", eveJointNP.node()); // get neck control through eveJointNP

  CharacterJoint * joint = DCAST(CharacterJoint,eveBundle->find_child("RightWrist")); // actual joint node
  
  eveJointNP.set_mat(joint->get_initial_value()); // set control node to the same initial value

but the compiler reports it cannot find get_initial_value as a member of either CharacterJoint nor MovingPartMatrix.

What is the correct way to do this now?
Thanks a lot!

Using Panda3D 1.6.2 / MSVC2008 Express Edition

It is now called get_default_value().

David