26. September 2023

Controlling a Modifier with MoGraph Fields

While the currently is no way to directly sample MoGraph fields within Scene Nodes there is a way to transfer field information into a node setup.

By assigning a Vertex Map tag to an object we can add fields to control the values of that vertex map. These values can then be used to control any point based function within Scene Nodes.

The attached scene holds two setups that basically do the same thing. A noise from a random field is used to displace the geometry of an object

The setup is a straight forward point modifier, so we have a Points Info node that delivers all selected points (you can add any Selection Modifier to control which points should be displaced), an iteration over all indexes of the selected points and then the processing.

The key element here is that the Points Info node delivers all weight map data along with the positions, normals etc. we just have to use it.

By default the Points Info node will deliver the first weight map it finds, if that is not what you want you can use the Named Weights input to specify a Vertex Map by name. This input can also be made an input of the Nodes Modifier itself so you don’t have to dive into the node setup to change this.

Just copying an existing way to deform a mesh isn’t very useful on its own, but you can use this as a base for any own modifier/deformer you want to build and control via fields or painted weights. Additionally this setups makes it easy to restrict the deformation to selected elements only, just add any Selection Modifier you want in the Object Manager.
On a related note, Point/Polygon Selections can be defined using Fields as well.

Example-Weight-controlled-deformer.c4d