[Maya] Painting Skin Weights for Overlapping Meshes

Hi,

I have a character wearing a hood. The hood is in the same mesh with the character (i.e. combined as opposed to separated).

I’m having a problem with painting the back of the head/neck. So I tried hiding the hood.
I can see the back but I can’t really paint at it because even though the hood is hidden Maya still recognizes it as existing in view.

I could separate the hood and the character but combining them back again will be a problem because it will ruin the vertex order. Is this assessment correct?

Is there a way around this (i.e. a setting to force Maya to recognize hidden components has hidden objects)?

Thank you for looking at my problem.

Hmm… You could potentially:

  1. Separate the body from the cloth - you’d have to deal with the seam though. But skinning these individually then polyCombineSkin and deleting the non-deformer history. This way you could copy the skin weights back to a single mesh.

  2. Isolate the neck geo and weight it.

-c

1 Like

Hi @chalk Thanks for the response

RE: polyCombineSkin
Where do I find polyCombineSkin?
I tried google and the documentation but I couldn’t find any.

If you are referring to a mere mesh merge/polyunite. It doesn’t necessarily work for copy skin weights. For instance, if you merge object A (skinCluster 1) and object B (skinCluster 2).

The result would be object C but with skinCluster1 and skinCluster2 and not skinCluster3.

In order to copy skin weights, you need a combine a skinCluster otherwise youd only get half of skin to be copied over.

RE: Isolate the neck geo and weight it.
That’s my current workflow (hiding/isolating). Problem again is the weight brush still recognize the objects even if hidden/unisolated, so I can’t paint properly.

I would not separate and combine my geometry. That is potentially not production-friendly if you start changing vertex orders. If it is a personal project that is less important. If it is client or studio work and you are working with other departments, this is not really an option.

Instead, you can duplicate your geometry and separate that and work on that. Skin those parts separately. Then you can just delete it when you are done.

Then, this is how I copy weights to partial parts of a mesh:

  1. Use ngSkinTools + masking. Copy the weights over and then mask out the areas.

  2. Use Python. Here I’ll use PyMEL.
    import pymel.core as pm

  • Let’s say you are trying to copy the separate hood back to your full geo, only on the hood area.

  • Select the separate hood, and run this Python:
    source = pm.selected()

  • Select the vertices of just the hood area, and run this Python:
    target = pm.selected()

  • Next, run this Python line, and it will copy the weights to the two variables you just stored, and it doesn’t matter what you have selected.
    pm.copySkinWeights(source, target, noMirror=True, surfaceAssociation='closestPoint', ia=['oneToOne','name'])

The other benefit of doing it this way, is that on your separate hood geo, if it is double sided, you can delete one of the double-sides and paint just the one side. Then when you copy it back to the double-sided hood, it will be quite clean.

1 Like

Hey @bentraje,

Little typo on my part - should be polyUniteSkinned:

http://help.autodesk.com/cloudhelp/2017/ENU/Maya-Tech-Docs/CommandsPython/polyUnite.html

@clesage Sorry to confuse - In stating a single mesh I was hoping to assume, that it was the original and @bentraje would be duplicating parts of it, working on them, then combining them back with polyUniteSkinned and copying this duplicated-part-combined-weighted-mesh weights back to the original mesh.

100% agree - It’s the upmost importance that if this is a production model, you don’t break it, always duplicate parts and work with them if need be. Issues with the topology etc should be brought up with the modelers/modeling lead etc.

2 Likes

@clesage
Thanks for the detailed steps.

I used the second step.
It works as expected.

@chalk

That command is new to me. I’m sure it will come handy on future projects.

Thanks!

There is a much simpler solution to this problem that does not involve Python, MEL scripting or addons, and it comes in the form of a button: I will over-explain this process, just in case there is anything a reader may not know how to do. Here is a video I’ve found that does this exact process in a few seconds: https://youtu.be/6G0TiB2s4xI?t=1215

Steps are shown in the images below. Apologies - New users can only use one attachment - So I have pasted them all together in one attachment at the bottom, marking their places throughout my reply :slight_smile:

----- (Image 1 would have gone here:)

Maya allows a clean isolation of components (full isolation, not viewport-camera isolation!) much as is found in Blender3D, via the “Isolate Select” function. Again, I will drastically over-explain this process, just in case there is anything a reader may not know how to do.

To utilize this function:

  1. Select the components you wish to isolate for Weight Painting (i.e., teeth, tongue, eyes, eyelids, back-facing cloth like sleeves, etc.)
  2. Click the “Isolate Select” function to cleanly isolate the selected components components in Component mode (this tells Maya to keep these components handy, even after switching to Object mode.)

----- (Image 2 would have gone here:)

  1. Now hover your mouse over your selected components, while holding RMB (Right Mouse Button) to access the Maya Marking Menu. While still holding RMB, drag your mouse over “Object Mode” and release your RMB. This should place you in Object mode, with your Components still highlighted in orange from your Component Mode Selection.

----- (Image 3 would have gone here:)

  1. Almost done: in Object Mode, Shift-Select the bones you want your selection to be influenced by, until you have everything that you want to view in your “Isolation Select” view. (ctrl+click to deselect objects. Make sure they are not highlighted, or overlaid with a wireframe - Both of these indicate that an object is still active! This method also works for marquee-drag selection.) If this was a tedious process for your situation, I recommend you save your file! And maybe even save a backup of this file, so you can return to this position if you need to.

  2. Finally! PAY ATTENTION TO THIS LAST STEP! Just read it all the way through. This will not work if you do not perform this final, silly little action :slight_smile:. CTRL (or SHIFT)-CLICK on ANY SELECTED MESH which is overlaid with a green or white wireframe! (basically, deselect ANY highlighted wireframes:) This will deselect the object, while keeping the object’s MayaShape selected! This allows you to both select and isolate components, without taking their objects with them! If you forget to do this, you won’t be able to isolate individual components, and you will instead grab whole objects :slight_smile:

Once complete with the above, overexplained steps Click the “Isolate Select” button to cleanly isolate your selection. (picture of button shown below)

----- (Image 4 would have gone here:)

Processing: Maya_PaintingSkinWeightsForOverlappingMeshes_Visuals.png…

Over-explanation has a way of making simple things seem complicated - If you get confused, please feel free to ask questions. I pray this helps you! Thank you :slight_smile: