Skip to content

BryantCrisos/softPin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 

Repository files navigation

img

A SoftBody3D Pinned Point addon for Godot 4.2+

This addon makes it easier to pin points on a SoftBody3D Node. The SoftPin Node uses Vertex Colors and separate the areas you want the SoftBody3D to simulate.

Installation

  1. Download the repository as a zip and extract it.
  2. Copy the addons folder into the root folder of your project.
  3. Go to Project > Project Settings > Plugins tab and enable SoftPin

img

  1. You're ready to go! The SoftPin Node should be under Node

img

How to use

Note

First you'll need to vertex paint your model. That will require Blender or another 3D software of choice.

Preparing your model

  1. Select the mesh you want to vertex paint.
  2. Fill the entire model white or black with NO transparency. Values should look like image below:

img

  1. Once the model is fully white or black, use any color and paint the area you want simulated. The non colored areas will be pinned.

img

  1. Export your model to godot.

Using the SoftPin Node

Add the SoftPin Node to the scene with the mesh you want to pin.

img

Property Description
Soft Body Used to assign the SoftBody3D you want to pin
Bone Attachment Used to attach the pinned points to BoneAttachment3D when Pin Type: is set to Skelelton3D
Pin Type Method of pinning, If MeshInstance3D is selected you only need a SoftBody. If Skeleton3D is selected you'll need to include a BoneAttachment with the SoftBody
Start Pinning Used to start the pinning process once ready
Pinning Status Debug menu that tells you the status of the pinning or errors

Pinning MeshInstance3D

When pinning a MeshInstance3D convert the instance into a SoftBody3D, Assign the SoftBody3D, Set the Pin Type: to MeshInstance3D, and switch Start Pinning to On.

img

Once you're done you can delete the SoftPin Node from the scene or repeat the process with another SoftBody3D. Your days of wrestling with pins are finally over.

Pinning Skeleton3D

Warning

When using PinType: Skeleton3D, this is more ideal for things like hair, hanging cloth, and Accessories that only need one bone. Refer to Current Gotchas for more info.

Before starting to pin your initial setup should look something like this.

img

Select the MeshInstance3D under Skeleton3D you want to use. Convert the MeshInstance3D into a SoftBody3D, Assign the SoftBody3D, Assign the BoneAttachment, Set the Pin Type: to Skeleton3D, and switch Start Pinning to On.

img

Once finished go hit the play button to check out the SoftBody!

img

Current Gotchas

Caution

Below are limitations/issues caused by Godot, not the addon:

  • Selecting the SoftBody3D Node After pinning causes editor lag. The denser the model the longer the lag. Keeping vert count under 4K per mesh helps.
  • On project start up, having a scene tab open with Nodes that have Spatial Attachments assigned in SoftBody3D prints this error: - scene/3d/node_3d.cpp:345 - Condition "!is_inside_tree()" is true. Returning: Transform3D()
  • Unfortunately, When using Jolt3D Physics the quality of the SoftBody3D does not look as good as regular Godot Physics when simulating
  • When you assign Skeleton3D In the SoftBody it breaks. Animations on the mesh do not deform properly.

About

softPin assigns pins for Godot's SoftBody3D using Vertex Paint

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published