Page MenuHome

Fix T73110: UDIM Texture Paint Crash

Authored by Philipp Oeser (lichtwerk) on Tue, Jan 14, 11:29 AM.



This would happen if a tile is found on disk, painting would actually
request that tile (because corresponding uvs were in that range), but
that tile was not added in blenders list of tiles in that Image.

Propose to be a bit more strict in image_quick_test to avoid problems

Diff Detail

rB Blender

Event Timeline

LGTM, but I am not up to speed with all the details, so best that @Lukas Stockner (lukasstockner97) will check

Lukas Stockner (lukasstockner97) requested changes to this revision.Thu, Jan 16, 2:45 AM

Generally the fix is the correct one - the underlying problem was the *else* if (tile == NULL) {, of course tile should be checked regardless of whether iuser is passed.

However, there is no need to check for ima->source == IMA_SRC_TILED - if the image is not tiled and tile 1001 gets loaded, BKE_image_get_tile_from_iuser will return a valid entry (each image has at least one tile), and if the tile to be loaded is not 1001 then tile will be NULL and the function will return false as it should (after the else if fix).
Since the tile->ok check replaces the old ima->ok, it should be done regardless of source.

Additionally, the crash in image_initialize_after_load if a file that has no corresponding tile is loaded should probably be prevented.

I've uploaded a tweaked version of this patch in P1216.

This revision now requires changes to proceed.Thu, Jan 16, 2:45 AM
This revision was not accepted when it landed; it landed in state Needs Review.Tue, Jan 21, 10:59 AM
This revision was automatically updated to reflect the committed changes.