I want to bake vertex colors in Python. When I do this manually I unwrap, create a new image, color the vertices and bake. After creating the new image this image is selected automatically for linking. But after using ‘bpy.ops.image.new()’ I still need to select the new image. How can I do this in Python?
How about
img = bpy.data.images.new("Untitled", 1024, 1024)
for area in bpy.context.screen.areas:
if area.type == 'IMAGE_EDITOR':
area.spaces.active.image = img
It worked! Thank you very much!
Thank, it worked for me too … finally after searching for 3 days.