Cloth Physics Guide

This guide is still work in progress.

Cloth physics are what makes hairstyles and clothes in Starfield react to surroundings, such as a player movement, wind, etc.

Cloth physics might be used in a lot of ways: Outfit cloth simulation, Hairstyles, Any other physically affected elements, and other creative ways you might come up with. This guide will explain how to make cloth physics for your outfit/clothing piece/hair/etc.

Preparation

  • Blender 3.6
  • Starfield Geometry Bridge Blender addon

Tip

Refer to Cloth Physics Nodes page for the nodes reference.

Starting

  1. To compose cloth physics, you need first install Physics Editor Interface. This is an additional blender addon that can be downloaded here.
  2. “Starfield Havok Physics Editor” addon adds new Physics Node Tree and useful functionalities for custom havok physics data composition.
  3. Make sure your main addon “Starfield Geometry Bridge” and “Starfield Havok Physics Editor” have the same version number. You can check version number from blender’s addon panel.

Image 1

Prerequisite Knowledge

  1. What is Cloth Simulation: Cloth simulation in general is to use the behaviour of discretised “particles” with physics properties to simulate the behaviour of a piece of cloth or skin.
  2. Key Components in Cloth Sim:
    • Particles: In cloth simulation, particles are used to represent and simulate the behaviour of individual points or vertices in a cloth mesh. Instead of simulating the entire cloth as a continuous surface, cloth simulation often breaks it down into a system of particles connected by springs or constraints. These particles interact with each other and their environment to create realistic cloth movement and deformation.
    • Constraints: Constraints are limitations or rules applied to the movement or behaviour of particles within the simulation. They are often used to control the interactions between particles representing different points on the cloth.
    • Colliders: Colliders are physics entities that particles or other colliders can collide with.

Edit Physics in Node Editor

  1. Check “Important Notes” below before making your first composition.
  2. Check “Graph and Nodes” to better understand the graph and how data flows.
  3. Open physics editor interface: Switching to “HCL Physics Editor” in any UI Area by changing the “Editor Type” at left-top conner to “HCL Physics Editor”.

Image 3

  1. Click on “new” button at top of the window to create a new node tree and set the name to your likings.
  2. Once done, you should be able to add new nodes into the node tree (See Image 4). Start by Adding an “Graph Output” node. Press “Shift + A” and locate “Output -> Graph Output”.

Image 4

  1. You can’t export your composition when there’s an error present. The error message shows that the output node doesn’t receive any valid input.

Image 5

  1. Shift + A -> Physics Data -> Two State Physics Data” to add a physics data node. Connect the physics data node to output node.
  2. Eliminate the errors by providing valid inputs and check the Demo Project for what’s missing in your composition. You may end up having a Node Tree like in the Demo Project.

Image 6

Important Notes

  1. The graph takes two things as input: A skeleton with cloth bones and a simulation mesh for cloth particles and constraints. Use “Shift + A -> Input -> Armature Input & Mesh Input” to tell the node tree which skeleton and mesh object to use.
  2. Simulation mesh should be weighted to the skeleton! If you don’t sure how to weight your simulation mesh, you can open any clothes nif with physics data with “Visualize Havok Sim Cloth Data” on and see how Beth did their job (hclSimClothData_XXX is the simulation mesh used by Beth).
  3. For greater stability, it’s recommended to use “Stretch Link” in the constraints together with “Standard Link” constraint.
  4. When adding nodes, hovering on a node in the node menu before adding it will show its description. Be sure not to miss that since it tells you what the node does.
  5. There is a button inside right-click menu to Mark Selected Elements in Edit mode. You can then get the indices of your selected elements using a combination of “Mesh Input -> Mesh Attribute Selection” nodes.

Graph and Nodes

The included Diagram (Image 7) and node graph Example (Image 8) visualizes the Below Description Image 7 Image 8

Graph for Cloth Physics

  1. From low level to high level, from left to right, a graph takes “Simulation Mesh” and “Skeleton” as input and go through 3 stages to produce physics data.
  2. Stage 1 is how particles are produced from input mesh, which is what “Particles From Mesh” node does.
  3. Stage 2 is how particles are constrained together. Use the nodes in “Constraint” category and finally link to “Sim Cloth Data” node to proceed.
  4. Stage 3 is the time to define whether you want collisions to happen between certain particles and colliders (optional) and how physics bones are driven by simulation (required). Optionally you can use “Simulation -> Disable Collision” node to achieve that, and finally link the output to “Two State Physics Data” node. At this stage, also use “Physics Bone -> Simple Triangle Bone Driver” node and provide it with a list of bones (use “Match Bone Name” node in “Select” category) to produce “Physics Bones” data and feed it to “Two State Physics Data” node.

Inspecting how vanilla does it

To get a better understanding of how to set-up the physics for the correct export, let’s take a look at how vanilla does it.

For this, let’s import tousled_bob_m hairstyle: \meshes\actors\human\mesh\hairs\tousled_bob\tousled_bob_m.nif

With these settings: Image 9


Explanation

Image

Following table explains important parts of the imported data:

ImageDescription
ImageA colliding capsule of the physics data. In this model, it prevents the sim mesh from colliding with the head zone.
Image ImageA simulation mesh. It should be similar to the model, but very simplified and not self-intersecting.
ImageA skeleton that includes model-specific cloth bones.
ImageA model of the hairstyle itself.

Creating custom physics