
Is it possible to turn this generated mapping into an UV Map? If not, would it be possible to access the generated mapping by using bpy?

Is it possible to turn this generated mapping into an UV Map? If not, would it be possible to access the generated mapping by using bpy?
The problem here is that UV unwrapping simply assigns U (X) and V (Y) coordinates to the mesh, the W (Z) coordinate remains at 0 across the entire mesh. Generated coordinates are based on the 3-dimensional bounding box of the mesh.
However, you can recreate the U and V generated coordinates in a UV map.
Just go into top view (Numpad 7) and hit U > Project From View (Bounds).

This will result in the same U an V coordinates as generated mapping.
For more on texture coordinates see my explanation of texture coordinates here.
Generated coordinates are based on the 3-dimensional bounding box of the mesh. -> blender does turn them into UVs for the final OpenGL Eevee render for example. So the code to compute this should be somewhere in blender. And since with cycle with it's "Vector" input allows way more complicated mappings, it would be nice to bake these back to UVs. Is there really no way?
– E. K.
Mar 29 '20 at 17:36
Following @PGMath advice to Project From View (Bounds), you can project two UVMaps, from top and front, and combine them to produce the same exact result as the generated mapping.
Steps:
Create two UV Maps, name them "Top" and "Front":
Go to UV Editing Tab, select the "Top" UV Map:
Go into top view (Numpad 7) and hit U > Project From View (Bounds):
Go to UV Editing Tab, select the "Front" UV Map:
Go into front view (Numpad 1) and hit U > Project From View (Bounds):
Go to the Shader view. On the object's material, create two UV Map nodes, one with Top, the other with Front. Add a Separate XYZ for each one, and combine them with a Combine XYZ. Use the "Top" XY as the XY, and the "Front" Y as the Z.
The result should be exactly the same as the Generated coordinates: