Home Youtube GitHub

Copy Skin not working


#1

Hello,

This is my first post here.
First off… great thanks to Miguel and the mGear team. You rock!
I don’t speak code. More animator than rigger, but I’ve been rigging characters for years with various rig builders,
and mGear is awesome, even for end-users like me.

The issue I’m having now…
I’m trying to copy skin from one mesh to the other and I get this error:

Error: RuntimeError: file C:\Program Files\Autodesk\Maya2019\Python\lib\site-packages\pymel\internal\pmcmds.py line 134: Invalid deformer name was specified.

Google searching didn’t yield solutions.
Can anyone help?
Thanks!


#2

Hi Tsahi, welcome.

Please try to be specific about what you are doing when asking for help. Are you using the mGear -> Skinning -> Copy Skin menu command? What do you have selected?

One thing to note is that you need to first select the geo that you want to copy to. Then last, select the geometry that already has the skin. It is an order that is opposite than using the regular Maya copy weights command.

I don’t think that is your problem though. Because normally you would see an error like
// Error: Source Mesh : Body1 doesn't have a skinCluster. //

So if you can, please list specifically the steps you are taking. And can you also tell us what deformers or history you have in your geometry?

Also, do you happen to have any history in your mesh that is also skinned? For example, if you have a lattice FFD deforming your mesh, and that lattice is skinned?


#3

Thanks for replying Chris.

I try to work very clean to avoid issues like this, since I am not a full time TD.

Here are the details:
I tried to copy the skin with the mGear>Skinning>Copy Skin.
I have a version of the character that is divided into several meshes, and another version of the same character in which meshes are combined ( all meshes are clean…history deleted, transformations frozen, etc…).
I skinned the multi meshes character for convenience purposes.
There were no deformers, blendShapes, lattice or anything on it beside the skin cluster.
I deleted NG custom nodes before I tried to copy.
I skinned the target mesh with an untreated skin cluster. I think I did it to the same joints, not sure if that matters.
I did select the skinned mesh last.

Since you can’t select multiple skinned meshes as the last one, I tried selecting just the target mesh and one of the skinned meshes, just to see if it works, but I get that error.
I also tried combining the skinned meshes with “combine skinning” on (like Miguel does in his data centric workshop on YouTube) and copy from that one.
In both cases I got the error.

What I’m trying to achieve is a combined meshes skinned character, but I don’t think I can have the combine in the history because I doubt FBX export and Unity will support it.

I also tried to export the skin from the combined mesh with “combine skinning”, then unbind skin, delete history, re-skin and import the skin back to it. But in this case some of the weights get messed up and also some vertices around the heels deform to an off-model position in bind pose.

Any clue to what I’m doing wrong or what I can do to achieve the end result?

Thank you!


#4

===UPDATE===

Not ideal, but I might have a workaround… in the export process.

I combine meshes including the skin. Then export the rig with mGear game tools.
Open the joints+geo Maya file, so it’s all clean without the rig.
Then either duplicate the geo and copy the skin to it with mGear copy skin, and delete the old Geo and residual groups from the combine.
Or, export the skin, unbind skin, delete history, import skin.

Both ways work in this file, so I get the skin working properly on the combined mesh.
I tested exporting to FBX and importing to Unity and it looks OK.

I’d still prefer to have everything sorted out in the rigged character before animation even begins.


#5

Well, first, if you combine meshes after they are skinned, you should be able to use “delete non-deformer history” to delete the polyUnite node. If you are importing the skin and getting collapsing verts, again you need to be specific by what you mean by “import”. Using what tool or workflow?

mGear’s Copy Skin works if the target object has no skinning. It automatically adds a skinCluster and then copies the weights. If it does have skinning already, you should be getting an error like:

# RuntimeError: Selected geometry `pSphere2` is already connected to a skinCluster //

I still don’t quite understand why you are getting the error you are getting, sorry.


But now some unsolicited advice on your workflow. :slight_smile:

I find it strange that you are trying to copy from multiple objects to one single object. Usually I do the exact opposite for convenience purposes. I do all my skinning on a unified mesh, and then copy that over to my separate meshes like clothes, etc.

Also, ngSkinTools is the perfect way to use layers instead of separate meshes. You can work on each separate zone independently in a layer.

And ngSkinTools has pretty good Transfer Weights tools, which sound like they will suit you better than trying to use mGear’s Copy Skin, which has less options.


#6

The reason for the unified mesh is a requirement from the Unity developer, for Mobile platforms, reducing draw calls etc.

I work with layers in NG, but I didn’t think to try the transfer attributes there. I will, thanks.

The import skin I was referring to is with mGears skin import.
I did realize the target mesh should be unskinned, and tried it that way too, but it didn’t work.
I’ll try it again on the rebuild.

I guess the error I got might be related to that fact Maya won’t let me delete non-deformer history either.

Thank you!


#7

What happens when you try? Are you getting an error?

I understand that. I am saying I find it weird how you want to skin on separate meshes. If my geometry has a unified mesh, I find that much easier to skin. If my geo doesn’t have a unified mesh, I usually make a temporary one and use that.


#8

Well… not that strange. I take it back.

I often make a temporary plane or cylinder, skin that as a separate layer, and then transfer that back into my geometry in ngSkin. But I like to think of my unified mesh as holding all that information.


#9

It’s just what I’m used to from the old days, with the Maya paint weights.
It allowed for meshes to have less influences and less hassle.
Not saying it’s the right way to go, and as I mentioned… I’m not a TD or rigger all the time.


#10

Gotcha. Well I recommend digging further into ngSkin layers, because you can replace a lot of that workflow directly with a layer and a mask.

For example, you can create a layer called “arms”, select all the arm influences in the ng influences list, and hit “Assign” in Edit Weights. It will assign all the weights just to the arm joints you have selected. Add a mask, smooth a bit, and refine by painting, and the arm is done.


#11


Oh, I totally use layers, lots of them.
And the masks. Big fan of masks in Photoshop too. :slight_smile: