From 578771ae4dcb8643214c69a7b9761ca154f40f63 Mon Sep 17 00:00:00 2001 From: Jesse Yurkovich Date: Wed, 11 May 2022 20:11:44 -0700 Subject: UDIM: Add support for packing inside .blend files This completes support for tiled texture packing on the Blender / Cycles side of things. Most of these changes fall into one of three categories: - Updating Image handling code to pack/unpack tiled and multi-view images - Updating Cycles to handle tiled textures through BlenderImageLoader - Updating OSL to properly handle textures with multiple slots Differential Revision: https://developer.blender.org/D14395 --- source/blender/blenloader/intern/versioning_300.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'source/blender/blenloader/intern/versioning_300.c') diff --git a/source/blender/blenloader/intern/versioning_300.c b/source/blender/blenloader/intern/versioning_300.c index 7fd72fec3d0..de47fe49946 100644 --- a/source/blender/blenloader/intern/versioning_300.c +++ b/source/blender/blenloader/intern/versioning_300.c @@ -3034,5 +3034,16 @@ void blo_do_versions_300(FileData *fd, Library *UNUSED(lib), Main *bmain) brush->curves_sculpt_settings->points_per_curve = 8; } } + + /* UDIM Packing. */ + if (!DNA_struct_elem_find(fd->filesdna, "ImagePackedFile", "int", "tile_number")) { + for (Image *ima = bmain->images.first; ima; ima = ima->id.next) { + int view; + LISTBASE_FOREACH_INDEX (ImagePackedFile *, imapf, &ima->packedfiles, view) { + imapf->view = view; + imapf->tile_number = 1001; + } + } + } } } -- cgit v1.2.3