[Bf-extensions-cvs] [35b730be] master: POV: added doc strings

Maurice Raybaud noreply at git.blender.org
Fri Dec 20 15:54:38 CET 2019


Commit: 35b730be8aa92bb1b0cd1e356c3955a9fb24bc1d
Author: Maurice Raybaud
Date:   Sun Dec 8 21:41:58 2019 +0100
Branches: master
https://developer.blender.org/rBA35b730be8aa92bb1b0cd1e356c3955a9fb24bc1d

POV: added doc strings

Hoping it will help the code to be less repulsive to new developers.

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

M	render_povray/__init__.py

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

diff --git a/render_povray/__init__.py b/render_povray/__init__.py
index 66d42104..a8a5c951 100644
--- a/render_povray/__init__.py
+++ b/render_povray/__init__.py
@@ -136,7 +136,9 @@ else:
 
 
 def string_strip_hyphen(name):
+
     """Remove hyphen characters from a string to avoid POV errors."""
+
     return name.replace("-", "")
 
 
@@ -166,6 +168,7 @@ def active_texture_name_from_search(self, context):
 # Scene POV properties.
 ###############################################################################
 class RenderPovSettingsScene(PropertyGroup):
+
     """Declare scene level properties controllable in UI and translated to POV."""
 
     # Linux SDL-window enable
@@ -184,19 +187,19 @@ class RenderPovSettingsScene(PropertyGroup):
     tempfiles_enable: BoolProperty(
         name="Enable Tempfiles",
         description="Enable the OS-Tempfiles. Otherwise set the path where"
-                    " to save the files",
+        " to save the files",
         default=True,
     )
     pov_editor: BoolProperty(
         name="POV editor",
         description="Don't Close POV editor after rendering (Overridden"
-                    " by /EXIT command)",
+        " by /EXIT command)",
         default=False,
     )
     deletefiles_enable: BoolProperty(
         name="Delete files",
         description="Delete files after rendering. "
-                    "Doesn't work with the image",
+        "Doesn't work with the image",
         default=True,
     )
     scene_name: StringProperty(
@@ -382,7 +385,8 @@ class RenderPovSettingsScene(PropertyGroup):
         items=(
             ('NONE', "None", "No indentation"),
             ('TAB', "Tabs", "Indentation with tabs"),
-            ('SPACE', "Spaces", "Indentation with spaces")),
+            ('SPACE', "Spaces", "Indentation with spaces")
+        ),
         default='SPACE'
     )
 
@@ -433,13 +437,18 @@ class RenderPovSettingsScene(PropertyGroup):
         description="how surely the computed color "
         "of a given pixel is indeed"
         "within the threshold error margin",
-        min=0.0001, max=1.0000, default=0.9900, precision=4
+        min=0.0001,
+        max=1.0000,
+        default=0.9900,
+        precision=4
     )
 
     antialias_depth: IntProperty(
         name="Antialias Depth",
         description="Depth of pixel for sampling",
-        min=1, max=9, default=3
+        min=1,
+        max=9,
+        default=3
     )
 
     antialias_threshold: FloatProperty(
@@ -506,7 +515,9 @@ class RenderPovSettingsScene(PropertyGroup):
         name="Max Trace Level",
         description="Number of reflections/refractions allowed on ray "
         "path",
-        min=1, max=256, default=5
+        min=1,
+        max=256,
+        default=5
     )
 
     adc_bailout_enable: BoolProperty(
@@ -518,12 +529,12 @@ class RenderPovSettingsScene(PropertyGroup):
     adc_bailout: FloatProperty(
         name="ADC Bailout",
         description="Adaptive Depth Control (ADC) to stop computing additional"
-        "reflected or refracted rays when their contribution is insignificant."
-        "The default value is 1/255, or approximately 0.0039, since a change "
-        "smaller than that could not be visible in a 24 bit image. Generally "
-        "this value is fine and should be left alone."
-        "Setting adc_bailout to 0 will disable ADC, relying completely on "
-        "max_trace_level to set an upper limit on the number of rays spawned. ",
+            "reflected or refracted rays when their contribution is insignificant."
+            "The default value is 1/255, or approximately 0.0039, since a change "
+            "smaller than that could not be visible in a 24 bit image. Generally "
+            "this value is fine and should be left alone."
+            "Setting adc_bailout to 0 will disable ADC, relying completely on "
+            "max_trace_level to set an upper limit on the number of rays spawned. ",
         min=0.0,
         max=1000.0,
         default=0.00392156862745,
@@ -560,8 +571,13 @@ class RenderPovSettingsScene(PropertyGroup):
             "Iridescence calculations depend upon the dominant "
             "wavelengths of the primary colors of red, green and blue light"
         ),
-        precision=4, step=0.01, min=0, soft_max=1,
-        default=(0.25,0.18,0.14), options={'ANIMATABLE'}, subtype='COLOR'
+        precision=4,
+        step=0.01,
+        min=0,
+        soft_max=1,
+        default=(0.25,0.18,0.14),
+        options={'ANIMATABLE'},
+        subtype='COLOR'
     )
 
     charset: EnumProperty(
@@ -649,7 +665,7 @@ class RenderPovSettingsScene(PropertyGroup):
         max=1.000,
         soft_min=0.001,
         soft_max=1.000,
-        precision=3
+        precision=3,
         default=0.005,
     )
 
