Changeset View
Changeset View
Standalone View
Standalone View
source/blender/blenkernel/intern/image.cc
| Show First 20 Lines • Show All 3,404 Lines • ▼ Show 20 Lines | if (BKE_image_is_filename_tokenized(filename)) { | ||||
| return; | return; | ||||
| } | } | ||||
| std::string path(filename); | std::string path(filename); | ||||
| std::smatch match; | std::smatch match; | ||||
| /* General 4-digit "udim" pattern. As this format is susceptible to ambiguity | /* General 4-digit "udim" pattern. As this format is susceptible to ambiguity | ||||
| * with other digit sequences, we can leverage the supported range of roughly | * with other digit sequences, we can leverage the supported range of roughly | ||||
| * 1000 through 2000 to provide better detection. | * 1000 through 2000 to provide better detection. */ | ||||
| */ | std::regex pattern(R"((.*[._-])([12]\d{3})([._-].*))"); | ||||
| std::regex pattern(R"((^|.*?\D)([12]\d{3})(\D.*))"); | |||||
| if (std::regex_search(path, match, pattern)) { | if (std::regex_search(path, match, pattern)) { | ||||
| BLI_strncpy(filename, match.format("$1<UDIM>$3").c_str(), FILE_MAX); | BLI_strncpy(filename, match.format("$1<UDIM>$3").c_str(), FILE_MAX); | ||||
| return; | return; | ||||
| } | } | ||||
| /* General `u##_v###` `uvtile` pattern. */ | /* General `u##_v###` `uvtile` pattern. */ | ||||
| pattern = std::regex(R"((.*)(u\d{1,2}_v\d{1,3})(\D.*))"); | pattern = std::regex(R"((.*)(u\d{1,2}_v\d{1,3})(\D.*))"); | ||||
| if (std::regex_search(path, match, pattern)) { | if (std::regex_search(path, match, pattern)) { | ||||
| ▲ Show 20 Lines • Show All 2,111 Lines • Show Last 20 Lines | |||||