[Bf-blender-cvs] [68ca973f7f8] master: Fix T50628: gray out cycles device menu when no device configured only for GPU Compute.
Brecht Van Lommel
noreply at git.blender.org
Sun Mar 12 18:03:39 CET 2017
Commit: 68ca973f7f81e551889532d0c1b76485d9f40245
Author: Brecht Van Lommel
Date: Sun Mar 12 06:45:29 2017 +0100
Branches: master
https://developer.blender.org/rB68ca973f7f81e551889532d0c1b76485d9f40245
Fix T50628: gray out cycles device menu when no device configured only for GPU Compute.
===================================================================
M intern/cycles/blender/addon/ui.py
===================================================================
diff --git a/intern/cycles/blender/addon/ui.py b/intern/cycles/blender/addon/ui.py
index 3a689913230..c9b98956c93 100644
--- a/intern/cycles/blender/addon/ui.py
+++ b/intern/cycles/blender/addon/ui.py
@@ -86,12 +86,10 @@ def use_sample_all_lights(context):
return cscene.sample_all_lights_direct or cscene.sample_all_lights_indirect
-def show_device_selection(context):
- type = get_device_type(context)
- if type == 'NETWORK':
+def show_device_active(context):
+ cscene = context.scene.cycles
+ if cscene.device != 'GPU':
return True
- if not type in {'CUDA', 'OPENCL'}:
- return False
return context.user_preferences.addons[__package__].preferences.has_active_device()
@@ -1636,7 +1634,7 @@ def draw_device(self, context):
split = layout.split(percentage=1/3)
split.label("Device:")
row = split.row()
- row.active = show_device_selection(context)
+ row.active = show_device_active(context)
row.prop(cscene, "device", text="")
if engine.with_osl() and use_cpu(context):
More information about the Bf-blender-cvs
mailing list