Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <campbell@blender.org>2022-05-17 04:38:05 +0300
committerCampbell Barton <campbell@blender.org>2022-05-17 05:54:05 +0300
commit5c9ab3e003d2cdca46c078c33c946ec1d7ab7626 (patch)
treef800b2631405fa6164cd86c78bbffaa9e29afd23 /source/blender/io
parent77ddcc471721194531834786c010b9e603cb18d8 (diff)
Cleanup: use term 'filepath' for full file paths
Diffstat (limited to 'source/blender/io')
-rw-r--r--source/blender/io/usd/intern/usd_capi_export.cc12
-rw-r--r--source/blender/io/usd/intern/usd_capi_import.cc20
-rw-r--r--source/blender/io/usd/usd.h2
3 files changed, 17 insertions, 17 deletions
diff --git a/source/blender/io/usd/intern/usd_capi_export.cc b/source/blender/io/usd/intern/usd_capi_export.cc
index c52d791f3b3..2049c631671 100644
--- a/source/blender/io/usd/intern/usd_capi_export.cc
+++ b/source/blender/io/usd/intern/usd_capi_export.cc
@@ -38,7 +38,7 @@ struct ExportJobData {
Depsgraph *depsgraph;
wmWindowManager *wm;
- char filename[FILE_MAX];
+ char filepath[FILE_MAX];
USDExportParams params;
bool export_ok;
@@ -74,13 +74,13 @@ static void export_startjob(void *customdata,
/* For restoring the current frame after exporting animation is done. */
const int orig_frame = CFRA;
- pxr::UsdStageRefPtr usd_stage = pxr::UsdStage::CreateNew(data->filename);
+ pxr::UsdStageRefPtr usd_stage = pxr::UsdStage::CreateNew(data->filepath);
if (!usd_stage) {
/* This happens when the USD JSON files cannot be found. When that happens,
* the USD library doesn't know it has the functionality to write USDA and
* USDC files, and creating a new UsdStage fails. */
WM_reportf(
- RPT_ERROR, "USD Export: unable to find suitable USD plugin to write %s", data->filename);
+ RPT_ERROR, "USD Export: unable to find suitable USD plugin to write %s", data->filepath);
return;
}
@@ -145,8 +145,8 @@ static void export_endjob(void *customdata)
DEG_graph_free(data->depsgraph);
- if (!data->export_ok && BLI_exists(data->filename)) {
- BLI_delete(data->filename, false, false);
+ if (!data->export_ok && BLI_exists(data->filepath)) {
+ BLI_delete(data->filepath, false, false);
}
G.is_rendering = false;
@@ -171,7 +171,7 @@ bool USD_export(bContext *C,
job->bmain = CTX_data_main(C);
job->wm = CTX_wm_manager(C);
job->export_ok = false;
- BLI_strncpy(job->filename, filepath, sizeof(job->filename));
+ BLI_strncpy(job->filepath, filepath, sizeof(job->filepath));
job->depsgraph = DEG_graph_new(job->bmain, scene, view_layer, params->evaluation_mode);
job->params = *params;
diff --git a/source/blender/io/usd/intern/usd_capi_import.cc b/source/blender/io/usd/intern/usd_capi_import.cc
index 58cd7d5014e..29b256125f0 100644
--- a/source/blender/io/usd/intern/usd_capi_import.cc
+++ b/source/blender/io/usd/intern/usd_capi_import.cc
@@ -119,7 +119,7 @@ struct ImportJobData {
ViewLayer *view_layer;
wmWindowManager *wm;
- char filename[1024];
+ char filepath[1024];
USDImportParams params;
ImportSettings settings;
@@ -150,7 +150,7 @@ static void import_startjob(void *customdata, short *stop, short *do_update, flo
if (data->params.create_collection) {
char display_name[1024];
BLI_path_to_display_name(
- display_name, strlen(data->filename), BLI_path_basename(data->filename));
+ display_name, strlen(data->filepath), BLI_path_basename(data->filepath));
Collection *import_collection = BKE_collection_add(
data->bmain, data->scene->master_collection, display_name);
id_fake_user_set(&import_collection->id);
@@ -164,10 +164,10 @@ static void import_startjob(void *customdata, short *stop, short *do_update, flo
data->view_layer, import_collection);
}
- BLI_path_abs(data->filename, BKE_main_blendfile_path_from_global());
+ BLI_path_abs(data->filepath, BKE_main_blendfile_path_from_global());
CacheFile *cache_file = static_cast<CacheFile *>(
- BKE_cachefile_add(data->bmain, BLI_path_basename(data->filename)));
+ BKE_cachefile_add(data->bmain, BLI_path_basename(data->filepath)));
/* Decrement the ID ref-count because it is going to be incremented for each
* modifier and constraint that it will be attached to, so since currently
@@ -176,7 +176,7 @@ static void import_startjob(void *customdata, short *stop, short *do_update, flo
cache_file->is_sequence = data->params.is_sequence;
cache_file->scale = data->params.scale;
- STRNCPY(cache_file->filepath, data->filename);
+ STRNCPY(cache_file->filepath, data->filepath);
data->settings.cache_file = cache_file;
@@ -191,10 +191,10 @@ static void import_startjob(void *customdata, short *stop, short *do_update, flo
*data->do_update = true;
*data->progress = 0.1f;
- pxr::UsdStageRefPtr stage = pxr::UsdStage::Open(data->filename);
+ pxr::UsdStageRefPtr stage = pxr::UsdStage::Open(data->filepath);
if (!stage) {
- WM_reportf(RPT_ERROR, "USD Import: unable to open stage to read %s", data->filename);
+ WM_reportf(RPT_ERROR, "USD Import: unable to open stage to read %s", data->filepath);
data->import_ok = false;
return;
}
@@ -356,7 +356,7 @@ bool USD_import(struct bContext *C,
job->view_layer = CTX_data_view_layer(C);
job->wm = CTX_wm_manager(C);
job->import_ok = false;
- BLI_strncpy(job->filename, filepath, 1024);
+ BLI_strncpy(job->filepath, filepath, 1024);
job->settings.scale = params->scale;
job->settings.sequence_offset = params->offset;
@@ -499,13 +499,13 @@ void USD_CacheReader_free(CacheReader *reader)
}
CacheArchiveHandle *USD_create_handle(struct Main * /*bmain*/,
- const char *filename,
+ const char *filepath,
ListBase *object_paths)
{
/* Must call this so that USD file format plugins are loaded. */
ensure_usd_plugin_path_registered();
- pxr::UsdStageRefPtr stage = pxr::UsdStage::Open(filename);
+ pxr::UsdStageRefPtr stage = pxr::UsdStage::Open(filepath);
if (!stage) {
return nullptr;
diff --git a/source/blender/io/usd/usd.h b/source/blender/io/usd/usd.h
index deaa27a5252..2e4dcb0da94 100644
--- a/source/blender/io/usd/usd.h
+++ b/source/blender/io/usd/usd.h
@@ -83,7 +83,7 @@ int USD_get_version(void);
/* USD Import and Mesh Cache interface. */
struct CacheArchiveHandle *USD_create_handle(struct Main *bmain,
- const char *filename,
+ const char *filepath,
struct ListBase *object_paths);
void USD_free_handle(struct CacheArchiveHandle *handle);