How do I apply Cloth physics to a cape

GTA:V Modding with ZModeler3 discussion.
Post Reply
undead788
Posts: 20
Joined: Fri Mar 26, 2021 1:09 am

How do I apply Cloth physics to a cape

Post by undead788 »

Hello, I have just figured out how to convert peds to GTA 5. However I am having trouble figuring out how to apply cloth physics to a cape. I want to create a non streamed ped with cloth physics. If someone could help me that would be great. Thanks!
User avatar
Oleg
Site Admin
Posts: 14045
Joined: Fri Feb 06, 2004 3:54 am
Contact:

Re: How do I apply Cloth physics to a cape

Post by Oleg »

Some settings have to be toggled in metadata file to enable cloth simulation on a component. If your ped had no original cloth simulation on that component, it could be tricky to find that in XML file. I remind one user has grabbed a huge block of XML data from another model into his component's metadata file to enable cloth simulation.

Once it's enabled, your model should have .yld file for cloth physics and a proper export of .ydd and .yft files. I don't remember but either .yft or .yld file can contain some collisoin volumes to put onto skeleton, so cloth behaves properly. There was a video with WatchDogs model and everything was shown there step by step. Ped model with pre-installed cloth simulation option was used as a base model, so no metadata editing is covered in a video.
undead788
Posts: 20
Joined: Fri Mar 26, 2021 1:09 am

Re: How do I apply Cloth physics to a cape

Post by undead788 »

Oleg wrote: Thu Apr 01, 2021 7:56 am Some settings have to be toggled in metadata file to enable cloth simulation on a component. If your ped had no original cloth simulation on that component, it could be tricky to find that in XML file. I remind one user has grabbed a huge block of XML data from another model into his component's metadata file to enable cloth simulation.

Once it's enabled, your model should have .yld file for cloth physics and a proper export of .ydd and .yft files. I don't remember but either .yft or .yld file can contain some collisoin volumes to put onto skeleton, so cloth behaves properly. There was a video with WatchDogs model and everything was shown there step by step. Ped model with pre-installed cloth simulation option was used as a base model, so no metadata editing is covered in a video.
Ok thanks I watched a tutorial, but It says that I have too many vertices when I try to export. Is there a way to change the number of vertices without messing up the model?
User avatar
Oleg
Site Admin
Posts: 14045
Joined: Fri Feb 06, 2004 3:54 am
Contact:

Re: How do I apply Cloth physics to a cape

Post by Oleg »

it is likely you have too many vertices in a .cloth object. Actually, this object should be as simple as possible, because it is simulated on a CPU. In most of cases the limit of 255 vertices should be enough. The actual renderable geometry with cloth physics has no vertices limit constrain.

so, in general, you should manually create a very simple geometry for .cloth object and you will be OK with vertices limit. Do not copy real geometry fragment into .cloth object, it's a bad idea.
undead788
Posts: 20
Joined: Fri Mar 26, 2021 1:09 am

Re: How do I apply Cloth physics to a cape

Post by undead788 »

Oleg wrote: Mon Apr 05, 2021 10:13 am it is likely you have too many vertices in a .cloth object. Actually, this object should be as simple as possible, because it is simulated on a CPU. In most of cases the limit of 255 vertices should be enough. The actual renderable geometry with cloth physics has no vertices limit constrain.

so, in general, you should manually create a very simple geometry for .cloth object and you will be OK with vertices limit. Do not copy real geometry fragment into .cloth object, it's a bad idea.
Ok so I have the cloth in game but it is glitchy and I have no idea how to fix it. The cloth moving but is floating above the characters head.
User avatar
Oleg
Site Admin
Posts: 14045
Joined: Fri Feb 06, 2004 3:54 am
Contact:

Re: How do I apply Cloth physics to a cape

Post by Oleg »

a short video will give some ideas on what's wrong. currently can't give any advice.
undead788
Posts: 20
Joined: Fri Mar 26, 2021 1:09 am

Re: How do I apply Cloth physics to a cape

Post by undead788 »

Oleg wrote: Tue Apr 06, 2021 10:01 am a short video will give some ideas on what's wrong. currently can't give any advice.
I fixed the glitchy part but the cloth is still in the air.

User avatar
Oleg
Site Admin
Posts: 14045
Joined: Fri Feb 06, 2004 3:54 am
Contact:

Re: How do I apply Cloth physics to a cape

Post by Oleg »

is your .cloth object bind to .skel too? it should be. also, you should reset its axes to 0,0,0 with display\local axes\"reset to world" tool
undead788
Posts: 20
Joined: Fri Mar 26, 2021 1:09 am

Re: How do I apply Cloth physics to a cape

Post by undead788 »

Oleg wrote: Wed Apr 07, 2021 8:20 am is your .cloth object bind to .skel too? it should be. also, you should reset its axes to 0,0,0 with display\local axes\"reset to world" tool
Thank you! Resetting the axes helped but I just have one more issue. The cape is stuck in the character's back even when moving.
User avatar
Oleg
Site Admin
Posts: 14045
Joined: Fri Feb 06, 2004 3:54 am
Contact:

Re: How do I apply Cloth physics to a cape

Post by Oleg »

remove collisions from skeleton and give it a try again. you should set up cloth physics and shape first. then you can add collisions (capsule primitives) to skeleton, so cloth can interact with character torso and legs.
undead788
Posts: 20
Joined: Fri Mar 26, 2021 1:09 am

Re: How do I apply Cloth physics to a cape

Post by undead788 »

It worked! Thank you for your help, I really appreciate it!
lld123
Posts: 17
Joined: Tue May 30, 2017 6:20 am
Contact:

Re: How do I apply Cloth physics to a cape

Post by lld123 »

Hi, can I contact you to learn the full process ? If you agree so I can pay for the lesson to learn. I cannot find any full tutorial about making physic cloth for ped. Hope you agree ! Thank you so much !
User avatar
Oleg
Site Admin
Posts: 14045
Joined: Fri Feb 06, 2004 3:54 am
Contact:

Re: How do I apply Cloth physics to a cape

Post by Oleg »

There are some video guides on youtube if I'm not mistaken. Also, as far as I know, you need to use a model that natively have a .yld file in game, so game knows about availability of cloth physics.
Post Reply