David Vincent wrote:
Hello,

Is there a way to animate "by hand" a Cal3D character ?
Moving a bone in a python script with the mouse for example, and update the shape.

I'm trying some thing like that in cal3d/volume.pyx

...
  else: raise ValueError("Cannot move bone, shape is None !")
----------------------------------------------------------

I'm certenly missing something, like updating the skeleton ...
and, i'm allocating a vector, i havn't seen the function do desalloc it.

David.

Hi,

This is not enough, you still need to update the meshes and recompute the skeleton. Good example of how to do this in C/C++ is in Cal3D sources in the file model.cpp:

void CalModel::update(float deltaTime)
{
  m_pMixer->updateAnimation(deltaTime);
  m_pMixer->updateSkeleton();
std::vector<CalMesh *>::iterator iteratorVectorMesh = m_vectorMesh.begin();
  // m_pMorpher->update(...);
  m_pMorphTargetMixer->update(deltaTime);
  m_pPhysique->update();
  m_pSpringSystem->update(deltaTime);
}

This function updates the character posture for the next frame. If you want to manually animate, you have to replace the updateAnimation() call with your own code and keep the rest.

You do not have to update the spring system if you do not use springs (it is slow).

Regards,

Jan

Reply via email to