Hi! A few weeks ago I wrote a small python module to create vector-fields and flow maps that can export to formats that Unreal Engine (FGA) and Unity (VF) use. I wanted to share it with you in hopes that it may be useful to someone.
I admit it’s not very artist-friendly because you have to use python commands to provide formulas for the evaluation of the vectors over a grid. This is because at the time I just needed a simple method of getting a vector-field for an electric dipole, without any additional software licenses or complicated setup.
If you have a python installation, you can simply install the module with
pip install vectorfields. (If you use Anaconda and create a new environment, make sure to use
conda install numpy beforehand.)
I already provided a few special classes like Vortex2D or ElectricDipole2D, but the classes you would be using most often are CustomUV2D and CustomUVW for which you provide functions. The 2D classes have a resolution of 1 on the Z-axis. You can get a cubic field from them with the
.to_3d() method. Use the
.save(<filepath>) method to export to either FGA, VF or a supported image format.
Find out more in the short Documentation.
Here are some examples:
I’d be happy if you want to contribute to the github repository. But feel free to use the code in your own projects.
And I would also love to see your creations using this.