Converting Geometry Nodes attribute to UVMap using Python


I need to use GN to generate some meshes which will be exported to a game engine, which means that I am stuck because of the GN inability to create and output UV channels. I’ve decided to try to work around it and create a python script to convert GN attribute into a UV map channel. I’ve had partial success here:

But the script I’ve put together is really poor. So I was wondering if there’s someone experienced with Python and possibly also Geometry Nodes who could help make the script better.

Thanks in advance.

1 Like

I’ve banged my head around this exact thing the past few days. Even considered learning python just to dis this exact thing. Haven’t looked at what you’ve done yet but will when I get back to my machine!

I’ve even decided to recreate it with what I’ve done in Houdini instead.
It’s odd that GN doesn’t write to uv or vertex colours.