[Bf-blender-cvs] [5c9875f668d] temp-usd-prev-export2: USD Preview Surface export UI improvements.

Michael Kowalski noreply at git.blender.org
Tue Dec 28 06:13:51 CET 2021


Commit: 5c9875f668d2c1eacca537b279e5cd73ac981bb4
Author: Michael Kowalski
Date:   Sun Dec 26 14:20:09 2021 -0500
Branches: temp-usd-prev-export2
https://developer.blender.org/rB5c9875f668d2c1eacca537b279e5cd73ac981bb4

USD Preview Surface export UI improvements.

Updates based on suggestions by Hans Goudey in his
review.

Made variables const.

Now calling uiLayoutSetActive() instead of uiLayoutSetEnabled().

Shortened the 'USD Preview Surface From Nodes' property name
and improved property descriptions.

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

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 b084dc6b601..7b9484a4e5f 100644
--- a/source/blender/editors/io/io_usd.c
+++ b/source/blender/editors/io/io_usd.c
@@ -184,23 +184,22 @@ static void wm_usd_export_draw(bContext *UNUSED(C), wmOperator *op)
   box = uiLayoutBox(layout);
   col = uiLayoutColumnWithHeading(box, true, IFACE_("Materials"));
   uiItemR(col, ptr, "generate_preview_surface", 0, NULL, ICON_NONE);
-  bool export_mtl = RNA_boolean_get(ptr, "export_materials");
-
-  uiLayoutSetEnabled(col, export_mtl);
+  const bool export_mtl = RNA_boolean_get(ptr, "export_materials");
+  uiLayoutSetActive(col, export_mtl);
 
   uiLayout *row = uiLayoutRow(col, true);
   uiItemR(row, ptr, "export_textures", 0, NULL, ICON_NONE);
-  bool preview = RNA_boolean_get(ptr, "generate_preview_surface");
-  uiLayoutSetEnabled(row, export_mtl && preview);
+  const bool preview = RNA_boolean_get(ptr, "generate_preview_surface");
+  uiLayoutSetActive(row, export_mtl && preview);
 
   row = uiLayoutRow(col, true);
   uiItemR(row, ptr, "overwrite_textures", 0, NULL, ICON_NONE);
-  bool export_tex = RNA_boolean_get(ptr, "export_textures");
-  uiLayoutSetEnabled(row, export_mtl && preview && export_tex);
+  const bool export_tex = RNA_boolean_get(ptr, "export_textures");
+  uiLayoutSetActive(row, export_mtl && preview && export_tex);
 
   row = uiLayoutRow(col, true);
   uiItemR(row, ptr, "relative_texture_paths", 0, NULL, ICON_NONE);
-  uiLayoutSetEnabled(row, export_mtl && preview);
+  uiLayoutSetActive(row, export_mtl && preview);
 
   box = uiLayoutBox(layout);
   uiItemL(box, IFACE_("Experimental"), ICON_NONE);
@@ -283,16 +282,16 @@ void WM_OT_usd_export(struct wmOperatorType *ot)
   RNA_def_boolean(ot->srna,
                   "generate_preview_surface",
                   true,
-                  "USD Preview Surface From Nodes",
+                  "To USD Preview Surface",
                   "Generate an approximate USD Preview Surface shader "
-                  "representation of a Principled BSDF node network ");
+                  "representation of a Principled BSDF node network");
 
   RNA_def_boolean(ot->srna,
                   "export_textures",
                   true,
                   "Export Textures",
                   "If exporting materials, export textures referenced by material nodes "
-                  "to a 'textures' directory in the same directory as the USD");
+                  "to a 'textures' directory in the same directory as the USD file");
 
   RNA_def_boolean(ot->srna,
                   "overwrite_textures",
@@ -305,7 +304,7 @@ void WM_OT_usd_export(struct wmOperatorType *ot)
       "relative_texture_paths",
       true,
       "Relative Texture Paths",
-      "When checked, material texture asset paths will be saved as relative paths in the USD");
+      "Make texture asset paths relative to the USD file");
 }
 
 /* ====== USD Import ====== */



More information about the Bf-blender-cvs mailing list