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:
authorLukas Stockner <lukas.stockner@freenet.de>2016-11-07 04:33:53 +0300
committerSergey Sharybin <sergey.vfx@gmail.com>2017-01-20 13:25:29 +0300
commitf840239ee04354e873bb1cc6bce5675052f44cae (patch)
treebb6568b2143e783b5ed8cc39def047f7dfd5b57e /release
parentc89d8dd6cb60d9d64b11101de6015786f9dc3cf1 (diff)
Cycles: Refactor Device selection to allow individual GPU compute device selection
Previously, it was only possible to choose a single GPU or all of that type (CUDA or OpenCL). Now, a toggle button is displayed for every device. These settings are tied to the PCI Bus ID of the devices, so they're consistent across hardware addition and removal (but not when swapping/moving cards). From the code perspective, the more important change is that now, the compute device properties are stored in the Addon preferences of the Cycles addon, instead of directly in the User Preferences. This allows for a cleaner implementation, removing the Cycles C API functions that were called by the RNA code to specify the enum items. Note that this change is neither backwards- nor forwards-compatible, but since it's only a User Preference no existing files are broken. Reviewers: #cycles, brecht Reviewed By: #cycles, brecht Subscribers: brecht, juicyfruit, mib2berlin, Blendify Differential Revision: https://developer.blender.org/D2338
Diffstat (limited to 'release')
-rw-r--r--release/scripts/startup/bl_operators/wm.py29
-rw-r--r--release/scripts/startup/bl_ui/space_userpref.py7
2 files changed, 29 insertions, 7 deletions
diff --git a/release/scripts/startup/bl_operators/wm.py b/release/scripts/startup/bl_operators/wm.py
index 1c97d213e05..343fcdb0d22 100644
--- a/release/scripts/startup/bl_operators/wm.py
+++ b/release/scripts/startup/bl_operators/wm.py
@@ -2163,3 +2163,32 @@ class WM_OT_addon_expand(Operator):
info["show_expanded"] = not info["show_expanded"]
return {'FINISHED'}
+
+class WM_OT_addon_userpref_show(Operator):
+ "Show add-on user preferences"
+ bl_idname = "wm.addon_userpref_show"
+ bl_label = ""
+ bl_options = {'INTERNAL'}
+
+ module = StringProperty(
+ name="Module",
+ description="Module name of the add-on to expand",
+ )
+
+ def execute(self, context):
+ import addon_utils
+
+ module_name = self.module
+
+ modules = addon_utils.modules(refresh=False)
+ mod = addon_utils.addons_fake_modules.get(module_name)
+ if mod is not None:
+ info = addon_utils.module_bl_info(mod)
+ info["show_expanded"] = True
+
+ bpy.context.user_preferences.active_section = 'ADDONS'
+ context.window_manager.addon_filter = 'All'
+ context.window_manager.addon_search = info["name"]
+ bpy.ops.screen.userpref_show('INVOKE_DEFAULT')
+
+ return {'FINISHED'}
diff --git a/release/scripts/startup/bl_ui/space_userpref.py b/release/scripts/startup/bl_ui/space_userpref.py
index dcafac66fca..ab3ec3559e5 100644
--- a/release/scripts/startup/bl_ui/space_userpref.py
+++ b/release/scripts/startup/bl_ui/space_userpref.py
@@ -429,13 +429,6 @@ class USERPREF_PT_system(Panel):
col.separator()
- if hasattr(system, "compute_device_type"):
- col.label(text="Compute Device:")
- col.row().prop(system, "compute_device_type", expand=True)
- sub = col.row()
- sub.active = system.compute_device_type != 'CPU'
- sub.prop(system, "compute_device", text="")
-
if hasattr(system, "opensubdiv_compute_type"):
col.label(text="OpenSubdiv compute:")
col.row().prop(system, "opensubdiv_compute_type", text="")