Zh/Cloth Simulation: Difference between revisions
(Created page with "{{Language subpage}} '''布料物理模拟'''提供了一种在模型上模拟布料变形的方法。{{src2|4}} 的物理引擎 Rubikon 支持布料模拟。 {{Warning|...") |
m (Setting bug notice hidetested=1 param on page where the bug might not need tested in param specified) |
||
(5 intermediate revisions by 4 users not shown) | |||
Line 1: | Line 1: | ||
{{ | {{LanguageBar}} | ||
'''布料物理模拟'''提供了一种在模型上模拟布料变形的方法。{{src2|4}} 的物理引擎 | {{Dota 2Tools topicons}} | ||
{{translate}} | |||
'''布料物理模拟'''提供了一种在模型上模拟布料变形的方法。{{src2|4}} 的物理引擎 {{L|Rubikon}} 支持布料模拟。 | |||
{{Warning|此页面大部分内容都是基于老版本起源2引擎的,新的内容(包括ModelDoc)暂未被添加!}} | {{Warning|此页面大部分内容都是基于老版本起源2引擎的,新的内容(包括ModelDoc)暂未被添加!}} | ||
{{note|该系统基本上没有记录,官方资料也不多。}} | {{note|该系统基本上没有记录,官方资料也不多。}} | ||
Line 11: | Line 13: | ||
=== {{source2|4}} === | === {{source2|4}} === | ||
布料模拟在{{dota2|4}}中主要用于角色服装。在 | 布料模拟在{{dota2|4}}中主要用于角色服装。在 {{L|SteamVR Home}}(官方拳击场环境中被击败的拳击机器人模型)中也有使用。 | ||
<s>当前SDK中的模型编辑器对制作布料的支持有限。尚未发布的 ModelDoc 引擎内工具似乎将取代它,但其功能尚不清楚。阀门工作流程似乎使用 Maya 或 Modo 为网格绘制每个顶点的属性。DMX 模型格式可用于将这些属性导入引擎工具。</s> <br> | <s>当前SDK中的模型编辑器对制作布料的支持有限。尚未发布的 ModelDoc 引擎内工具似乎将取代它,但其功能尚不清楚。阀门工作流程似乎使用 Maya 或 Modo 为网格绘制每个顶点的属性。DMX 模型格式可用于将这些属性导入引擎工具。</s> <br> | ||
待补充新内容。 | 待补充新内容。 | ||
Line 22: | Line 24: | ||
{{todo|Keyvalues in the .vmdl file suggest other softbody systems exist.}} | {{todo|Keyvalues in the .vmdl file suggest other softbody systems exist.}} | ||
{{bug|In SteamVR Home, cloth will stop simulating after a half second unless an animation is playing on the model.}} | {{bug|hidetested=1|In SteamVR Home, cloth will stop simulating after a half second unless an animation is playing on the model.}} | ||
== Features == | == Features == | ||
Line 29: | Line 31: | ||
* Supports collision with other objects: Spheres and capsules, convex hulls, and even arbitrary meshes are supported. | * Supports collision with other objects: Spheres and capsules, convex hulls, and even arbitrary meshes are supported. | ||
* {{todo|Self collision within the cloth does ''not'' seem possible.}} | * {{todo|Self collision within the cloth does ''not'' seem possible.}} | ||
* Supports wind from | * Supports wind from {{L|env_wind}} | ||
* Pressure forces | * Pressure forces | ||
* Volumetric solver | * Volumetric solver | ||
Line 52: | Line 54: | ||
Cloth attributes can be painted on with an external modeling tool. A plugin is required to export a mesh with the attributes. | Cloth attributes can be painted on with an external modeling tool. A plugin is required to export a mesh with the attributes. | ||
Valves plugins have not been released, but an experimental fork of the | Valves plugins have not been released, but an experimental fork of the {{L|Blender Source Tools}} addon capable of exporting {{L|DMX/Source_2_Vertex_attributes|DMX vertex attributes}} is available [https://github.com/Rectus/BlenderSourceTools here]. | ||
== Ways of adding cloth == | == Ways of adding cloth == | ||
Line 141: | Line 143: | ||
== Using models with cloth == | == Using models with cloth == | ||
=== SteamVR Home === | === SteamVR Home === | ||
Only the | Only the {{L|prop_dynamic}} entity class seems to work properly with cloth, although it can be parented to other entities. {{todo|The entity may have to be parented to a bone of the parent entity in order not to crash.}} | ||
{{bug|The prop needs to have an animation playing at all times for the cloth not to sleep and reset. The animation does not need to move any of the existing bones though, so any animation file with multiple frames can be added and set to loop for models that do not already have animations.}} | {{bug|hidetested=1|The prop needs to have an animation playing at all times for the cloth not to sleep and reset. The animation does not need to move any of the existing bones though, so any animation file with multiple frames can be added and set to loop for models that do not already have animations.}} | ||
{{ACategory|Modeling}} | |||
{{ACategory|Source 2}} | |||
{{ACategory|Physics}} |
Latest revision as of 07:20, 20 May 2025

This page either contains information that is only partially or incorrectly translated, or there isn't a translation yet.
If this page cannot be translated for some reason, or is left untranslated for an extended period of time after this notice is posted, the page should be requested to be deleted.
Also, please make sure the article complies with the alternate languages guide.
布料物理模拟提供了一种在模型上模拟布料变形的方法。 起源2 的物理引擎 Rubikon 支持布料模拟。


支持的引擎
起源
Dota 2 的原始
起源 版本包含一个传统的布料模拟系统。
起源2 中的布料系统似乎向后兼容该系统。
起源2
布料模拟在 Dota 2中主要用于角色服装。在 SteamVR Home (官方拳击场环境中被击败的拳击机器人模型)中也有使用。
当前SDK中的模型编辑器对制作布料的支持有限。尚未发布的 ModelDoc 引擎内工具似乎将取代它,但其功能尚不清楚。阀门工作流程似乎使用 Maya 或 Modo 为网格绘制每个顶点的属性。DMX 模型格式可用于将这些属性导入引擎工具。
待补充新内容。
The cloth system appears to have received significant upgrades after the initial Dota 2 implementation, including collision with world meshes. Old versions of the Source 2 tools include help files for the model editor that document many of the cloth features. These help files were removed with an update that changed the tool help file format. Converted versions of the help files can be obtained here.

Features
Known features include:
- Can drive meshes either directly, through a proxy mesh or through manually set up nodes.
- Supports collision with other objects: Spheres and capsules, convex hulls, and even arbitrary meshes are supported.
- 待完善: Self collision within the cloth does not seem possible.
- Supports wind from env_wind
- Pressure forces
- Volumetric solver
- Cloth can be driven from animations
- Bend and stretch springs 待完善: Shear springs may exist.
How it works
A cloth piece consists of a set of cloth nodes connected together with quads and rods. Quads connect four nodes together and act as cloth surfaces, while rods connect two nodes and act as stiff rods or ropes.
The cloth nodes can drive bones in the model skeleton, which in turn drive the render mesh. Apart from manually setting up nodes and bones, the model compiler can generate cloth procedurally from attributes painted on the vertices of a mesh. The compiler will then generate a cloth node and a bone on each vertex with cloth enabled.
The attributes can be painted directly onto the render mesh, but also onto a separate cloth proxy mesh. The cloth will them be generated from the vertices of the proxy mesh instead. The proxy mesh can automatically skin and drive the render mesh, or both meshes can be skinned to the same skeleton and the joints back-driven from the cloth. This can be used if the render mesh doesn't have good topology to support cloth, or to make a simpler more performant cloth setup.
External tools

Cloth attributes can be painted on with an external modeling tool. A plugin is required to export a mesh with the attributes.
Valves plugins have not been released, but an experimental fork of the Blender Source Tools addon capable of exporting DMX vertex attributes is available here.
Ways of adding cloth
To edit cloth properties, a collision file is needed in the model. In the model editor, right click Cloth (Compiled) or (NULL Collision if no cloth was generated) in the outliner, and choose New Collision. An item for cloth settings will now be available, as well as several more right-click options.

Paint onto render mesh
Paint the cloth_enable
attribute onto vertices to be simulated.
The by default a hidden setting in the model forces back-solving to be used. To enable cloth processing on the render mesh, open the .vmdl file of the model in a text editor, navigate to the m_clothProxyMeshList
category and set m_bDriveMeshesWithBacksolvedJointsOnly = false
Pros
- Relatively simple
Cons
- Expensive on high poly meshes
- Requires planned mesh topology
Auto-match render mesh to proxy mesh
Author a proxy mesh and paint the cloth_enable
attribute onto it.
To show the cloth proxy mesh category in the model editor, edit the .vmdl file navigate to the m_clothProxyMeshList
category and add a set of curly brackets inside the square brackets of the m_clothProxyMeshList
key inside. It should look like: m_clothProxyMeshList = [ {} ]
To make the auto matching work, add the proxy mesh to the proxy list, and uncheck all the back-solve options. Note that both meshes need to be skinned to the same skeleton to be matched.
Pros
- Auto-matches render mesh to cloth
Cons
- May not match well in all cases
Back-solve mutual bones on proxy mesh to drive render mesh
Enable either of the back-solving options for the proxy mesh.
Pros
- Gives good control on how the render mesh deforms
Cons
- Only deforms mesh from existing bones
Add cloth piece on predefined bones
Create a grid of bones in an external modeling tool. It is recommended to keep a good naming conversion.
Right click the collision properties and choose 'Add Cloth Piece'. Use the UI to select bones set up the cloth.
Pros
- Might be a good way to add ropes
Cons
- Hard to use UI
- Many features missing or undocumented
- Bones have to be in a grid pattern and oriented right
- Tools will crash when misconfigured
Manually add nodes on predefined bones
Use the cloth properties to add nodes manually. It is recommended to turn off AutoComp while doing this.
Pros
- Exact control over topology
Cons
- Extremely hard to use UI
- Many features missing or undocumented
- Tools will crash when misconfigured
Author it in ModelDoc?
Wait for Valve to release the tool (this may take a long time).
Pros
- Added more recently than other methods
Cons
- May not be a complete way to author cloth
- Unavailable for mortals
Using models with cloth
SteamVR Home
Only the prop_dynamic entity class seems to work properly with cloth, although it can be parented to other entities.
