How to flood smooth for a blendshape with python

85 views
Skip to first unread message

Francesco

unread,
Jun 7, 2020, 12:08:46 AM6/7/20
to Python Programming for Autodesk Maya
Hi all!

I am trying to flood smooth on a blendshape with the use of python but I can't figure out how to do it. I know how to manually set a value for each point cmds.setAttr("blendShape1.inputTarget[0].baseWeights[0]", 0), but I want to get the same behavior of hitting flood with smooth enabled. Anyone knows how I would be able to accomplish that?

Thanks!
-Francesco

vince touache

unread,
Jul 1, 2020, 10:14:36 AM7/1/20
to Python Programming for Autodesk Maya
I don't know which algorithm precisely maya is using, but you can start by trying basic algorithms. E.g. for a given vertex, query the surrounding vertices, do an average of their weights, and that'll give you the new weight. 
Check out different algorithms (laplacian/gaussian/inverse distance weighting/etc) and see what works for you.
Reply all
Reply to author
Forward
0 new messages