I want to create multiple UDIM tiles using the following for loops. They work perfectly fine:
tile_no = "None"
udim_tex = bpy.data.images.new(name="UDIM Texture", width=1024, height=1024, tiled=True)
for ix in range(10):
for iy in range(10):
tile_no = 1001 + iy*10 + ix
udim_tex.tiles.new(tile_number=tile_no)
To have all the created tiles saved, they have to be filled.
Fill a UDIM tile with python API
This post talks about just that, but on the first hand, it does not work for me and on the other hand the answering person calls it "not the best solution".
Here, I am trying to use the solution, posted in the link, but as stated, doesnt work for me -.-
bpy.context.area.ui_type = 'IMAGE_EDITOR'
bpy.context.space_data.image = udim_tex
bpy.ops.image.tile_fill(color=(0, 0, 0, 0), width=500, height=500, float=False, alpha=True)
I am looking for a way to fill the tiles. Either by filling them directly after the tiles.new in the double for. Or by filling them afterwards somehow, can be another for if needed.