Set Animation Nodes to work with animated baking I am not able to bake texture sequences with AN generated mesh (like Dynamic Paint or Animated Render baker add-on). It looses vital data on frame change, thus confusing baking.

I tried to use expressions to hold proper UV map for the full timeline:

bpy.data.meshes["Mesh"].uv_textures.active_index = 1


and

bpy.data.meshes["Mesh"].uv_textures["UVMap.001"].active_render = True


But this is not enough, blank Image doesn't associate with UV layer after frame has changed (checked it after re-entering Edit mode).

So, is there any way to make it work, or exporting meshcache is the only option for this?
Using this answer, I can make it work via Script node (UV input is a name of UV layer to bake to):



Script itself: (Assign_img.py)

import bpy

image = bpy.data.images["Untitled"]

Object.data.uv_textures[UV].active = True
Object.data.uv_textures[UV].active_render = True

for uv_face in Object.data.uv_textures[UV].data:
    uv_face.image = image