Blender Git Commit Log

Git Commits -> Revision c30d657

Revision c30d657 by Lukas Stockner (master)
December 12, 2019, 17:40 (GMT)
Add support for tiled images and the UDIM naming scheme

This patch contains the work that I did during my week at the Code Quest - adding support for tiled images to Blender.

With this patch, images now contain a list of tiles. By default, this just contains one tile, but if the source type is set to Tiled, the user can add additional tiles. When acquiring an ImBuf, the tile to be loaded is specified in the ImageUser.
Therefore, code that is not yet aware of tiles will just access the default tile as usual.

The filenames of the additional tiles are derived from the original filename according to the UDIM naming scheme - the filename contains an index that is calculated as (1001 + 10*<y coordinate of the tile> + <x coordinate of the tile>), where the x coordinate never goes above 9.
Internally, the various tiles are stored in a cache just like sequences. When acquired for the first time, the code will try to load the corresponding file from disk. Alternatively, a new operator can be used to initialize the tile similar to the New Image operator.

The following features are supported so far:
- Automatic detection and loading of all tiles when opening the first tile (1001)
- Saving all tiles
- Adding and removing tiles
- Filling tiles with generated images
- Drawing all tiles in the Image Editor
- Viewing a tiled grid even if no image is selected
- Rendering tiled images in Eevee
- Rendering tiled images in Cycles (in SVM mode)
- Automatically skipping loading of unused tiles in Cycles
- 2D texture painting (also across tiles)
- 3D texture painting (also across tiles, only limitation: individual faces can not cross tile borders)
- Assigning custom labels to individual tiles (drawn in the Image Editor instead of the ID)
- Different resolutions between tiles

There still are some missing features that will be added later (see T72390):
- Workbench engine support
- Packing/Unpacking support
- Baking support
- Cycles OSL support
- many other Blender features that rely on images

Thanks to Brecht for the review and to all who tested the intermediate versions!

Differential Revision: https://developer.blender.org/D3509

Commit Details:

Full Hash: c30d6571bb47734e0bcb2fced5cf11cb6d8b1169
Parent Commit: d7a8a60
Lines Changed: +2785, -819

68 Modified Paths:

