How to sync cloth data/anim from 1 mesh to another

I have a character with cloth physics. And I am using inverted hull method and duplicate another mesh to make a character outline.

But one issue is I found the cloth physics in original character mesh and the outline mesh is not in sync.

So I want to sync the cloth data/anim from my original character to the outline character mesh.

Is it possible and how to do that?

Thanks

1 Like

Doubt that’s possible with any solver.

You would have to break open half the engine - and even then, its actually not possible unless your vertex order is exactly the same.
Which unless you do things manually in a program which allows you to preserve the order, will never be the case…

If you instantiate another cloth, the simulation will no doubt be different.

You may be able to fake it with a niagara simulation or similar that you bind to the cloth mesh on a per vertex base. That’s about the only way in engine, I think.

3 Likes

If you are using Maya as your modeling program you can actually transfer the vertex order using the the “Transfer Vertex Order” command. Maybe that way you can get the same vert order on you hull and base mesh.
It would probably be better to copy the vertex offset from the base mesh to the hull in a shader to not have to do double calculations

2 Likes

What if I using blender to just copy the original mesh to a outline mesh?
Will it preserve the vertex order?
And if I can copy the vertex order, what is the next step to make them sync in cloth physics simulation?

I doubt it will preserve the order, seeing as there is a plugin sold to copy vertex order for blender

There used to be a command to show the vertex index now it’s missing in newer versions

I’ll do some tests with maya later on and let you know

1 Like

I am looking forward to your result :slight_smile:

Thank you

BTW are you doing this to just get outlines on a skeletal mesh cloth? Why not just just a post process material in that case and not double your mesh data?

Seems there is a built in node that does this to some extent. Here’s the bp structure for it

I would go with post processing though if I were you

1 Like

It works!!

Thank you so much!!

The reason why I am not doing post processing is the outline is quite hard to control
So I go for inverted hull method

The next step if you manage to copy the vertex order is to open up engine source and undestrand how the geometry buffer works.

Once you do, in theory at least, you can mirror vertex positions via USF code (a custom shader).

Resources here get very murky because unreal likes to do literlaly nothing following good practices and standards. Or documenting correctly whatever they do.

You can maybe use some of this as an example:

Look at the engine source or even search for GPUSkinVertexFactory.usf to see what people usually come up with.

It should give you the right path to access the verts and copy locations based on the indicis.

Nothe that nvidia cloth is probably easier than chaos cloth. In terms of finding shared code at least.

1 Like

Thank you for your reference!