I am trying to bake
all the textures of a model into a single texture. I have managed to do this manually and am now trying to write a script to do this. However some of the blender operations do not show me the python calls so i am a little stuck. Here is what i do so far:
| def CreateAtlas() :
bpy.ops.uv.smart_project( angle_limit = 66, island_margin = 0 )
img = bpy.ops.image.new( name='Atlas', width = 1024, height = 1024 )
#How do i assign the image to the uvs???
bpy.context.scene.render.bake_type = 'TEXTURE' # Set to bake texures only
After i uv project i need to change the image that is used to a new image however i do not know the python command to do this. It is the ittle icon of an image with a drop down list of images that lets me select the new image. Any suggestions? When i hover my mouse over it the tool tip is 'Browse Images to be linkled', it does not show the python command in the tooltip
I'm struggling with the exact same problem.
Did you ever get it working?
So far I have
|bpy.data.screens['UV Editing'].areas.spaces.image = image
But I am not entirely sure if this is a good way to go?