Gogo
Gogo

Reputation: 53

Unbind skin in Autodesk Maya

Despite following the Maya command documentation shown here:

import maya.cmds as cmds
cmds.bindSkin( unbind=True ) # While my object is selected.

or

cmds.bindSkin( 'mySelectedObj', unbind=True ) # Specifying which object to unbind

results in:

Error: RuntimeError: file line 1: No skin partition found in scene.

I'm also getting the same error in MEL. But the script editor's history shows a doDetachSkin command - and searching on it just keeps leading me back to the bind skin command.

How should I correctly write this command when following the example on the documentation is giving me the error message?

P.S.: My selection is a geo mesh that is skinned to a few joints.

Upvotes: 1

Views: 2622

Answers (6)

AeroEng88
AeroEng88

Reputation: 71

    import maya.cmds as cmds
    cmds.skinCluster(‘some object here’, unbind=True)

or if that doesn’t work

    import maya.cmds as cmds
    cmds.skinCluster(‘some object here’, edit=True, unbind=True)

basically just replacing that last line’s command with skinCluster, which is also a command used to bind/unbind skins in Maya. bindSkin deals with currently selected objects, where as skinCluster deals with objects that can be selected in the args

Upvotes: 1

sheetwood
sheetwood

Reputation: 31

I had the same issue, the skinCluster command seems to work.

cmds.skinCluster('mySelectedObj', edit=True, unbind=True)

Upvotes: 1

Chen
Chen

Reputation: 1

It looks like bindSkin can only delete the jointCluster, and you can try skinCluster.

import pymel.core as pm
pm.skinCluster(objname, edit=True, unbind=True)enter code here

Upvotes: 0

Andy Jazz
Andy Jazz

Reputation: 58043

If Unbind Skin Python command doesn't work:

import maya.cmds as cmds
cmds.bindSkin( unbind=True, bp=False )

Try its great old MEL equivalent:

DetachSkin;

Upvotes: 1

Gogo
Gogo

Reputation: 53

import maya.mel as mel

skinC = mel.eval('doDetachSkin "2" { "1","1" }')

Decided to work around the issue instead by just invoking the mel command that I see in the script editor history. Not ideal but serves my purposes for now.

If anyone knows of a better way or can clue in why following the documentation isn't working, please feel free to chime in.

Upvotes: 0

Achayan
Achayan

Reputation: 5885

Did you tried with selection ?

mySelectedObj = cmds.ls(sl=True) or []
if mySelectedObj:
    cmds.bindSkin(mySelectedObj[0], unbind=True ) 

Upvotes: 0

Related Questions