I want to do smooth binding with pyMel and not have to eval the mel to do it. Anyone know a way?
This works fine but I want to avoid the eval. smoothBind does not appear to be on a selection of joints and meshes:
mel.eval( “SmoothBindSkin()” )
This does not work (and is not what I want anywway since it will do a rigid bind), but I am curious as to why it is not working:
bindSkin(tsb=True)
Does anyone know why bindSkin() throws this error:
bindSkin(tsb=True)
Error: Maya command error
Traceback (most recent call last):
File “<maya console>”, line 1, in <module>
File “C:\Program Files (x86)\Autodesk\Maya2011\Python\lib\site-packages\pymel\internal\pmcmds.py”, line 98, in wrappedCmd
res = new_cmd(*new_args, **new_kwargs)
RuntimeError: Maya command error
skinCluster(toSelectedBones=True)
still don’t know why bindSkin(tsb=True) does not work though.
Have you loaded PyMEL by chance?
Running the following in my Maya 2011 python tab seems to work fine for me:
import pymel.core as pm
pm.bindSkin(tsb=True)
The code below will give you a standard smooth skin with 4 influences per vert, interactive normalization and maintain max influences flagged.
pm.skinCluster(tsb=True, maximumInfluences=4, normalizeWeights=1, obeyMaxInfluences=True)
If you have any issues just let me know.
The bindSkin command is for the ancient Rigid Binding technique, which doesn’t use skin weights, but uses flexors(lattices) to smooth deformation around joints. Although in theory you should be able to rigidly bind things… even though it probably wasn’t what you wanted, it should have worked.