Character studio Physique export offsetvectors evil ?!
Hi all,
Here is what I’m trying to do : export physique and biped data from 3d studio max R3.
My initial solution was :
Biped :
- Figuremode
- Export initial bone transformation
- End figuremode
- Get animated bone rotation
Physique :
- Figuremode
- Export weights and offsetvectors
- End figuremode
This seems to be the right thing to do because physique connects the skin/mesh to the bones/links in figuremode. What I guess is that offsetvectors are closely related to weights, so its logical to use offsetvectors, right ?. But when I looked at plugin code of Dejaview and the X-file exporter (to x-file DX8), I found that non of them use offsetvectors.They all convert the mesh to a Triobjectmesh object and calculate their own offstetvectors,
i.e. Dejaview :
Bone_baseTM= GetBoneTM(node, ip->GetAnimRange().Start()); // so this is not in figuremode
Bone_baseTM.invert;
BaseVert = Bone_baseTM * TrimeshVert;
Vert= BoneAnimationTM * BaseVert;
Vert = Vert * weight;
FinalVert =FinalVert + Vert;
But why ??? Is something wrong with offsetvectors ???
The Physique Version 2.2 Export Interface doc, provides info on how to
use offsetverctors and weight :
if (vtxExport->GetVertexType() & BLENDED_TYPE)
{
IPhyBlendedRigidVertex *vtxBlend = (IPhyBlendedRigidVertex *)
vtxExport;
Point3 BlendP(0.0f, 0.0f, 0.0f);
for (int n = 0; n < vtxBlend->GetNumberNodes(); n++)
{
INode *Bone = vtxBlend->GetNode(n);
Point3 Offset = vtxBlend->GetOffsetVector(n);
float Weight = vtxBlend->GetWeight(n);
BlendP += (Bone->GetNodeTM(t) * Offset) * Weight;
}
// set the Point of the object (to test the export is correct)
os->obj->SetPoint(i, BlendP);
mcExport->ReleaseVertexInterface(vtxExport);
vtxExport = NULL;
}
else
{
IPhyRigidVertex *vtxNoBlend = (IPhyRigidVertex *)vtxExport;
INode *Bone = vtxNoBlend->GetNode();
Point3 Offset = vtxNoBlend->GetOffsetVector();
// set the Point of the object (to test the export is correct)
os->obj->SetPoint(i, Bone->GetNodeTM(t) * Offset);
mcExport->ReleaseVertexInterface(vtxExport);
vtxExport = NULL;
}
This is what interests me : // set the Point of the object (to test the export is correct).
I altered the Dejaviewcode , I calculated the mesh using offset vectors (figmode) in stead of trimesh, using code similar to the above. But the final result of that just doesn''t look right, it looks just as the amimation in 3d studio max when you turn on rigid in the Physique level of detail! I just don''t get it , using offsetvectors gets less result ???? So my question is : Are offsetvectors evil ? How do you export physique ? I hope to hear from you....
Thanks,
Ron
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement