[Bf-blender-cvs] [745a795e46e] temp-sybren-usd-patch-02: USD: mark the exporter as Experimental feature

Sybren A. Stüvel noreply at git.blender.org
Thu Dec 12 12:38:32 CET 2019


Commit: 745a795e46e510fd69aea3eae85991dee8b1f768
Author: Sybren A. Stüvel
Date:   Thu Dec 12 12:35:30 2019 +0100
Branches: temp-sybren-usd-patch-02
https://developer.blender.org/rB745a795e46e510fd69aea3eae85991dee8b1f768

USD: mark the exporter as Experimental feature

This will allow us to merge the USD exporter into master before it's
completely finished.

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

M	release/scripts/startup/bl_ui/space_topbar.py
M	release/scripts/startup/bl_ui/space_userpref.py
M	source/blender/makesdna/DNA_userdef_types.h
M	source/blender/makesrna/intern/rna_userdef.c

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

diff --git a/release/scripts/startup/bl_ui/space_topbar.py b/release/scripts/startup/bl_ui/space_topbar.py
index 025718d3219..65ad33a07d9 100644
--- a/release/scripts/startup/bl_ui/space_topbar.py
+++ b/release/scripts/startup/bl_ui/space_topbar.py
@@ -395,12 +395,12 @@ class TOPBAR_MT_file_export(Menu):
     bl_idname = "TOPBAR_MT_file_export"
     bl_label = "Export"
 
-    def draw(self, _context):
+    def draw(self, context):
         if bpy.app.build_options.collada:
             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:
+        if bpy.app.build_options.usd and context.preferences.experimental.use_usd_exporter:
             self.layout.operator("wm.usd_export", text="Universal Scene Description (.usd, .usdc, .usda)")
 
 
diff --git a/release/scripts/startup/bl_ui/space_userpref.py b/release/scripts/startup/bl_ui/space_userpref.py
index 7c6a7ecbcee..b7c2a2bae12 100644
--- a/release/scripts/startup/bl_ui/space_userpref.py
+++ b/release/scripts/startup/bl_ui/space_userpref.py
@@ -2194,6 +2194,20 @@ class USERPREF_PT_experimental_virtual_reality(ExperimentalPanel, Panel):
 """
 
 
+class USERPREF_PT_experimental_usd(ExperimentalPanel, Panel):
+    bl_label = "Universal Scene Description"
+
+    def draw_props(self, context, layout):
+        prefs = context.preferences
+
+        split = layout.split(factor=0.66)
+        col = split.split()
+        col.prop(prefs.experimental, "use_usd_exporter", text="USD Exporter")
+        col = split.split()
+        # TODO(Sybren): before merging to master, create the feedback thread and update this link.
+        col.operator("wm.url_open", text='Give Feedback', icon='URL').url = "https://devtalk.blender.org/usd-feedback-thread"
+
+
 # Order of registration defines order in UI,
 # so dynamically generated classes are 'injected' in the intended order.
 classes = (
@@ -2277,6 +2291,7 @@ classes = (
     USERPREF_PT_studiolight_world,
 
     USERPREF_PT_experimental_all,
+    USERPREF_PT_experimental_usd,
 
     # Add dynamically generated editor theme panels last,
     # so they show up last in the theme section.
diff --git a/source/blender/makesdna/DNA_userdef_types.h b/source/blender/makesdna/DNA_userdef_types.h
index 11a0e441392..e5ce0ce8bd6 100644
--- a/source/blender/makesdna/DNA_userdef_types.h
+++ b/source/blender/makesdna/DNA_userdef_types.h
@@ -908,6 +908,7 @@ typedef enum eUserPref_SpaceData_Flag {
 /** #UserDef_Experimental.flag. */
 typedef enum eUserPref_Experimental_Flag {
   USER_EXPERIMENTAL_ALL = (1 << 0),
+  USER_EXPERIMENTAL_USD_EXPORT = (1 << 1),
 } eUserPref_Experimental_Flag;
 
 /** #UserDef.flag */
diff --git a/source/blender/makesrna/intern/rna_userdef.c b/source/blender/makesrna/intern/rna_userdef.c
index 5d2bf161020..52f83216dc9 100644
--- a/source/blender/makesrna/intern/rna_userdef.c
+++ b/source/blender/makesrna/intern/rna_userdef.c
@@ -5846,6 +5846,10 @@ static void rna_def_userdef_experimental(BlenderRNA *brna)
                            "All Experimental Features",
                            "Expose all the experimental features in the user interface");
   RNA_def_property_update(prop, 0, "rna_userdef_update");
+
+  prop = RNA_def_property(srna, "use_usd_exporter", PROP_BOOLEAN, PROP_NONE);
+  RNA_def_property_boolean_sdna(prop, NULL, "flag", USER_EXPERIMENTAL_ALL);
+  RNA_def_property_ui_text(prop, "USD Exporter", "Enable the USD exporter in the user interface");
 }
 
 static void rna_def_userdef_addon_collection(BlenderRNA *brna, PropertyRNA *cprop)



More information about the Bf-blender-cvs mailing list