[Bf-blender-cvs] [268cdb503fc] blender2.8: Cycles: use fields for property definitions

Campbell Barton noreply at git.blender.org
Tue Aug 28 05:10:55 CEST 2018


Commit: 268cdb503fc6a4ac0437222cf84aae789fec89c8
Author: Campbell Barton
Date:   Tue Aug 28 13:16:04 2018 +1000
Branches: blender2.8
https://developer.blender.org/rB268cdb503fc6a4ac0437222cf84aae789fec89c8

Cycles: use fields for property definitions

===================================================================

M	intern/cycles/blender/addon/properties.py

===================================================================

diff --git a/intern/cycles/blender/addon/properties.py b/intern/cycles/blender/addon/properties.py
index 7f0cb7e875f..c19bde8420d 100644
--- a/intern/cycles/blender/addon/properties.py
+++ b/intern/cycles/blender/addon/properties.py
@@ -26,6 +26,8 @@ from bpy.props import (
     StringProperty,
 )
 
+from math import pi
+
 # enums
 
 import _cycles
@@ -155,575 +157,581 @@ enum_texture_limit = (
 
 
 class CyclesRenderSettings(bpy.types.PropertyGroup):
-    @classmethod
-    def register(cls):
-        bpy.types.Scene.cycles = PointerProperty(
-            name="Cycles Render Settings",
-            description="Cycles render settings",
-            type=cls,
-        )
-        cls.device = EnumProperty(
-            name="Device",
-            description="Device to use for rendering",
-            items=enum_devices,
-            default='CPU',
-        )
-        cls.feature_set = EnumProperty(
-            name="Feature Set",
-            description="Feature set to use for rendering",
-            items=enum_feature_set,
-            default='SUPPORTED',
-        )
-        cls.shading_system = BoolProperty(
-            name="Open Shading Language",
-            description="Use Open Shading Language (CPU rendering only)",
-        )
 
-        cls.progressive = EnumProperty(
-            name="Integrator",
-            description="Method to sample lights and materials",
-            items=enum_integrator,
-            default='PATH',
-        )
+    device: EnumProperty(
+        name="Device",
+        description="Device to use for rendering",
+        items=enum_devices,
+        default='CPU',
+    )
+    feature_set: EnumProperty(
+        name="Feature Set",
+        description="Feature set to use for rendering",
+        items=enum_feature_set,
+        default='SUPPORTED',
+    )
+    shading_system: BoolProperty(
+        name="Open Shading Language",
+        description="Use Open Shading Language (CPU rendering only)",
+    )
 
-        cls.use_square_samples = BoolProperty(
-            name="Square Samples",
-            description="Square sampling values for easier artist control",
-            default=False,
-        )
+    progressive: EnumProperty(
+        name="Integrator",
+        description="Method to sample lights and materials",
+        items=enum_integrator,
+        default='PATH',
+    )
 
-        cls.samples = IntProperty(
-            name="Samples",
-            description="Number of samples to render for each pixel",
-            min=1, max=2147483647,
-            default=128,
-        )
-        cls.preview_samples = IntProperty(
-            name="Preview Samples",
-            description="Number of samples to render in the viewport, unlimited if 0",
-            min=0, max=2147483647,
-            default=32,
-        )
-        cls.preview_pause = BoolProperty(
-            name="Pause Preview",
-            description="Pause all viewport preview renders",
-            default=False,
-        )
-        cls.aa_samples = IntProperty(
-            name="AA Samples",
-            description="Number of antialiasing samples to render for each pixel",
-            min=1, max=2097151,
-            default=128,
-        )
-        cls.preview_aa_samples = IntProperty(
-            name="AA Samples",
-            description="Number of antialiasing samples to render in the viewport, unlimited if 0",
-            min=0, max=2097151,
-            default=32,
-        )
-        cls.diffuse_samples = IntProperty(
-            name="Diffuse Samples",
-            description="Number of diffuse bounce samples to render for each AA sample",
-            min=1, max=1024,
-            default=1,
-        )
-        cls.glossy_samples = IntProperty(
-            name="Glossy Samples",
-            description="Number of glossy bounce samples to render for each AA sample",
-            min=1, max=1024,
-            default=1,
-        )
-        cls.transmission_samples = IntProperty(
-            name="Transmission Samples",
-            description="Number of transmission bounce samples to render for each AA sample",
-            min=1, max=1024,
-            default=1,
-        )
-        cls.ao_samples = IntProperty(
-            name="Ambient Occlusion Samples",
-            description="Number of ambient occlusion samples to render for each AA sample",
-            min=1, max=1024,
-            default=1,
-        )
-        cls.mesh_light_samples = IntProperty(
-            name="Mesh Light Samples",
-            description="Number of mesh emission light samples to render for each AA sample",
-            min=1, max=1024,
-            default=1,
-        )
+    use_square_samples: BoolProperty(
+        name="Square Samples",
+        description="Square sampling values for easier artist control",
+        default=False,
+    )
 
-        cls.subsurface_samples = IntProperty(
-            name="Subsurface Samples",
-            description="Number of subsurface scattering samples to render for each AA sample",
-            min=1, max=1024,
-            default=1,
-        )
+    samples: IntProperty(
+        name="Samples",
+        description="Number of samples to render for each pixel",
+        min=1, max=2147483647,
+        default=128,
+    )
+    preview_samples: IntProperty(
+        name="Preview Samples",
+        description="Number of samples to render in the viewport, unlimited if 0",
+        min=0, max=2147483647,
+        default=32,
+    )
+    preview_pause: BoolProperty(
+        name="Pause Preview",
+        description="Pause all viewport preview renders",
+        default=False,
+    )
+    aa_samples: IntProperty(
+        name="AA Samples",
+        description="Number of antialiasing samples to render for each pixel",
+        min=1, max=2097151,
+        default=128,
+    )
+    preview_aa_samples: IntProperty(
+        name="AA Samples",
+        description="Number of antialiasing samples to render in the viewport, unlimited if 0",
+        min=0, max=2097151,
+        default=32,
+    )
+    diffuse_samples: IntProperty(
+        name="Diffuse Samples",
+        description="Number of diffuse bounce samples to render for each AA sample",
+        min=1, max=1024,
+        default=1,
+    )
+    glossy_samples: IntProperty(
+        name="Glossy Samples",
+        description="Number of glossy bounce samples to render for each AA sample",
+        min=1, max=1024,
+        default=1,
+    )
+    transmission_samples: IntProperty(
+        name="Transmission Samples",
+        description="Number of transmission bounce samples to render for each AA sample",
+        min=1, max=1024,
+        default=1,
+    )
+    ao_samples: IntProperty(
+        name="Ambient Occlusion Samples",
+        description="Number of ambient occlusion samples to render for each AA sample",
+        min=1, max=1024,
+        default=1,
+    )
+    mesh_light_samples: IntProperty(
+        name="Mesh Light Samples",
+        description="Number of mesh emission light samples to render for each AA sample",
+        min=1, max=1024,
+        default=1,
+    )
 
-        cls.volume_samples = IntProperty(
-            name="Volume Samples",
-            description="Number of volume scattering samples to render for each AA sample",
-            min=1, max=1024,
-            default=1,
-        )
+    subsurface_samples: IntProperty(
+        name="Subsurface Samples",
+        description="Number of subsurface scattering samples to render for each AA sample",
+        min=1, max=1024,
+        default=1,
+    )
 
-        cls.sampling_pattern = EnumProperty(
-            name="Sampling Pattern",
-            description="Random sampling pattern used by the integrator",
-            items=enum_sampling_pattern,
-            default='SOBOL',
-        )
+    volume_samples: IntProperty(
+        name="Volume Samples",
+        description="Number of volume scattering samples to render for each AA sample",
+        min=1, max=1024,
+        default=1,
+    )
 
-        cls.use_layer_samples = EnumProperty(
-            name="Layer Samples",
-            description="How to use per render layer sample settings",
-            items=enum_use_layer_samples,
-            default='USE',
-        )
+    sampling_pattern: EnumProperty(
+        name="Sampling Pattern",
+        description="Random sampling pattern used by the integrator",
+        items=enum_sampling_pattern,
+        default='SOBOL',
+    )
 
-        cls.sample_all_lights_direct = BoolProperty(
-            name="Sample All Direct Lights",
-            description="Sample all lights (for direct samples), rather than randomly picking one",
-            default=True,
-        )
+    use_layer_samples: EnumProperty(
+        name="Layer Samples",
+        description="How to use per render layer sample settings",
+        items=enum_use_layer_samples,
+        default='USE',
+    )
 
-        cls.sample_all_lights_indirect = BoolProperty(
-            name="Sample All Indirect Lights",
-            description="Sample all lights (for indirect samples), rather than randomly picking one",
-            default=True,
-        )
-        cls.light_sampling_threshold = FloatProperty(
-            name="Light Sampling Threshold",
-            description="Probabilistically terminate light samples when the light contribution is below this threshold (more noise but faster rendering). "
-            "Zero disables the test and never ignores lights",
-            min=0.0, max=1.0,
-            default=0.01,
-        )
+    sample_all_lights_direct: BoolProperty(
+        name="Sample All Direct Lights",
+        description="Sample all lights (for direct samples), rather than randomly picking one",
+        default=True,
+    )
 
-        cls.caustics_reflective = BoolProperty(
-            name="Reflective Caustics",
-            description="Use reflective caustics, resulting in a brighter image (more noise but added realism)",
-            default=True,
-        )
+    sample_all_lights_indirect: BoolProperty(
+        name="Sample All Indirect Lights",
+        description="Sample all lights (for indirect samples), rather than randomly picking one",
+   

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list