diff options
author | Campbell Barton <ideasman42@gmail.com> | 2020-10-15 08:25:26 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2020-10-15 08:25:26 +0300 |
commit | c0dde8be8438ebc35fe5d4498e903bdbdb34a9a8 (patch) | |
tree | c8ba0e0a2963d75ab96c99956f3e6f71c10ebb5c /intern/cycles/blender/addon/properties.py | |
parent | aca8640b12b6a17f67560a14c6d97c6b80c7301b (diff) |
Cleanup: defer importing '_cycles' in properties.py
This was imported already in nearly all usage.
Also use static-set for string comparison.
Diffstat (limited to 'intern/cycles/blender/addon/properties.py')
-rw-r--r-- | intern/cycles/blender/addon/properties.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/intern/cycles/blender/addon/properties.py b/intern/cycles/blender/addon/properties.py index d29f709263e..3eeaece7c36 100644 --- a/intern/cycles/blender/addon/properties.py +++ b/intern/cycles/blender/addon/properties.py @@ -31,7 +31,6 @@ from math import pi # enums -import _cycles from . import engine enum_devices = ( @@ -39,8 +38,10 @@ enum_devices = ( ('GPU', "GPU Compute", "Use GPU compute device for rendering, configured in the system tab in the user preferences"), ) -if _cycles.with_network: +from _cycles import with_network +if with_network: enum_devices += (('NETWORK', "Networked Device", "Use networked device for rendering"),) +del with_network enum_feature_set = ( ('SUPPORTED', "Supported", "Only use finished and supported features"), @@ -184,6 +185,7 @@ enum_aov_types = ( def enum_openimagedenoise_denoiser(self, context): + import _cycles if _cycles.with_openimagedenoise: return [('OPENIMAGEDENOISE', "OpenImageDenoise", "Use Intel OpenImageDenoise AI denoiser running on the CPU", 4)] return [] @@ -1599,7 +1601,7 @@ class CyclesPreferences(bpy.types.AddonPreferences): elif entry.type == 'CPU': cpu_devices.append(entry) # Extend all GPU devices with CPU. - if compute_device_type in ('CUDA', 'OPENCL'): + if compute_device_type in {'CUDA', 'OPENCL'}: devices.extend(cpu_devices) return devices |