Jump to content

Gems/Accessories onto clothing


DulceDiva
 Share

You are about to reply to a thread that has been inactive for 143 days.

Please take a moment to consider if this thread is worth bumping.

Recommended Posts

Hello. I have an issue when skinning gems or any sort of attachment onto clothing in Blender. Although I transfer the weight painting from the clothing onto the gems, they end up distorting when the avatar moves via AO. Tried a static T-Pose inworld, and they still pretty much look distorted. Is there any tip that I am not aware of ? ^_^

Any tips and tricks are appreciated :):D

Photo included for reference. Some diamonds look alright while some are heavily distorted.

2d99de6719577a8db9c5262f345f6609.png

Edited by DulceDiva
Added photo
Link to comment
Share on other sites

 I was curious about your other post using geometry nodes to scatter instances of objects over the surface of a mesh so had to try it and then see if the distortions could be fixed.

 

I don't have much experience with skinning and weight painting but my guess is the problem with the deforming gems is because the vertices that make up each gem have different vertex weights assigned to them. If each of those vertices were assigned the same vertex weights as the weights assigned to the nearest vertex on the item of clothing (base mesh) then perhaps you would see less distortion.

 

In the example below, I didn't use random scattering but instead aligned an instance of a gem to each vertex of the underlying mesh (just a band to go around the waist of an avatar).

1a-min.thumb.png.9c486d7fdaafef989c27c886f7836c04.png

 

Then transferred the weights from an avatar to the band with the gems. In this example I was only concerned with one of the gems, the red gem in the images below:

1-min.thumb.png.1d3c9cca88c496da9cb9fb4e14aa788a.png

 

2-min.thumb.png.90ed8f4609466deb8156079e2e169648.png

 

Take look at the vertex weights of the vertex from the base mesh beneath the red gem and compare them to the weights of the vertices that make up the gem.

In the gif below the first vertex selected is from the base mesh immediately below the gem then the red gems vertices are selected one by one:

Vertexweights.gif.fae4081b24a64602b05e1fa87277a86d.gif

 

Next we copy the vertex weights from this vertex below the red gem and paste them to all the vertices that make up the red gem.

To do this, in edit mode we first select all the vertices of the red gem and then Shift select the vertex below the gem (this makes the vertex from the underlying mesh the the active vertex (last selected and  highlighted in white). Then go to the N panel > Item > Vertex Weights  and hit the Copy button. This will copy from the acitve vertex to the selected vertices (the gem vertices).

see gif below:

copyVertexweights.gif.30b1ae8e160eb5020e25a919a6f39a30.gif

 

Now all the vertices of the red gem have the same vertex weights  (and groups)  as its closest base mesh vertex.

When the mTorso bone is rotated the red gem does not deform:

mtorsorotate1-min.thumb.gif.085235a6749fe9a4c8df4d1c453c0cc6.gif

 

Note that the red gem does appear to be a little smaller now, no idea why that is :)

 

For your random scattering of gems I guess you would have to select the closest vertex to the distorted gem each time.

 

With so many gems to "fix" this method may not be of any use but I learnt a little more about geometry nodes and vertex weights and it kept me occupied for a couple of hours  :)

 

 

Edited by Aquila Kytori
  • Like 1
Link to comment
Share on other sites

@Aquila Kytori Oh my God! Thanks a bunch!  Never expected a step by step guide, I hope many others will find this useful too ! 👍👍👍

In regards to aligning an instance of a gem to each vertex of the mesh underneath, how did you achieve that via nodes? That was exactly what I was wanting to do but didn't succeed!

 

And no,it's not useless! It actually is really useful!

Edited by DulceDiva
Link to comment
Share on other sites

16 hours ago, DulceDiva said:

In regards to aligning an instance of a gem to each vertex of the mesh underneath, how did you achieve that via nodes? That was exactly what I was wanting to do but didn't succeed!

 

See screen shot below:

Instancesonvertices-min.thumb.png.908211961359c2240f691c4cb7c3030d.png

 

Then with an added "vertex group" input. This uses a vertex group to limit which vertices have instances on them.

Instanceswithvertexgroups.thumb.gif.0ad94cd38735abba0450f9113af907f8.gif

 

See this video for how to control which vertices have the instances using a vertex group :

 

 

  • Like 1
Link to comment
Share on other sites

 

 @DulceDiva  I think I have the gem deformation sorted :)

 

