简介

Cloth simulation is one of the hardest aspects of computer graphics, it is a deceptively simple real-world item that is taken for granted, but it actually has very complex internal and environmental interactions. Cloth is commonly modeled as 2D mesh to simulate real world objects such as fabrics, flags, banners. And yet cloth can also be used to model 3D objects such as teddy bears, pillows, balloons, or balls.

Cloth interacts with and is affected by other moving objects, the wind and other forces, as well as a general aerodynamic model, all of which is under your control.

../../_images/physics_cloth_introduction_example1.jpg

布料例子。

../../_images/physics_cloth_introduction_oncarved-wood.jpg

雕刻木人上的布料(由motorsep制作)。

../../_images/physics_cloth_introduction_example2.jpg

布料例子。

Once Cloth physics have been added to a mesh, a Cloth modifier will be added to the object's modifier stack. As a modifier then, it can interact with other modifiers, such as Armature and Smooth. In these cases, the ultimate shape of the mesh is computed in accordance with the order of the modifier stack. For example, you should smooth the cloth after the modifier computes the shape of the cloth.

您可以*应用*布料修改器来冻结或锁定当前帧处的网格形状,这样会删除修改器。 例如,您可以在桌子上铺上一块平布,让模拟运行,然后应用修改器。从这个意义上说,您正在使用模拟器来节省大量建模时间。

模拟的结果保存在缓存中,以便一旦在动画中的计算出来的每一帧的网格形状不必再次重新计算。如果对模拟进行了更改,您可以完全控制清除缓存并重新运行模拟。第一次运行模拟是完全自动的,没有烘焙或单独的步骤会中断工作流程。

计算每一帧的布料形状是自动的,并在后台完成;因此您可以在模拟计算时继续工作。但是,这很占用CPU,并且取决于PC的性能和模拟的复杂性,计算网格变化所需的CPU占用量会有所不同,同样您可能会注意到的电脑卡顿也会不同。

Note

Do Not Jump Ahead

如果您设置了布料模拟,但Blender尚未计算模拟持续时间内的形状,并且如果您在动画中向前快进了大量帧数,且Blender之前没有计算出前一帧或前几帧的形状,布料模拟器可能无法计算或显示出那一帧精确的网格形状。

工作流程

制作布料的一般过程是:

  1. 建模出布料物体作为一般起始形状。

  2. Designate the object as a "cloth" in the Physics tab of the Properties.

  3. 模拟与布料相互作用的其他偏转对象。确保修改器堆栈上的形变修改器位于任何其他网格变形修改器之后。

  4. 给布料添加灯光并指定材料和纹理,如果需要,可进行UV展开。

  5. 如果需要,可以给予物体颗粒,如从表面上掉下来的蒸汽。

  6. Run the simulation and adjust settings to obtain satisfactory results. The Timeline editors playback controls are great for this step.

  7. 可选的操作是,将网格动画到模拟中的某个时间点,以获取新的开始动画的形状。

  8. 在逐帧的基础上对网格进行较小的编辑,以修正较小的破洞。

Tip

To avoid unstable simulation, make sure that the cloth object does not penetrate any of the deflection objects.

Springs

Internally, cloth physics is simulated with virtual springs that connect the vertices of a mesh. There are four types of springs that control how the cloth bends. These four types are defined below and illustrated in the following image:

../../_images/physics_cloth_introduction_springs.png

Illustration of cloth springs; tension springs (blue), compression springs (red), shear springs (cyan), and angular bending springs (green).

Tension Springs

Control the stiffness of the cloth.

Compression Springs

Control the amount of force required to collapse or compress the cloth.

Shear Springs

Like compression springs but it controls the angular deformation.

Angular Bending Springs

Control how resilient the cloth is to folding or crumpling.

All four of these spring types can be controlled independently in the 物理属性 panel. While these settings control surface springs, optionally, internal springs can be used for 3D meshes and behave similarly to Soft Bodies.