Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDalai Felinto <dfelinto@gmail.com>2019-11-07 18:31:33 +0300
committerDalai Felinto <dfelinto@gmail.com>2019-11-08 07:31:01 +0300
commita7fcd78d2d690f0fa57cc65d04ee20d9d26b08e4 (patch)
tree8be8bae245abdf96638eeaacecbea12c9df1e841 /release
parent3ecb1056c9d8b83d2c025411c4f443b840902d66 (diff)
User Preference Experimental Tab
Experimental tab in User Preferences for experimental features. The tab option is only visible when "Developer Extras" is on. Included here is a (commented out) example panel to be used as a template for the new experimental panels. Since these panels will come and go it is nice to have a reference in the code. Differential Revision: https://developer.blender.org/D6203
Diffstat (limited to 'release')
-rw-r--r--release/scripts/startup/bl_ui/space_userpref.py62
1 files changed, 62 insertions, 0 deletions
diff --git a/release/scripts/startup/bl_ui/space_userpref.py b/release/scripts/startup/bl_ui/space_userpref.py
index cf4326ed764..1b40885ff9e 100644
--- a/release/scripts/startup/bl_ui/space_userpref.py
+++ b/release/scripts/startup/bl_ui/space_userpref.py
@@ -2132,6 +2132,66 @@ class USERPREF_PT_studiolight_light_editor(Panel):
layout.prop(system, "light_ambient")
+class ExperimentalPanel:
+ bl_space_type = 'PREFERENCES'
+ bl_region_type = 'WINDOW'
+
+ @classmethod
+ def poll(cls, context):
+ prefs = context.preferences
+ return (prefs.active_section == 'EXPERIMENTAL')
+
+ def draw(self, context):
+ layout = self.layout
+
+ layout.use_property_split = True
+ layout.use_property_decorate = False
+
+ self.draw_props(context, layout)
+
+
+class USERPREF_PT_experimental_all(ExperimentalPanel, Panel):
+ bl_label = "All"
+ bl_options = {'HIDE_HEADER'}
+
+ def draw_props(self, context, layout):
+ prefs = context.preferences
+ experimental = prefs.experimental
+
+ col = layout.column()
+ col.prop(experimental, "use_experimental_all")
+
+ # For the other settings create new panels
+ # and make sure they are disabled if use_experimental_all is True
+
+
+"""
+Example panel, leave it here so we always have a template to follow even
+after the features are gone from the experimental panel.
+
+class USERPREF_PT_experimental_virtual_reality(ExperimentalPanel, Panel):
+ bl_label = "Virtual Reality"
+
+ def draw_props(self, context, _layout):
+ prefs = context.preferences
+ experimental = prefs.experimental
+ _layout.active = not experimental.use_experimental_all
+
+ row = _layout.row()
+ split = row.split().column()
+ split.prop(experimental, "use_virtual_reality_scene_inspection, text="Scene Inspection")
+ split.prop(experimental, "use_virtual_reality_immersive_drawing", text="Continuous Immersive Drawing")
+
+ split = row.split().column()
+ split.operator(
+ "wm.url_open", text="https://developer.blender.org/T71347", icon='URL',
+ ).url = "https://developer.blender.org/T71347"
+ split.operator(
+ "wm.url_open", text="https://developer.blender.org/T71348", icon='URL',
+ ).url = "https://developer.blender.org/T71348"
+"""
+
+
# Order of registration defines order in UI,
# so dynamically generated classes are 'injected' in the intended order.
classes = (
@@ -2214,6 +2274,8 @@ classes = (
USERPREF_PT_studiolight_matcaps,
USERPREF_PT_studiolight_world,
+ USERPREF_PT_experimental_all,
+
# Add dynamically generated editor theme panels last,
# so they show up last in the theme section.
*ThemeGenericClassGenerator.generate_panel_classes_from_theme_areas(),