Sunday, August 17, 2014

Mirror Mesh Deformer Plugin



This is my personal test project. The aim is to create a node that can mirror mesh deformation from left to right (for blendShape, maybe?). Yes, we have a bunch of scripts out there that does the job fine, but this is my personal challange to be able to have them deform together in real-time. And, yes, I just wanna practice.

I wrote this plugin in Python first because that's the only language I know (except MEL which I don't really consider a programming language). And when it comes to a LOT of vertices python kinda sucks. It lag so hard. So I spent a few weeks studying basic C++ just enough to get the plugin to be translate to C++. I found translating pretty easy since I already got all the algorithm working fine just a bit off this and that that C++ needs.

AND YES...IT RUNS DAMN FAST!

Fluid deformation on 100k+ vertices!
You can try it out for free. I just did this for fun so there'll be errors and cause unpredicted behaviour to Maya, of course. (Maya2012 64 bit only)

DOWNLOAD: mirrorMesh.mll

HOW TO USE:
    -  Put mirrorMesh.mll in the Maya's plugin directory(wherever it is). Load the plugin.
    -  Select a polygon, Create the deformer. (cmds.deformer(type='mirrorMesh')
    -  Connect "outMesh" of the mesh you'd consider it the "base" to the "baseMesh" attribute on the node.
    -  Connect "outMesh" of the mesh you'd consider it the "Original" to the "origMesh" attribute on the node.
    -  Tweak(lower) the tolerance value on the node if you have a very dense mesh so the node can match vertices on each side

Have fun.