Changeset View
Changeset View
Standalone View
Standalone View
intern/cycles/scene/image.cpp
| Show First 20 Lines • Show All 375 Lines • ▼ Show 20 Lines | ImageHandle ImageManager::add_image(const string &filename, | ||||
| const ImageParams ¶ms, | const ImageParams ¶ms, | ||||
| const array<int> &tiles) | const array<int> &tiles) | ||||
| { | { | ||||
| ImageHandle handle; | ImageHandle handle; | ||||
| handle.manager = this; | handle.manager = this; | ||||
| foreach (int tile, tiles) { | foreach (int tile, tiles) { | ||||
| string tile_filename = filename; | string tile_filename = filename; | ||||
| /* Since we don't have information about the exact tile format used in this code location, | |||||
| * just attempt all replacement patterns that Blender supports. */ | |||||
| if (tile != 0) { | if (tile != 0) { | ||||
| string_replace(tile_filename, "<UDIM>", string_printf("%04d", tile)); | string_replace(tile_filename, "<UDIM>", string_printf("%04d", tile)); | ||||
| int u = ((tile - 1001) % 10); | |||||
| int v = ((tile - 1001) / 10); | |||||
| string_replace(tile_filename, "<UVTILE>", string_printf("u%d_v%d", u + 1, v + 1)); | |||||
| } | } | ||||
| const int slot = add_image_slot(new OIIOImageLoader(tile_filename), params, false); | const int slot = add_image_slot(new OIIOImageLoader(tile_filename), params, false); | ||||
| handle.tile_slots.push_back(slot); | handle.tile_slots.push_back(slot); | ||||
| } | } | ||||
| return handle; | return handle; | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 509 Lines • Show Last 20 Lines | |||||