Commit: b198730a81a5904663a04df2a10b6a4d4a8e1d48
Author: Sybren A. Stüvel
Date: Wed Oct 2 16:56:22 2019 +0200
Branches: sybren-usd
https://developer.blender.org/rBb198730a81a5904663a04df2a10b6a4d4a8e1d48
Cleanup: remove scene parameter from USD_export()
The Context is passed to USD_export() anyway, which already contains the
scene.
===================================================================
M source/blender/editors/io/io_usd.c
M source/blender/usd/intern/usd_capi.cc
M source/blender/usd/usd.h
===================================================================
diff --git a/source/blender/editors/io/io_usd.c
b/source/blender/editors/io/io_usd.c
index 8d788b52e07..a8b3aab884f 100644
--- a/source/blender/editors/io/io_usd.c
+++ b/source/blender/editors/io/io_usd.c
@@ -97,9 +97,6 @@ static int wm_usd_export_exec(bContext *C, wmOperator *op)
char filename[FILE_MAX];
RNA_string_get(op->ptr, "filepath", filename);
- /* Take some defaults from the scene, if not specified explicitly. */
- Scene *scene = CTX_data_scene(C);
-
const bool as_background_job = RNA_boolean_get(op->ptr, "as_background_job");
const bool selected_objects_only = RNA_boolean_get(op->ptr,
"selected_objects_only");
const bool visible_objects_only = RNA_boolean_get(op->ptr,
"visible_objects_only");
@@ -123,7 +120,7 @@ static int wm_usd_export_exec(bContext *C, wmOperator *op)
evaluation_mode,
};
- bool ok = USD_export(scene, C, filename, ¶ms, as_background_job);
+ bool ok = USD_export(C, filename, ¶ms, as_background_job);
return as_background_job || ok ? OPERATOR_FINISHED : OPERATOR_CANCELLED;
}
diff --git a/source/blender/usd/intern/usd_capi.cc
b/source/blender/usd/intern/usd_capi.cc
index ef5c56e95b8..e0c2f45c6b5 100644
--- a/source/blender/usd/intern/usd_capi.cc
+++ b/source/blender/usd/intern/usd_capi.cc
@@ -181,12 +181,14 @@ static void export_endjob(void *customdata)
BKE_spacedata_draw_locks(false);
}
-bool USD_export(Scene *scene,
- bContext *C,
+bool USD_export(bContext *C,
const char *filepath,
- const struct USDExportParams *params,
+ const USDExportParams *params,
bool as_background_job)
{
+ ViewLayer *view_layer = CTX_data_view_layer(C);
+ Scene *scene = CTX_data_scene(C);
+
ExportJobData *job = static_cast<ExportJobData *>(
MEM_mallocN(sizeof(ExportJobData), "ExportJobData"));
@@ -194,7 +196,6 @@ bool USD_export(Scene *scene,
job->export_ok = false;
BLI_strncpy(job->filename, filepath, 1024);
- ViewLayer *view_layer = CTX_data_view_layer(C);
job->depsgraph = DEG_graph_new(job->bmain, scene, view_layer,
params->evaluation_mode);
job->params = *params;
diff --git a/source/blender/usd/usd.h b/source/blender/usd/usd.h
index 74dd01245d1..569c038b9e7 100644
--- a/source/blender/usd/usd.h
+++ b/source/blender/usd/usd.h
@@ -51,8 +51,7 @@ struct USDExportParams {
* true when the export was ok, and false if there were any errors.
*/
-bool USD_export(struct Scene *scene,
- struct bContext *C,
+bool USD_export(struct bContext *C,
const char *filepath,
const struct USDExportParams *params,
bool as_background_job);
_______________________________________________
Bf-blender-cvs mailing list
[email protected]
https://lists.blender.org/mailman/listinfo/bf-blender-cvs