Sign in to follow this  
okokook

About export data from 3sd Max Biped/Physique

Recommended Posts

I'm writting an plug-in for 3ds Max in roder to export skined skeletal animation. I encountered problem. Can anyone help me? For a SAME node, (1) In order to export its mesh vertices, I use the following code: INode* pSelectedNode = pInterface->GetSelNode(0); GeomObject* NodeGeomObject = static_cast<GeomObject*>(NodeObjectState.obj); Mesh* pMesh = NodeGeomObject->GetRenderMesh(0, pSelectedNode, m_NullView, iNeedDelete); for(int i = 0; i < pMesh->getNumVerts(); ++i) { // Export each vetex. } (2) In order to export the bone influence for each vertex, I use the following code: // Get an IPhyContextExport interface. IPhysiqueExport* pPhysiqueExport = (IPhysiqueExport*)pPhysiqueModifier->GetInterface(I_PHYINTERFACE); IPhyContextExport* pPhyContextExport = (IPhyContextExport*)pPhysiqueExport->GetContextInterface(pSelectedNode); int iNumberOfVertices = pPhyContextExport->GetNumberVertices(); // or, int iNumberOfVertices = objectState.obj->NumPoints(); it is of same result. for(int i = 0; i < iNumberOfVertices; ++i) { // Export weights. } The problem is - the number of vertices and each vertex index in (1) do not coincide with that in (2)! What's the relationship? I mean, for example, I got a vertex index 5 in Mesh, how could I know its index in IPhyContextExport? Is it still 5? It seem not... I'm new on this, please help.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this