Autodesk Maya 2023
Python
Maya's OpenMaya Python API 2.0
Plugin Development
Procedural Content Generation
This is a Maya Plugin (Github)
written in Python using the Maya's OpenMaya API for Python. The plugin creates a deformer node
for the selected meshes to allow deformation of the mesh to represent gerstner waves.
The node has attributes to control wave direction, steepness, wavelength and movement (supports 3 waves).
The video below demonstrates the plugin tool and an example of the results it can achieve.
To create a deformer node, the plugin extends the MPxDeformerNode class available
in the OpenMaya API :
Maya Python API 2.0 Reference
Attributes (Art Directable Controls):
Discovered by František Josef Gerstner.
When using sine function to move surface points, the points tend to only go up and down, which is not realistic for water.
Water has volume and therfore, the surface points instead move within a circle. Gerstner waves algorithm models this aspect
of water surface movement.
I referred to this Gerstner Waves
article to implement the algorithm.
The algorithm works on each mesh vertex position and moves it as per the eqaution.