[Bf-committers] Cloth modifier -> Field weights -> unique vertex group and weight painting for each force type

Brecht Van Lommel brechtvanlommel at pandora.be
Wed Oct 2 14:13:01 CEST 2013

Hi Peter,

On Tue, Oct 1, 2013 at 9:14 PM, Peter Hoppe <peter.hoppe at gmail.com> wrote:
> In Blender, I've been experimenting with the cloth modifier. One feature I am missing is to assign weight painted vertex
> groups to the resp. cloth field weights in the physics context. This sort of weighting is already possible in the "Cloth
> Stiffness Scaling" in the physics section.
> This would allow for setups where (for example) we have a mesh with a vertex group x which is weight painted so that x
> has got a force field weight of 1 in the center and a force field weight of 0.5 in the outer parts.

This sounds like a good feature to add.

> In extension to this, one could make all force types in the "Cloth Field Weights" section assignable to separate vertex
> groups, each one with its own weight painting. This would make setups possible where (for example) we have a mesh which
> in it's center responds to a force field, weight 1), a bit outside the center it responds to a force field, weight 0.5
> and in the outer rim it responds to a wind field, weight 1.

I'm not sure about this, it may be a bit overkill. In a node based
system something like this may fit naturally but with the current
code, adding a vertex group for every possible option seems like it
would add UI clutter. It would be good to get some user feedback to
understand if this is actually a needed feature or just something that
would be added because it's possible.

> Development wise, I am happy to look into this - however, I'd need some pointers where to start:
> * Which documentation do I need to consult?

There isn't really Cloth code documentation as far as I know, just
general code documentation:

> * If it can be done with a plugin, which part of the plugin API do I use?

It's not possible to do this with a plugin.

> * If it needs some development below the plugin layer, which parts would I need to consider?
> * Any hints of how to bind the feature into the GUI?

Look at the code for the other vertex groups. For example search for
"vertex_group_mass" in the code and see where it is used.

> * I assume that this new feature would present some challenges when it comes to saving blender files - how could this
> vertex group and weight paint information be incorporated?

Same answer as above, look at the existing vertex groups, or read the
DNA and RNA documentation to understand how Blender stores data in

> I don't expect this to be easy to implement - it would probably involve some measure of battling it through. But it
> would be a fun project for me to do, plus I'd be learning in the process. Any hints are much appreciated! At the moment
> I am using Blender 2.62 on Kubuntu 12.04, 64 bit.

You'll need to build Blender from source, instructions are here:


More information about the Bf-committers mailing list