[Bf-blender-cvs] [4217d6fd542] sybren-usd: USD: added USD export to the File > Export menu

Sybren A. Stüvel noreply at git.blender.org
Tue Jul 16 11:52:33 CEST 2019


Commit: 4217d6fd5421834b95b574d4bbba203a365ae4f7
Author: Sybren A. Stüvel
Date:   Fri Jul 12 15:59:35 2019 +0200
Branches: sybren-usd
https://developer.blender.org/rB4217d6fd5421834b95b574d4bbba203a365ae4f7

USD: added USD export to the File > Export menu

This also required exposing the build option `bpy.app.build_options.usd`.

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

M	release/scripts/startup/bl_ui/space_topbar.py
M	source/blender/python/intern/CMakeLists.txt
M	source/blender/python/intern/bpy_app_build_options.c

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

diff --git a/release/scripts/startup/bl_ui/space_topbar.py b/release/scripts/startup/bl_ui/space_topbar.py
index 382e421eecd..8195d580c46 100644
--- a/release/scripts/startup/bl_ui/space_topbar.py
+++ b/release/scripts/startup/bl_ui/space_topbar.py
@@ -405,6 +405,8 @@ class TOPBAR_MT_file_export(Menu):
             self.layout.operator("wm.collada_export", text="Collada (Default) (.dae)")
         if bpy.app.build_options.alembic:
             self.layout.operator("wm.alembic_export", text="Alembic (.abc)")
+        if bpy.app.build_options.usd:
+            self.layout.operator("wm.usd_export", text="Universal Scene Description (.usdc, .usda)")
 
 
 class TOPBAR_MT_file_external_data(Menu):
diff --git a/source/blender/python/intern/CMakeLists.txt b/source/blender/python/intern/CMakeLists.txt
index fc945562c98..4a80d7569a8 100644
--- a/source/blender/python/intern/CMakeLists.txt
+++ b/source/blender/python/intern/CMakeLists.txt
@@ -295,6 +295,10 @@ if(WITH_ALEMBIC)
   )
 endif()
 
+if(WITH_USD)
+  add_definitions(-DWITH_USD)
+endif()
+
 if(WITH_OPENIMAGEIO)
   add_definitions(-DWITH_OPENIMAGEIO)
   list(APPEND INC
diff --git a/source/blender/python/intern/bpy_app_build_options.c b/source/blender/python/intern/bpy_app_build_options.c
index a841e974e85..2e87b215e9d 100644
--- a/source/blender/python/intern/bpy_app_build_options.c
+++ b/source/blender/python/intern/bpy_app_build_options.c
@@ -59,6 +59,7 @@ static PyStructSequence_Field app_builtopts_info_fields[] = {
     {(char *)"openmp", NULL},
     {(char *)"openvdb", NULL},
     {(char *)"alembic", NULL},
+    {(char *)"usd", NULL},
     {NULL},
 };
 
@@ -268,6 +269,12 @@ static PyObject *make_builtopts_info(void)
   SetObjIncref(Py_False);
 #endif
 
+#ifdef WITH_USD
+  SetObjIncref(Py_True);
+#else
+  SetObjIncref(Py_False);
+#endif
+
 #undef SetObjIncref
 
   return builtopts_info;



More information about the Bf-blender-cvs mailing list