23-10-2019, 02:53 PM
(This post was last modified: 23-10-2019, 02:55 PM by JimItatake.)
Hi,
I've come to notice that the file size of a prefab variants with softbodies can get very large.
In our game we have some prefabs with softbodies that have around 350 particles. I was converting these to prefab variants when I found out that they went from around 1,125KB (Original prefab) to over 10,000KB (Prefab Variant).
Here's a little test case I put together with a simplified setup:
1. Create original prefab:
Just a GameObject with the following components:
Initialized with a Particle count of 8.
Particle generation settings = default
This prefab have a file size of 8KB.
2. Create a prefab variant from the prefab above and Initialize the softbody.
The variant file size is now 3KB.
3. Modify Particle generation settings on Obi Softbody and hit Initialize again.
Particle Generation settings
Particle Radius = 0.05
Particle Overlap = 0.75
Rest = default
Now the particle count is 24.
The variant file size is now 141KB.
4. Revert the variants Particle generation settings to same as Step 1.
Now the particle count is 8.
The variant file size is still 141KB.
The only way I can get back to 3KB is for me to create a new variant from the original prefab.
Am I doing something wrong or is this a bug?
Unity 2019.1.14f1
Obi Softbody 4.1
I've come to notice that the file size of a prefab variants with softbodies can get very large.
In our game we have some prefabs with softbodies that have around 350 particles. I was converting these to prefab variants when I found out that they went from around 1,125KB (Original prefab) to over 10,000KB (Prefab Variant).
Here's a little test case I put together with a simplified setup:
1. Create original prefab:
Just a GameObject with the following components:
- Obi Softbody
- Oki Shape Matching Constraints
- Obi Pin Constraints components
Initialized with a Particle count of 8.
Particle generation settings = default
This prefab have a file size of 8KB.
2. Create a prefab variant from the prefab above and Initialize the softbody.
The variant file size is now 3KB.
3. Modify Particle generation settings on Obi Softbody and hit Initialize again.
Particle Generation settings
Particle Radius = 0.05
Particle Overlap = 0.75
Rest = default
Now the particle count is 24.
The variant file size is now 141KB.
4. Revert the variants Particle generation settings to same as Step 1.
Now the particle count is 8.
The variant file size is still 141KB.
The only way I can get back to 3KB is for me to create a new variant from the original prefab.
Am I doing something wrong or is this a bug?
Unity 2019.1.14f1
Obi Softbody 4.1