Hello Yao, Maybe i miss understood you, sorry.. ;) I thought you would do some mix of python cmds , but not an interactive deformer. If you are trying something like that, maybe its a good idea to first check out soup plugin suite, that is free even for commercial use. http://www.soup-dev.com/ I think there is an example with a uvBlendShaper, and several other belndshape experiments...
Anyay, let me explain better what i had in mind in case it is of any help. Let imagine we have full body mesh with no deformations, lets call it fullBodyBase. Then we have a part of it also with no deformations, lets call it armBase. So the process i though of would be: -duplicate armBase and sculpt it to get armShape1 -apply armShape1 to armBase as blendshape target -wrap fullBodyBase with armBase -activate the weight on the blendshape, fullBodyBase will get deformed (some painting of the envelope weights on wrapDeformer maybe needed to restrict the area of influence the the armPart ) -duplicate de fullBodyBase to get the rebuilded armShape Cheers! Eduardo On Mon, Mar 2, 2015 at 11:29 PM, yaoys <[email protected]> wrote: > 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 > <https://groups.google.com/d/msgid/python_inside_maya/30504b97-bd84-44b7-a1e3-ad6e94907304%40googlegroups.com?utm_medium=email&utm_source=footer> > . > > For more options, visit https://groups.google.com/d/optout. > -- Eduardo GraƱa www.eduardograna.com.ar -- 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/CACt6Grnqr6s-sy%2BSvdLDGF-VWtwwU98b8%2BBwErtDv%3DfdWoE88Q%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
