Plugin that generates heightmaps from your static meshes.
Tested on Unreal Engine 5.8.
Activate this plugin, select static mesh actors in your viewport (or run a script to batch select them), then run the python script (mesh_to_landscape_plugin.py).
Monitor the logs in Unreal Engine. Once it's done you'll need to run a retrieve script (mesh_to_landscape_retrieve.py) that will get the generated height map.
You'll need to edit both scripts to change the preferred resolution.