Hi Eduardo, Thanks for your reply.
>So you can preprocess the parts of the body, and with a uv or world
position relation,
I have already defined this data structure
class VertexIndexMap// Map driver vertex index to driven vertex index
{
std::vector<int> m_vi;//
}
class Part
{
VertexIndexMap m_vim;// vertex index mapping
}
And I built the map. (Assuming that the driven mesh has 7 vertex, and the
driven mesh is seperated to two parts, part0 and part1.)
Part part0;// drive the driven mesh's vtx[0:2]
...
part0.m_vim.m_vi[0] = 1;// It means part0(the driver mesh)'s vtx[0] is
mapped to driven mesh's vtx[1]. So driven mesh's vtx[1] is deformed
according to part0's vtx[0]
part0.m_vim.m_vi[1] = 2;
part0.m_vim.m_vi[2] = 0;
Part part1;// drive the driven mesh's vtx[3:6]
part1.m_vim.m_vi[0] = 3;
part1.m_vim.m_vi[1] = 4;// It means part1(the driver mesh)'s vtx[1] is
mapped to driven mesh's vtx[4]. So driven mesh's vtx[4] is deformed
according to part1's vtx[1]
part1.m_vim.m_vi[3] = 5;
part1.m_vim.m_vi[4] = 6;
> and then you can rebuild the blendshape on a full mesh.
How to rebuild the blendshape on a full mesh?
Do you mean you can re-use the UI of Maya Paint BlendShape Weights Tool?
> When adding it to the blendshape node as target, paint the weights only
to the affected vertices only
How to add it to the blendshape node as target? Because I defined my deform
node by inheriting MPxDeformerNode, my deform node is not a blendshape node
at all.
This is my deform node:
class MyDeform : public MPxDeformerNode
{
...
static MObject aDrivers;// it is an array, compound attribute, and it has
child attribute aMesh, aVtxIdx
static MObject aMesh; // it is a mesh type attribute, and is linked from
the driver mesh
static MObject aVtxIdx; // it is an array attribute, and contains the
vertex index mapping
...
}
Cheers
yao
--
You received this message because you are subscribed to the Google Groups
"Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/python_inside_maya/30504b97-bd84-44b7-a1e3-ad6e94907304%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.