/intern/cycles/blender/blender_session.cpp (+6, -4) (Diff)
/intern/cycles/blender/blender_session.h (+2, -0) (Diff)
/intern/cycles/blender/blender_shader.cpp (+6, -0) (Diff)
/intern/cycles/blender/blender_sync.cpp (+3, -0) (Diff)
/intern/cycles/blender/blender_util.h (+13, -6) (Diff)
/intern/cycles/kernel/svm/svm.h (+1, -1) (Diff)
/intern/cycles/kernel/svm/svm_image.h (+51, -2) (Diff)
/intern/cycles/render/image.cpp (+2, -0) (Diff)
/intern/cycles/render/image.h (+2, -0) (Diff)
/intern/cycles/render/light.cpp (+2, -1) (Diff)
/intern/cycles/render/mesh.cpp (+45, -2) (Diff)
/intern/cycles/render/mesh.h (+3, -0) (Diff)
/intern/cycles/render/nodes.cpp (+199, -89) (Diff)
/intern/cycles/render/nodes.h (+11, -7) (Diff)
/intern/cycles/render/osl.cpp (+5, -10) (Diff)
/intern/cycles/render/osl.h (+3, -5) (Diff)
/intern/cycles/render/scene.h (+3, -0) (Diff)
/intern/cycles/render/svm.cpp (+6, -12) (Diff)
/intern/cycles/render/svm.h (+4, -9) (Diff)
/intern/cycles/test/render_graph_finalize_test.cpp (+2, -1) (Diff)
/release/scripts/startup/bl_ui/space_image.py (+63, -0) (Diff)
/source/blender/blenfont/BLF_api.h (+2, -0) (Diff)
/source/blender/blenfont/intern/blf.c (+13, -0) (Diff)
/source/blender/blenkernel/BKE_image.h (+33, -3) (Diff)
/source/blender/blenkernel/intern/bpath.c (+2, -1) (Diff)
/source/blender/blenkernel/intern/image.c (+439, -127) (Diff)
/source/blender/blenkernel/intern/image_save.c (+53, -1) (Diff)
/source/blender/blenkernel/intern/packedFile.c (+2, -2) (Diff)
/source/blender/blenlib/BLI_math_vector.h (+2, -0) (Diff)
/source/blender/blenlib/intern/math_vector_inline.c (+5, -0) (Diff)
/source/blender/blenloader/intern/readfile.c (+26, -12) (Diff)
/source/blender/blenloader/intern/versioning_280.c (+39, -0) (Diff)
/source/blender/blenloader/intern/writefile.c (+2, -0) (Diff)
/source/blender/compositor/operations/COM_ViewerOperation.cpp (+2, -1) (Diff)
/source/blender/draw/intern/draw_manager_data.c (+10, -1) (Diff)
/source/blender/editors/include/ED_image.h (+1, -1) (Diff)
/source/blender/editors/include/ED_paint.h (+16, -4) (Diff)
/source/blender/editors/include/ED_screen.h (+1, -1) (Diff)
/source/blender/editors/interface/interface_ops.c (+2, -2) (Diff)
/source/blender/editors/object/object_bake_api.c (+6, -3) (Diff)
/source/blender/editors/render/render_preview.c (+9, -3) (Diff)
/source/blender/editors/screen/area.c (+4, -4) (Diff)
/source/blender/editors/sculpt_paint/paint_image.c (+13, -8) (Diff)
/source/blender/editors/sculpt_paint/paint_image_2d.c (+450, -272) (Diff)
/source/blender/editors/sculpt_paint/paint_image_proj.c (+94, -24) (Diff)
/source/blender/editors/sculpt_paint/paint_intern.h (+2, -0) (Diff)
/source/blender/editors/space_clip/clip_draw.c (+2, -2) (Diff)
/source/blender/editors/space_image/image_draw.c (+159, -2) (Diff)
/source/blender/editors/space_image/image_edit.c (+6, -3) (Diff)
/source/blender/editors/space_image/image_intern.h (+4, -0) (Diff)
/source/blender/editors/space_image/image_ops.c (+414, -45) (Diff)
/source/blender/editors/space_image/image_undo.c (+52, -30) (Diff)
/source/blender/editors/space_image/space_image.c (+9, -1) (Diff)
/source/blender/gpu/GPU_material.h (+1, -1) (Diff)
/source/blender/gpu/intern/gpu_codegen.c (+12, -8) (Diff)
/source/blender/gpu/intern/gpu_codegen.h (+2, -0) (Diff)
/source/blender/gpu/intern/gpu_draw.c (+44, -23) (Diff)
/source/blender/gpu/shaders/material/gpu_shader_material_tex_image.glsl (+65, -0) (Diff)
/source/blender/imbuf/IMB_moviecache.h (+1, -0) (Diff)
/source/blender/imbuf/intern/moviecache.c (+8, -0) (Diff)
/source/blender/makesdna/DNA_image_types.h (+23, -5) (Diff)
/source/blender/makesdna/DNA_space_types.h (+2, -0) (Diff)
/source/blender/makesrna/intern/rna_image.c (+187, -1) (Diff)
/source/blender/makesrna/intern/rna_image_api.c (+13, -8) (Diff)
/source/blender/makesrna/intern/rna_main_api.c (+14, -3) (Diff)
/source/blender/makesrna/intern/rna_space.c (+12, -2) (Diff)
/source/blender/nodes/shader/nodes/node_shader_tex_environment.c (+9, -5) (Diff)
/source/blender/nodes/shader/nodes/node_shader_tex_image.c (+86, -61) (Diff)
By: Miika HämäläinenLast update: Nov-07-2014 14:18MiikaHweb | 2003-2021