@@ -1033,17 +1049,19 @@ class MaterialTextureSlot(PropertyGroup):
     texture_coords: EnumProperty(
         name="",
         description="",
-        items=(("GLOBAL", "Global", ""),
-               ("OBJECT", "Object", ""),
-               ("UV", "UV", ""),
-               ("ORCO", "Original Coordinates", ""),
-               ("STRAND", "Strand", ""),
-               ("STICKY", "Sticky", ""),
-               ("WINDOW", "Window", ""),
-               ("NORMAL", "Normal", ""),
-               ("REFLECTION", "Reflection", ""),
-               ("STRESS", "Stress", ""),
-               ("TANGENT", "Tangent", "")),
+        items=(
+            ("GLOBAL", "Global", ""),
+            ("OBJECT", "Object", ""),
+            ("UV", "UV", ""),
+            ("ORCO", "Original Coordinates", ""),
+            ("STRAND", "Strand", ""),
+            ("STICKY", "Sticky", ""),
+            ("WINDOW", "Window", ""),
+            ("NORMAL", "Normal", ""),
+            ("REFLECTION", "Reflection", ""),
+            ("STRESS", "Stress", ""),
+            ("TANGENT", "Tangent", "")
+        ),
         default="GLOBAL",
     )
 
@@ -1241,13 +1259,15 @@ class MaterialTextureSlot(PropertyGroup):
     texture_coords: EnumProperty(
         name="Coordinates",
         description="Texture coordinates used to map the texture onto the background",
-        items=(("VIEW", "View", "Use view vector for the texture coordinates"),
-               ("GLOBAL", "Global", "Use global coordinates for the texture coordinates (interior mist)"),
-               ("ANGMAP", "AngMap", "Use 360 degree angular coordinates, e.g. for spherical light probes"),
-               ("SPHERE", "Sphere", "For 360 degree panorama sky, spherical mapped, only top half"),
-               ("EQUIRECT", "Equirectangular", "For 360 degree panorama sky, equirectangular mapping"),
-               ("TUBE", "Tube", "For 360 degree panorama sky, cylindrical mapped, only top half"),
-               ("OBJECT", "Object", "Use linked object’s coordinates for texture coordinates")),
+        items=(
+            ("VIEW", "View", "Use view vector for the texture coordinates"),
+            ("GLOBAL", "Global", "Use global coordinates for the texture coordinates (interior mist)"),
+            ("ANGMAP", "AngMap", "Use 360 degree angular coordinates, e.g. for spherical light probes"),
+            ("SPHERE", "Sphere", "For 360 degree panorama sky, spherical mapped, only top half"),
+            ("EQUIRECT", "Equirectangular", "For 360 degree panorama sky, equirectangular mapping"),
+            ("TUBE", "Tube", "For 360 degree panorama sky, cylindrical mapped, only top half"),
+            ("OBJECT", "Object", "Use linked object’s coordinates for texture coordinates")
+        ),
         default="VIEW",
     )
 
@@ -1297,12 +1317,14 @@ bpy.types.ID.use_limited_texture_context = BoolProperty(
 bpy.types.ID.texture_context = EnumProperty(
     name="Texture context",
     description="Type of texture data to display and edit",
-    items=(('MATERIAL', "", "Show material textures", "MATERIAL",0), # "Show material textures"
-           ('WORLD', "", "Show world textures", "WORLD",1), # "Show world textures"
-           ('LIGHT', "", "Show lamp textures", "LIGHT",2), # "Show lamp textures"
-           ('PARTICLES', "", "Show particles textures", "PARTICLES",3), # "Show particles textures"
-           ('LINESTYLE', "", "Show linestyle textures", "LINE_DATA",4), # "Show linestyle textures"
-           ('OTHER', "", "Show other data textures", "TEXTURE_DATA",5)), # "Show other data textures"
+    items=(
+        ('MATERIAL', "", "Show material textures", "MATERIAL",0), # "Show material textures"
+        ('WORLD', "", "Show world textures", "WORLD",1), # "Show world textures"
+        ('LIGHT', "", "Show lamp textures", "LIGHT",2), # "Show lamp textures"
+        ('PARTICLES', "", "Show particles textures", "PARTICLES",3), # "Show particles textures"
+        ('LINESTYLE', "", "Show linestyle textures", "LINE_DATA",4), # "Show linestyle textures"
+        ('OTHER', "", "Show other data textures", "TEXTURE_DATA",5) # "Show other data textures"
+    ),
     default = 'MATERIAL',
 )
 
@@ -1324,12 +1346,14 @@ class RenderPovSettingsMaterial(PropertyGroup):
     texture_context: EnumProperty(
         name="Texture context",
         description="Type of texture data to display and edit",
-        items=(('MATERIAL', "", "Show material textures", "MATERIAL",0), # "Show material textures"
-               ('WORLD', "", "Show world textures", "WORLD",1), # "Show world textures"
-               ('LAMP', "", "Show lamp textures", "LIGHT",2), # "Show lamp textures"
-               ('PARTICLES', "", "Show particles textures", "PARTICLES",3), # "Show particles textures"
-               ('LINESTYLE', "", "Show linestyle textures", "LINE_DATA",4), # "Show linestyle textures"
-               ('OTHER', "", "Show other data textures", "TEXTURE_DATA",5)), # "Show other data textures"
+        items=(
+            ('MATERIAL', "", "Show material textures", "MATERIAL",0), # "Show material textures"
+            ('WORLD', "", "Show world textures", "WORLD",1), # "Show world textures"
+            ('LAMP', "", "Show lamp textures", "LIGHT",2), # "Show lamp textures"
+            ('PARTICLES', "", "Show particles textures", "PARTICLES",3), # "Show particles textures"
+            ('LINESTYLE', "", "Show linestyle textures", "LINE_DATA"

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-extensions-cvs mailing list