Page MenuHome

Cloth simulation machine units scale is off.. it have to be 10 times smaller
Closed, ResolvedPublic

Description

Operating system: Win10
Graphics card: Nvidia 1060

Blender Version
Broken: v2.80.248

Short description of error
Cloth simulation machine units scale is off.. it have to be 10 times smaller

Exact steps for others to reproduce the error
If you want to make a Simulation off a piece of canvas there is a square meter,you have to make it Ten times bigger (10m x10m).
Then default presetting for canvas works, as Long as you don't change the settings for the mass, it should be 10 times less Around 0.2 to 0.3 kg

Related Objects

Event Timeline

Personally I think the default scale of Blender is way too big..
The default cube is 2x2x2 meters, When You Look at a screen without any reference to compare with,you will properly think It is a lot smaller.
I'm guessing between 2x2x2cm and 20x20x20cm depending of the size of the screen you are working on.
but I don't think anyone with ges in the meters range

Brecht Van Lommel (brecht) lowered the priority of this task from 90 to 30.Mar 16 2019, 6:17 PM

Can you describe exactly what the bug is? What fails if you don't make it bigger? It seems to work fine here.

Here is two file/scenes with baked in keyframes - world scene scale is 1.0
if I change the scene scale to 0.1 the Mass is 0.0003kg and max out at 0.01kg

Philipp Oeser (lichtwerk) raised the priority of this task from 30 to 90.Mar 27 2019, 12:28 PM
Sebastian Parborg (zeddb) lowered the priority of this task from 90 to 50.

The weight of the cloth sim is indeed scaled too much it seems.

Sebastian Parborg (zeddb) changed the task status from Unknown Status to Archived.Apr 2 2019, 1:08 PM

This is actually the correct behavior.

The mass is calculated as mass = density * volume and volume = m^3. So if you scale the scene to 0.1 units, the new mass will be oldmass * 0.1^3 = 0.3kg * 0.1^3 = 0.0003kg

Sebastian Parborg (zeddb) changed the task status from Archived to Unknown Status.Apr 2 2019, 1:11 PM

My bad now I see the issue. The weight can't go up higher than 0.01kg.

@Brecht Van Lommel (brecht) this is really old, but do you remember why we cap the weight rB6ec52fc1b573e2904d7d08728f120589b649a08b ?

I'm guessing it has to do with simulation stability etc.

There's no good reason I imagine, it's easy to get unstable simulations anyway. That commit is porting things from even older UI code that had these limits. Just remove the limits.

edit. Blender 2.92

Brecht, Sebastian, you're confusing the unit scale with the object size. There is no reason why physics attributes should depend on the unit scale, including camera lens and light falloff, other than simulations.

Here's the proof that's simple enough:

  1. Set the unit scale to 1.0 then run a cloth simulation with a 1m cube and a 2m cloth.
  1. Then set the unit scale to 0.1 and run the same simulation with a 1m cube and a 2m cloth, with also the same simulation parameters of course. You will get very different results.

Physics simulations should only depend on the object size, not on the unit scale. That is, the unit scale is there to set the measure units, not the size of the objects. This is also reported in the blender docs.

https://docs.blender.org/manual/en/latest/scene_layout/scene/properties.html

Below the example above and the two scene files included. The objects size and physics attributes are exactly the same. It is only changed the unit scale.

What the Blender docs say is that if you have an existing scene and change the unit scale value, then nothing will change in physics simulation, and I believe that is how it works.

If you set the unit scale value and then start editing the scene and setting sizes, the result will be different. That's due to numerical precision differences. The whole point of the unit scale setting is that you can set it to a particular value to improve numerical precision when working at small or larger scales, if there would be no difference there would be no point in having the option.

The aim is for physics simulations to be as independent as possible from the unit scale, but in practice that's not always the case. Note that there are also physics simulation settings like collision distance that will change units when you change the unit scale, that you need to set to matching values to get a correct comparison.

Thank you Brecht for your reply, it is just great to have you caring about this.

As for the unit scale, the precision difference is intended for microscopic or astronomical scale, as the popup explains. If changing the scale by 1/10 messes up the whole simulation precision I hope we can agree there's something odd. As for the simulation values, in my test scenes I did change the values according to the unit scale, for example the vertex mass stills 0.3 kg in both scenes, that's the cotton preset, as also shown in the pictures. Again, it doesn't make sense that two simulations where the objects have the same physical attributes differ so much, just for precision issues by changing the unit scale by 1/10.

As a side note, since we're here. The cloth vertex weights in the presets seem off enough. I mean, a cotton fabric is about 140 gsm (grams per square meter) while the cotton preset gets 300 grams per vertex, this means we must have one vertex per two square meters to get it right.

And really, thank you so much again for your reply and attention on this.

edit. Then I understand this can be hard to fix. If so, it would be useful to add a note in the blender docs stating that cloth simulation must be used with unit scale = 1 to avoid bad precision issues.

blender 2.92

You may also want to look at the diffeomorphic discussion where Thomas implemented dforce assets for Blender. Specifically, it seems that the minimum distance of 1 mm for collision is not enough for real case simulations, and we need to scale the whole scene up to get more precision and avoid the simulation stalling. This is also reported in the tutorial linked below.

So if you could remove the limit for the minimum collision distance, or at least make it less than 1 mm, it will be useful. Thank you.

https://bitbucket.org/Diffeomorphic/import_daz/issues/410/better-dforce

https://www.youtube.com/watch?v=AbyfuW5Aocg