Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Custom Rig and Skinning
#1
I have a variety of very spindly objects (plants mostly), with premade skeletons and skinning weights. Is there any way to specify Obi Softbody to use a custom set of points/physical properties/shape-matching groups for an object? The built-in generator is fine for simple objects, but it really doesn't work well for thin stuff (because the shape matching binds shapes across nearby leaves).
Reply
#2
(16-02-2020, 07:05 PM)kleptine Wrote: I have a variety of very spindly objects (plants mostly), with premade skeletons and skinning weights. Is there any way to specify Obi Softbody to use a custom set of points/physical properties/shape-matching groups for an object? The built-in generator is fine for simple objects, but it really doesn't work well for thin stuff (because the shape matching binds shapes across nearby leaves).

Hi there,

You could write your own custom softbody blueprint by deriving from ObiSoftbodyBlueprintBase and implementing its Initialize() method. This way you would have complete control over shape-matching cluster generation.

There isn't any documentation regarding this, though. I'd suggest starting from ObiSoftbodySurfaceBlueprint or ObiSoftbodyVolumeBlueprint, and modifying them to suit your needs.

A blueprint must:
- Initialize all per-particle data arrays (positions, orientations, velocities, etc).
- Set up constraints between particles.

Generating particles is quite straightforward, simply allocate arrays large enough for the amount of particles you need, and fill in their initial data.

Constraints are a bit more involved, because they need to be separated into batches for efficient runtime parallelization. No two constraints inside a batch can reference the same particle. This is done by using the GraphColoring.Colorize() method, it takes a particle index list and a constraint index list as input, and returns a batch index (a "color") for each constraint.

The ObiShapeMatchingConstraintsBatch has a AddConstraint() method, that takes a list of all particle indices in that cluster as input. So:

- Determine what particles should be in each cluster.
- Assign a batch index for each one using GraphColoring.Colorize()
- Create the constraint batches, and add the clusters to them.

Let me know if you need more help with this.
Reply