[Maya MEL] Scripting a wrap deformer?




I have this script that intends to wrap deform one object to another

deformer -type wrap pCube1 pSphere1;

The problem is the wrap node is created both for the inputs on the pCube and pSphere. The proper wrap would have one output and one input.

I also checked the documentation but there is no specific page for the wrap deformer but only generic page for all the deformers.

Is there a way around this?


I think you maybe looking for this

wrapDeformer = mm.eval('doWrapArgList "7" { "1", "0", "%f", "1", "0", "0", "0", "0" }' % wrapMaxDistance)[0]


Thanks for the response @ritterrav.
Unfortunately, your script returns a syntax error which I cannot figure out.
Fortunately, it pointed out me to several threads.

Basically, the simplest command to execute is
(1) Select geos to wrap
(2) Run CreateWrap();
No need for any parameters. They are optional.

Anyway for future reference visiting, there is no direct way to wrap deform. That is the “deformer -type wrap pCube1 pSphere1;” do not work.

Hence, you have to call out custom script pre-installed in Maya which is doWrapArgList.mel.
The CreateWrap() is inside that mel file.

Thanks again!


I’m only answering about the syntax error you had. The problem is that ritterrav replied with a Python command.

doWrapArgList "7" { "1", "0", "1", "1", "0", "0", "0", "0" };


Oh so that’s why. Thanks for the clarification @clesage!


Thanks for the assist!