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:
<b>Code:</b> def CreateAtlas() : bpy.ops.mesh.uv_texture_add() bpy.ops.object.editmode_toggle() 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 bpy.ops.object.bake_image()
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. To do this manually i select my new image from the drop down list “Browse Images to be linked”’, Does anyone know the python command for this??