diff options
Diffstat (limited to 'intern/cycles/blender/addon/properties.py')
-rw-r--r-- | intern/cycles/blender/addon/properties.py | 53 |
1 files changed, 32 insertions, 21 deletions
diff --git a/intern/cycles/blender/addon/properties.py b/intern/cycles/blender/addon/properties.py index 45d25720aff..054fd900419 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"), @@ -143,7 +144,7 @@ enum_texture_limit = ( ('8192', "8192", "Limit texture size to 8192 pixels", 7), ) -enum_view3d_shading_render_pass= ( +enum_view3d_shading_render_pass = ( ('', "General", ""), ('COMBINED', "Combined", "Show the Combined Render pass", 1), @@ -184,15 +185,18 @@ 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 [] + def enum_optix_denoiser(self, context): if not context or bool(context.preferences.addons[__package__].preferences.get_devices_for_type('OPTIX')): return [('OPTIX', "OptiX", "Use the OptiX AI denoiser with GPU acceleration, only available on NVIDIA GPUs", 2)] return [] + def enum_preview_denoiser(self, context): optix_items = enum_optix_denoiser(self, context) oidn_items = enum_openimagedenoise_denoiser(self, context) @@ -206,12 +210,14 @@ def enum_preview_denoiser(self, context): items += oidn_items return items + def enum_denoiser(self, context): items = [('NLM', "NLM", "Cycles native non-local means denoiser, running on any compute device", 1)] items += enum_optix_denoiser(self, context) items += enum_openimagedenoise_denoiser(self, context) return items + enum_denoising_input_passes = ( ('RGB', "Color", "Use only color as input", 1), ('RGB_ALBEDO', "Color + Albedo", "Use color and albedo data as input", 2), @@ -413,18 +419,18 @@ class CyclesRenderSettings(bpy.types.PropertyGroup): ) min_light_bounces: IntProperty( - name="Min Light Bounces", - description="Minimum number of light bounces. Setting this higher reduces noise in the first bounces, " - "but can also be less efficient for more complex geometry like hair and volumes", - min=0, max=1024, - default=0, + name="Min Light Bounces", + description="Minimum number of light bounces. Setting this higher reduces noise in the first bounces, " + "but can also be less efficient for more complex geometry like hair and volumes", + min=0, max=1024, + default=0, ) min_transparent_bounces: IntProperty( - name="Min Transparent Bounces", - description="Minimum number of transparent bounces. Setting this higher reduces noise in the first bounces, " - "but can also be less efficient for more complex geometry like hair and volumes", - min=0, max=1024, - default=0, + name="Min Transparent Bounces", + description="Minimum number of transparent bounces. Setting this higher reduces noise in the first bounces, " + "but can also be less efficient for more complex geometry like hair and volumes", + min=0, max=1024, + default=0, ) caustics_reflective: BoolProperty( @@ -1325,6 +1331,7 @@ class CyclesAOVPass(bpy.types.PropertyGroup): default="" ) + class CyclesRenderLayerSettings(bpy.types.PropertyGroup): pass_debug_bvh_traversed_nodes: BoolProperty( @@ -1468,31 +1475,31 @@ class CyclesRenderLayerSettings(bpy.types.PropertyGroup): description="Render cryptomatte object pass, for isolating objects in compositing", default=False, update=update_render_passes, - ) + ) use_pass_crypto_material: BoolProperty( name="Cryptomatte Material", description="Render cryptomatte material pass, for isolating materials in compositing", default=False, update=update_render_passes, - ) + ) use_pass_crypto_asset: BoolProperty( name="Cryptomatte Asset", description="Render cryptomatte asset pass, for isolating groups of objects with the same parent", default=False, update=update_render_passes, - ) + ) pass_crypto_depth: IntProperty( name="Cryptomatte Levels", description="Sets how many unique objects can be distinguished per pixel", default=6, min=2, max=16, step=2, update=update_render_passes, - ) + ) pass_crypto_accurate: BoolProperty( name="Cryptomatte Accurate", description="Generate a more accurate Cryptomatte pass. CPU only, may render slower and use more memory", default=True, update=update_render_passes, - ) + ) aovs: CollectionProperty( type=CyclesAOVPass, @@ -1594,15 +1601,20 @@ 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 # For backwards compatibility, only returns CUDA and OpenCL but still # refreshes all devices. def get_devices(self, compute_device_type=''): + import _cycles + # Ensure `self.devices` is not re-allocated when the second call to + # get_devices_for_type is made, freeing items from the first list. + for device_type in ('CUDA', 'OPTIX', 'OPENCL'): + self.update_device_entries(_cycles.available_devices(device_type)) + cuda_devices = self.get_devices_for_type('CUDA') - self.get_devices_for_type('OPTIX') opencl_devices = self.get_devices_for_type('OPENCL') return cuda_devices, opencl_devices @@ -1644,7 +1656,6 @@ class CyclesPreferences(bpy.types.AddonPreferences): col.label(text="OptiX support is experimental", icon='INFO') col.label(text="Not all Cycles features are supported yet", icon='BLANK1') - def draw_impl(self, layout, context): row = layout.row() row.prop(self, "compute_device_type", expand=True) |