Cleanup: replace filename with filepath for full paths
This commit is contained in:
@@ -6256,7 +6256,7 @@ static int texture_paint_image_from_view_exec(bContext *C, wmOperator *op)
|
||||
using namespace blender;
|
||||
Image *image;
|
||||
ImBuf *ibuf;
|
||||
char filename[FILE_MAX];
|
||||
char filepath[FILE_MAX];
|
||||
|
||||
Main *bmain = CTX_data_main(C);
|
||||
Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C);
|
||||
@@ -6280,7 +6280,7 @@ static int texture_paint_image_from_view_exec(bContext *C, wmOperator *op)
|
||||
}
|
||||
RegionView3D *rv3d = static_cast<RegionView3D *>(region->regiondata);
|
||||
|
||||
RNA_string_get(op->ptr, "filepath", filename);
|
||||
RNA_string_get(op->ptr, "filepath", filepath);
|
||||
|
||||
maxsize = GPU_max_texture_size();
|
||||
|
||||
@@ -6324,7 +6324,7 @@ static int texture_paint_image_from_view_exec(bContext *C, wmOperator *op)
|
||||
return OPERATOR_CANCELLED;
|
||||
}
|
||||
|
||||
STRNCPY(ibuf->filepath, filename);
|
||||
STRNCPY(ibuf->filepath, filepath);
|
||||
|
||||
image = BKE_image_add_from_imbuf(bmain, ibuf, "image_view");
|
||||
|
||||
|
||||
@@ -213,7 +213,7 @@ static bool thumbhash_from_path(const char * /*path*/, ThumbSource source, char
|
||||
}
|
||||
}
|
||||
|
||||
static bool uri_from_filename(const char *path, char *uri)
|
||||
static bool uri_from_filepath(const char *path, char *uri)
|
||||
{
|
||||
char orig_uri[URI_MAX];
|
||||
|
||||
@@ -488,7 +488,7 @@ ImBuf *IMB_thumb_create(const char *filepath, ThumbSize size, ThumbSource source
|
||||
char uri[URI_MAX] = "";
|
||||
char thumb_name[40];
|
||||
|
||||
if (!uri_from_filename(filepath, uri)) {
|
||||
if (!uri_from_filepath(filepath, uri)) {
|
||||
return nullptr;
|
||||
}
|
||||
thumbname_from_uri(uri, thumb_name, sizeof(thumb_name));
|
||||
@@ -503,7 +503,7 @@ ImBuf *IMB_thumb_read(const char *file_or_lib_path, ThumbSize size)
|
||||
char uri[URI_MAX];
|
||||
ImBuf *img = nullptr;
|
||||
|
||||
if (!uri_from_filename(file_or_lib_path, uri)) {
|
||||
if (!uri_from_filepath(file_or_lib_path, uri)) {
|
||||
return nullptr;
|
||||
}
|
||||
if (thumbpath_from_uri(uri, thumb, sizeof(thumb), size)) {
|
||||
@@ -518,7 +518,7 @@ void IMB_thumb_delete(const char *file_or_lib_path, ThumbSize size)
|
||||
char thumb[FILE_MAX];
|
||||
char uri[URI_MAX];
|
||||
|
||||
if (!uri_from_filename(file_or_lib_path, uri)) {
|
||||
if (!uri_from_filepath(file_or_lib_path, uri)) {
|
||||
return;
|
||||
}
|
||||
if (thumbpath_from_uri(uri, thumb, sizeof(thumb), size)) {
|
||||
@@ -556,7 +556,7 @@ ImBuf *IMB_thumb_manage(const char *file_or_lib_path, ThumbSize size, ThumbSourc
|
||||
return nullptr;
|
||||
}
|
||||
char uri[URI_MAX];
|
||||
if (!uri_from_filename(file_or_lib_path, uri)) {
|
||||
if (!uri_from_filepath(file_or_lib_path, uri)) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user