[Bf-blender-cvs] [70d9e57aced] temp-sybren-usd-patch-02: USD: Store BKE_main_blendfile_path(bmain) in a variable

Sybren A. Stüvel noreply at git.blender.org
Wed Dec 11 16:36:53 CET 2019


Commit: 70d9e57aced59f55d22e63068b5f51ac4fb096ca
Author: Sybren A. Stüvel
Date:   Wed Dec 11 12:35:16 2019 +0100
Branches: temp-sybren-usd-patch-02
https://developer.blender.org/rB70d9e57aced59f55d22e63068b5f51ac4fb096ca

USD: Store BKE_main_blendfile_path(bmain) in a variable

===================================================================

M	source/blender/editors/io/io_usd.c

===================================================================

diff --git a/source/blender/editors/io/io_usd.c b/source/blender/editors/io/io_usd.c
index b08abe016ab..e2c03b9f71a 100644
--- a/source/blender/editors/io/io_usd.c
+++ b/source/blender/editors/io/io_usd.c
@@ -72,12 +72,13 @@ static int wm_usd_export_invoke(bContext *C, wmOperator *op, const wmEvent *even
   if (!RNA_struct_property_is_set(op->ptr, "filepath")) {
     Main *bmain = CTX_data_main(C);
     char filepath[FILE_MAX];
+    const char *main_blendfile_path = BKE_main_blendfile_path(bmain);
 
-    if (BKE_main_blendfile_path(bmain)[0] == '\0') {
+    if (main_blendfile_path[0] == '\0') {
       BLI_strncpy(filepath, "untitled", sizeof(filepath));
     }
     else {
-      BLI_strncpy(filepath, BKE_main_blendfile_path(bmain), sizeof(filepath));
+      BLI_strncpy(filepath, main_blendfile_path, sizeof(filepath));
     }
 
     BLI_path_extension_replace(filepath, sizeof(filepath), ".usdc");



More information about the Bf-blender-cvs mailing list