Home Website Youtube GitHub

Error when copying skin weights from source mesh to target mesh

Hi everyone,

I’m trying to copy skin weights from a source mesh to a target mesh using mGear in Maya 2022 with mGear 5.4.5, but I keep running into the following error.

Steps to reproduce:

  1. Select the source mesh (which already has a skinCluster).
  2. Select the target mesh (which also has an existing skinCluster).
  3. Run the mGear skin weight copy function.

The operation fails with the following error:

# Error: RuntimeError: file ...\Documents\maya\modules\scripts\mgear\pymaya\cmd.py line 278:
Error occurred while calling wrapped function 'maya.cmds.skinCluster':
Selected geometry `Skin` is already connected to a skinCluster

The error message refers to the geometry Skin, which is my source mesh. However, this is expected, since the source mesh already has a skinCluster assigned.

The operation throws the RuntimeError above and stops.

One additional observation that might be relevant:

As far as I know, since mGear 5, the way skinClusters are connected to geometry has changed (or at least the way they are handled by mGear).

For example, I can now only select the skinCluster itself using the Select SkinCluster tool in mGear, rather than selecting it directly through the usual workflow I was familiar with in previous versions.

Could this change in how skinClusters are handled or connected to the geometry be related to this issue?

I’m not sure if I’m missing a step or using the tool incorrectly, but I would expect the copy operation to handle meshes that are already bound to a skinCluster.

Has anyone encountered this issue, or could this be a bug in mGear 5.4.5?

Any help or clarification would be greatly appreciated!

Thanks in advance! Christian

Unless something changed with the skin copy commands, it has always been this way. You use this command to copy an existing skinCluster to a geometry which does not yet have a skinCluster.

You are not copying weights. You said “Run the mGear skin weight copy function.” The menu says “Copy Skin”. It’s not copying weights. It’s copying everything, including the settings of the skin deformer, the list of influences, etc.

The error is telling you that the target can’t have an existing skinCluster. I don’t remember any past version ever handling this. It would be nice if it did handle it, and just set the weights and the attributes if the skin already existed. And add any missing influences, etc. But I don’t believe it does that. (I’m a few versions behind, so I’m not sure.)