# EZ uv-mapping of generated images to sphere, but never the right direction

I'll be generating images in python and then uv-mapping them to a sphere and hope to automate it - possibly even a new image each frame coordinated with the sphere shape keyframed as well. uv-mapping was quite easy when I did it here with a NASA image, but when I tried again with PNG images that were saved using plt.imsave('img2', img2) blender seems to want to put the "poles" somewhere on the equator.

update: The NASA images don't work now either. I recently moved to a new computer environment (clean install) and installed the most recent Blender.

Below are the images shown a few ways to make sure I have the orientations in both "tall" and "wide" format. The shapes of the numpy array generating the images are [1201, 2401, 4] and [2401, 1201, 4] where the third index represents R, G, B, A. The pattern is calculated so that the lines are constant thickness from "equator" to "pole" after uv-mapping to a sphere.

I used the GUI to make the first sphere and set the parameters, connected the Nodes material, then copy/pasted a second sphere and edited the image file. I haven't rotated the spheres at all.

While I can half-fix this by adding a mapping node as @Gandolf3 shows, I really want the direction of the lines to reliably map to the top and bottom of the uv-sphere mesh object - being the place where all the edge loops meet.

Is there some way I can get Blender (here) to always uv-map the long edges of the image, or at least the top/bottom edges reliably to the poles of the uv-sphere? If I do this a lot I may try to automate it, and images may differ in size/shape slightly I'd like to get a handle on this!

Here are img2.png and img3.png to play with!

Nodes:

uv-spheres

Rendered:

the two images

This Doesn't Help! (all permutation of x, y, and z 90deg rotations)

• unwrap the object and use UVs as the texture coordinate instead of generated – cegaton Apr 22 '16 at 14:26
• Have you tried rotating on the other axes in the mapping node? – Matt Apr 22 '16 at 14:35
• @Matt yep, all eight combinations 0 or 90 for x, y, z rotation. some 180's and 270's also. The whole pattern responds by rotating but with no change in the shape of the pattern. This is similar to what happens when I rotate the images during generation first (red vs blue). – uhoh Apr 22 '16 at 14:41
• @cegaton I'm looking to automate this, and therefore looking for a more streamlined solution than unwrapping all the time (frame-by-frame for each new image? ouch!) Thanks for reminding me - I should add that to the question. Since it used to work (see edit) for the NASA images - I'd like to find out how to generate images that work the same way. – uhoh Apr 22 '16 at 14:56

The Projection setting in the Image Texture node needs to actually be set to Sphere if you want to project on to a Sphere. Makes sense :).