In the above example, after applying the Geometry Node modifier the vertex weight groups were transferred from the avatar to the mesh with the gems. This resulted in the gems deforming when bones were rotated because each vertex of a gem had slightly different weights than the underlying vertex of the base mesh.

We corrected one gem by copying the vertex weights of the underlying vertex to all the vertices of the gem.

We can use this fix to correct all the gems if, instead of transferring the weights from the avatar mesh, we transfer the weights from a rigged copy of the base mesh before adding the geo nodes.

The rigged base mesh:

1-min.thumb.png.a7babadcfc46d1a1bbe998039c9db3ef.png

 

In Object mode make a copy of this mesh (Shft D) and use this copy to add the gems with the geometry nodes :

2-min.thumb.png.a1a9e93a8c54c7a764032bcaa4ea532f.png

 

Apply the Geometry node modifier.

To transfer the weights:

  1.  Object mode.  In the Outliner select first the object with the gems, then shift select the rigged object without gems.  (The rigged object should be highlighted in dark orange and the object with gems highlighted in a lighter orange colour).
  2. Weight paint mode. From the Weights drop-down menu choose the Transfer Weights option.
  3. In the Transfer Weights Data pop-up, Vertex Mapping should be set to Nearest Vertex  and    Source Layers Selection set to By Name.

3-min.thumb.png.66efdc1837ee6f83e640e1fba7c215a0.png

 

and we are done :)

gemsnodeform-min.thumb.gif.3ad79aadfad0130e55e85c8dbf10983b.gif

  • Thanks 1
Link to comment
Share on other sites

  • 2 weeks later...
On 11/23/2023 at 5:35 PM, Aquila Kytori said:

 I was curious about your other post using geometry nodes to scatter instances of objects over the surface of a mesh so had to try it and then see if the distortions could be fixed.

 

I don't have much experience with skinning and weight painting but my guess is the problem with the deforming gems is because the vertices that make up each gem have different vertex weights assigned to them. If each of those vertices were assigned the same vertex weights as the weights assigned to the nearest vertex on the item of clothing (base mesh) then perhaps you would see less distortion.

 

In the example below, I didn't use random scattering but instead aligned an instance of a gem to each vertex of the underlying mesh (just a band to go around the waist of an avatar).

1a-min.thumb.png.9c486d7fdaafef989c27c886f7836c04.png

 

Then transferred the weights from an avatar to the band with the gems. In this example I was only concerned with one of the gems, the red gem in the images below:

1-min.thumb.png.1d3c9cca88c496da9cb9fb4e14aa788a.png

 

2-min.thumb.png.90ed8f4609466deb8156079e2e169648.png

 

Take look at the vertex weights of the vertex from the base mesh beneath the red gem and compare them to the weights of the vertices that make up the gem.

In the gif below the first vertex selected is from the base mesh immediately below the gem then the red gems vertices are selected one by one:

Vertexweights.gif.fae4081b24a64602b05e1fa87277a86d.gif

 

Next we copy the vertex weights from this vertex below the red gem and paste them to all the vertices that make up the red gem.

To do this, in edit mode we first select all the vertices of the red gem and then Shift select the vertex below the gem (this makes the vertex from the underlying mesh the the active vertex (last selected and  highlighted in white). Then go to the N panel > Item > Vertex Weights  and hit the Copy button. This will copy from the acitve vertex to the selected vertices (the gem vertices).

see gif below:

copyVertexweights.gif.30b1ae8e160eb5020e25a919a6f39a30.gif

 

Now all the vertices of the red gem have the same vertex weights  (and groups)  as its closest base mesh vertex.

When the mTorso bone is rotated the red gem does not deform:

mtorsorotate1-min.thumb.gif.085235a6749fe9a4c8df4d1c453c0cc6.gif

 

Note that the red gem does appear to be a little smaller now, no idea why that is :)

 

For your random scattering of gems I guess you would have to select the closest vertex to the distorted gem each time.

 

With so many gems to "fix" this method may not be of any use but I learnt a little more about geometry nodes and vertex weights and it kept me occupied for a couple of hours  :)

 

 

Thank you so much for this in depth response. I've had issues myself with weighting small attachments, and use this method as well :)

  • Like 1
Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 143 days.

Please take a moment to consider if this thread is worth bumping.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...