A question about Maya BlendShape and skinCluster

58 views
Skip to first unread message

yaoyansibase

unread,
Mar 2, 2015, 3:44:12 AM3/2/15
to python_inside_maya


hi all,
I'm watching Tom Ferstl's showreel2012(http://www.cgmeetup.net/home/tom-ferstl-rigging-showreel-cg-vfx/) which demonstrates an very insteresting plugin Partial BlendShape.
With that plugin, you can switch to a driver mesh(e.g. driver0) and the weights of each vertex of driver0 can be displayed on the driven mesh.
Then if you switch to another driver mesh(e.g. driver1), the weights of each vertex of driver1 can be displayed on the driven mesh.
It is similar to Maya BlendShape and skinCluster. I'm very curious about this functionality. How to make it?

And my question are:
1. Which mel cmds and procedures should be called to achieve this functionality?
2. If I were going to implement this functionality, which mel cmds and procedures do I have to call?
3. Which mel cmds and procedures should be called to achieve this similiar functionality for Maya BlendShape?
4. Which mel cmds and procedures should be called to achieve this similiar functionality for skinCluster?

Cheers
yao

Eduardo Grana

unread,
Mar 2, 2015, 7:49:28 AM3/2/15
to python_in...@googlegroups.com
Hello Yao,

Of course, i dont know exactly how he does it, but i think
you could build something like that with regular blenshapes.
The only thing you need to fix is the vtx number mismatch.
So you can preprocess the parts of the body, and with a
uv or world position relation, and then you can rebuild the blendshape
on a full mesh. When adding it to the blendshape node as target,
paint the weights only to the affected vertices only.
So I think what you need is to build a mapping function between the
vtx of the splitted mesh, and the original mesh (anything other than vtx number)
and a function to rebuild the shape on the complete geometry.

Sorry i dont answer question by question, if you think this idea could
work, i can later elaborate better the answers ;)

Cheers!
Eduardo


--
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 python_inside_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/b77ac74c-6ce1-4510-88a6-8a5814688134%40aliyun.com.
For more options, visit https://groups.google.com/d/optout.



--

yaoys

unread,
Mar 2, 2015, 9:29:59 PM3/2/15
to python_in...@googlegroups.com
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

Eduardo Grana

unread,
Mar 3, 2015, 10:25:03 AM3/3/15
to python_in...@googlegroups.com
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.
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


--
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 python_inside_m...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
Reply all
Reply to author
Forward
0 new messages