Fix T50628: gray out cycles device menu when no device configured only for GPU Compute.
This commit is contained in:
parent
76015f98ae
commit
68ca973f7f
Notes:
blender-bot
2023-02-14 07:14:13 +01:00
Referenced by issue #50628, Blender 2.78b Cycles compute device selection UI issue
|
@ -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):
|
||||
|
|
Loading…
Reference in New Issue