Is there a method to attach an object(s) to an animated mesh?

Is there a method to attach an object(s) to an animated mesh?

zamielbrink
Contributor Contributor
3,887 Views
10 Replies
Message 1 of 11

Is there a method to attach an object(s) to an animated mesh?

zamielbrink
Contributor
Contributor

Firstly, allow me to explain what I am attempting to accomplish before I describe the issues I am running into.  I am trying to create some hair for one of my characters, which I intend to render in unreal engine.  However, the way my current rig is set up has led to me being unable to simply import my Xgen hair as an interactive groom asset, as I need the hair to be recorded in maya and then transported to unreal engine. 

To remedy this issue, I had the idea of converting my groom to actual geometry and then exporting it from there however I cant seem to find a method to get my converted hair to attach to my character.  Ordinarily in a case like this I would skin the converted hair to whatever facial bones I have, although my characters facial rig functions exclusively on blendshapes, so I have no bones to skin the hair to. 

Is there a method to fix this issue, or am I perhaps barking up the wrong tree in terms of solving this issue?  I've bene able to accomplish this result with an interactive groom with no issues, so I'm operating under the assumption that a method exists for normal geometry.  Thank you in advance for your assistance.

0 Likes
3,888 Views
10 Replies
Replies (10)
Message 2 of 11

Baboonian
Advocate
Advocate

You have the end neck joint, don't you? bind to it

0 Likes
Message 3 of 11

zamielbrink
Contributor
Contributor
That would be sufficient for a groom which is only attached to the head, however the groom I am having issues with is actually the characters eyebrows which need to move with the blendshapes I have created for its facial rig. My apologies for not prefacing this in the original post.
0 Likes
Message 4 of 11

Baboonian
Advocate
Advocate

all works fine with the blendshapes

0 Likes
Message 5 of 11

zamielbrink
Contributor
Contributor

Even after parenting the hair to the end bone, the geometry still doesn't track to the surface of my mesh like I prefer.  In the XgenExample video, the interactive groom can be bound to my mesh and can be seen moving along with my blendshapes I have created for the character. 

 

In the HairGEOExample video, although the hair is parented to the end bone, it doesn't interact with the blendshapes my character has.  I am attempting to achieve the same result presented in the XgenExample video by attaching/tacking the hair geometry to my characters mesh.  My apologies once more for not prefacing this in the original text.

0 Likes
Message 6 of 11

Baboonian
Advocate
Advocate

mmm ok. 

I can offer you a proximity wrap. Then export the mesh to the engine as alembic.

0 Likes
Message 7 of 11

Kahylan
Advisor
Advisor

Hi!

 

There are multiple different ways to get your hair geo to stick to your animated mesh.

1) Rivets. A rivet is an object that sticks to your mesh. In Maya 2020 and higher you can find the rivet in the constraint menu (rigging toolset, constrain > rivet), in earlier versions you'll need to use a rivet script. This will create you a locator that follows your mesh. You then can parent a joint to that rivet and skin the eyebrow geo to it. I thing for your model 4 rivets per eyebrow would probably give you the result you want.

2) Blendshapes. For each facial blendshape that influences the eyebrows, you create a blendshape for your eyebrow geo as well, so the deformation looks good when standing still. Then you can just skin your eyebrows to your head joint and connect the weight vales of the eyebrow blendsapes to the weight of the head blendshape they belong to, then it should move as desired.

3) Shrink wrap. The Shrink wrap deformer tries to keep one mesh on the surface of another. It is probably the easiest way to connect a mesh to another animated mesh, but for it to work perfectly the edges and vertices of the eyebrow mesh should match those of the underlying mesh.

I Hope this helps!

0 Likes
Message 8 of 11

Baboonian
Advocate
Advocate

why shrink wrap? not proximity. will the evaluation be better?

0 Likes
Message 9 of 11

Kahylan
Advisor
Advisor

Honestly, I'm not sure. It's just the way it was done on productions I worked on. Shrink wrap was used when small objects were needed to follow the skin. Proximity was used when we needed to drive a model with another very similar model, for example driving a clothes with volume with a single layer cloth sim or using a low res model to drive a high res version.
But I have to admit that never really questioned it. Proximity would probably also work in this case.

Message 10 of 11

zamielbrink
Contributor
Contributor
Unfortunately, I haven't found much luck with these strategies, however the rivet idea came close albeit with some artifacts. At the moment I'm attempting to create joints at each hair, create a rivet at each joint, attach the rivets to the character, then parent the rivets to the joints which are skinned to the hair. I am currently having difficulties attaching my created rivets to the character, and am also unsure of how the performance will be or if the result will even be optimal, but It's the only thing I can think of. If I can't get this particular process to function, I may make an attempt to see if I can export the Xgen groom as an alembic and then transform the baked animation data into actual geometry, but I am unsure if such a process is possible. Despite this, I am very grateful for your suggestions, thank you very much.
0 Likes
Message 11 of 11

zamielbrink
Contributor
Contributor
Regretfully, I have been unable to get the proximity wrap to properly function