Changeset View
Changeset View
Standalone View
Standalone View
intern/cycles/blender/addon/ui.py
| Show First 20 Lines • Show All 47 Lines • ▼ Show 20 Lines | class CyclesButtonsPanel: | ||||
| COMPAT_ENGINES = {'CYCLES'} | COMPAT_ENGINES = {'CYCLES'} | ||||
| @classmethod | @classmethod | ||||
| def poll(cls, context): | def poll(cls, context): | ||||
| rd = context.scene.render | rd = context.scene.render | ||||
| return rd.engine in cls.COMPAT_ENGINES | return rd.engine in cls.COMPAT_ENGINES | ||||
| def get_device_type(context): | |||||
| return context.user_preferences.addons[__package__].preferences.compute_device_type | |||||
| def use_cpu(context): | def use_cpu(context): | ||||
| prefs = context.user_preferences.addons[__package__].preferences | |||||
| cscene = context.scene.cycles | cscene = context.scene.cycles | ||||
| return (get_device_type(context) == 'NONE' or cscene.device == 'CPU') | return (prefs.compute_device_type == 'NONE' or cscene.device == 'CPU') | ||||
| def use_opencl(context): | |||||
| cscene = context.scene.cycles | |||||
| return (get_device_type(context) == 'OPENCL' and cscene.device == 'GPU') | |||||
| def use_cuda(context): | |||||
| cscene = context.scene.cycles | |||||
| return (get_device_type(context) == 'CUDA' and cscene.device == 'GPU') | |||||
| def use_branched_path(context): | def use_branched_path(context): | ||||
| cscene = context.scene.cycles | cscene = context.scene.cycles | ||||
| return (cscene.progressive == 'BRANCHED_PATH') | return (cscene.progressive == 'BRANCHED_PATH') | ||||
| ▲ Show 20 Lines • Show All 1,790 Lines • Show Last 20 Lines | |||||