Cloth Simulation

I've just started learning animation in Blender, and I've come across a problem with the cloth simulation. In the attached picture, I made a table, a plate, and a piece of cloth. The cloth is simply a plane with 50 subdivisions, and I turned on cloth simulation and self collisions. I added the collision modifier to both the table and the plate. When I run the simulation, the cloth deforms before hitting anything, and seems to pass right through the table and plate. Can anybody help? Thanks!

  • 1
    $\begingroup$ You might want to play around with the settings in the cloth physics. As for the table, you need to make it a Rigid Body > Passive type, in the physics tab for the cloth to collide with it. The same goes for the plate. $\endgroup$ – stphnl329 Apr 2 '20 at 3:31

In the future, including a .blend file or a minimal working example script would be ideal because then we can directly diagnose any potential issues.

In lieu of that, here is a minimal working example script using Blender 2.82a with cloth collisions, which you can build upon for your own tests.

If this script is in a file called test.py then you just have to run blender -P test.py from your command line (e.g., this is usually Terminal or iTerm if you're on a Mac OS). Then this will open up Blender, and you can play around with the settings and observe what modifiers need to be present.

import bpy

def clear_scene():
    """Get rid of the starting cube."""

def make_meshes():
    """Make Suzanne mesh, with the collision modifier."""
    bpy.ops.mesh.primitive_monkey_add(size=2, enter_editmode=False, location=(0, 0, 0))
    bpy.ops.transform.resize(value=(2, 2, 2))

def make_fabrics():
    """Make fabric that drops over the Suzanne mesh and collides with it."""
    bpy.ops.mesh.primitive_plane_add(enter_editmode=False, location=(0, 0, 0))
    bpy.ops.transform.resize(value=(3.5, 3.5, 3.5))
    bpy.ops.transform.translate(value=(0, 0, 6.0))

    # Sub-divide into 50, like how you did it.

    # Turn on collisions an increase the quality of the steps.
    bpy.context.object.modifiers["Cloth"].settings.quality = 10
    bpy.context.object.modifiers["Cloth"].collision_settings.collision_quality = 5
    bpy.context.object.modifiers["Cloth"].collision_settings.use_self_collision = True

if __name__ == '__main__':

A few additional comments about the code:

  • It deletes the starting cube and adds a Suzanne mesh. I figured this would be more interesting, and it also shows how you need to add the collision modifier.
  • The cloth is subdivided into 50 (like you did) with the collisions on.

Upon running the code, I end up with the following screen recording upon clicking "Play":

enter image description here

The cloth correctly collides with the Suzanne mesh, as desired, though it slows down a bit. :)


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.