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

----------------------------------------------------------
 def move_bone(self, bone_name, vx, vy, vz):
   cdef int i
   cdef CalBone *bone
   cdef CalVector *vec
   if not self._shape is None:
     i = CalCoreSkeleton_GetCoreBoneId(
CalCoreModel_GetCoreSkeleton(self._shape._core_model), bone_name)
     if i == -1: raise ValueError("No bone named %s !" % bone_name)
     bone = CalSkeleton_GetBone(CalModel_GetSkeleton(self._model), i)
     vec=CalVector_New()
     CalVector_Set(vec, vx, vy, vz)
     CalBone_SetTranslation(bone, vec)
   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.

Reply via email to