[Bf-extensions-cvs] [56dfa8c8] master: POV: added doc strings
Maurice Raybaud
noreply at git.blender.org
Fri Dec 20 15:54:38 CET 2019
Commit: 56dfa8c8b4395e2af66c10d43812d66ed1fb6162
Author: Maurice Raybaud
Date: Sun Dec 8 21:41:58 2019 +0100
Branches: master
https://developer.blender.org/rBA56dfa8c8b4395e2af66c10d43812d66ed1fb6162
POV: added doc strings
Hoping it will help the code to be less repulsive to new developers.
===================================================================
M render_povray/__init__.py
M render_povray/primitives.py
M render_povray/render.py
M render_povray/shading.py
M render_povray/ui.py
M render_povray/update_files.py
===================================================================
diff --git a/render_povray/__init__.py b/render_povray/__init__.py
index f343db66..66d42104 100644
--- a/render_povray/__init__.py
+++ b/render_povray/__init__.py
@@ -21,42 +21,42 @@
"""Import, export and render to POV engines.
These engines can be POV-Ray or Uberpov but others too, since POV is a
-Scene Description Language. The script has been split in as few files
+Scene Description Language. The script has been split in as few files
as possible :
___init__.py :
Initialize variables
-
+
update_files.py
- Update new variables to values from older API. This file needs an update.
-
+ Update new variables to values from older API. This file needs an update.
+
ui.py :
Provide property buttons for the user to set up the variables.
-
+
primitives.py :
Display some POV native primitives in 3D view for input and output.
shading.py
- Translate shading properties to declared textures at the top of a pov file
+ Translate shading properties to declared textures at the top of a pov file
nodes.py
Translate node trees to the pov file
-
+
df3.py
Render smoke to *.df3 files
-
+
render.py :
Translate geometry and UI properties (Blender and POV native) to the POV file
-
+
Along these essential files also coexist a few additional libraries to help make
Blender stand up to other POV IDEs such as povwin or QTPOV.
presets :
Material (sss)
- apple.py ; chicken.py ; cream.py ; Ketchup.py ; marble.py ;
+ apple.py ; chicken.py ; cream.py ; Ketchup.py ; marble.py ;
potato.py ; skim_milk.py ; skin1.py ; skin2.py ; whole_milk.py
Radiosity
- 01_Debug.py ; 02_Fast.py ; 03_Normal.py ; 04_Two_Bounces.py ;
+ 01_Debug.py ; 02_Fast.py ; 03_Normal.py ; 04_Two_Bounces.py ;
05_Final.py ; 06_Outdoor_Low_Quality.py ; 07_Outdoor_High_Quality.py ;
08_Outdoor(Sun)Light.py ; 09_Indoor_Low_Quality.py ;
10_Indoor_High_Quality.py ;
@@ -73,13 +73,13 @@ Blender stand up to other POV IDEs such as povwin or QTPOV.
10_(4300K)_40W_Vintage_Fluorescent_T12.py ;
11_(5000K)_18W_Standard_Fluorescent_T8 ;
12_(4200K)_18W_Cool_White_Fluorescent_T8.py ;
- 13_(3000K)_18W_Warm_Fluorescent_T8.py ;
+ 13_(3000K)_18W_Warm_Fluorescent_T8.py ;
14_(6500K)_54W_Grow_Light_Fluorescent_T5-HO.py ;
15_(3200K)_40W_Induction_Fluorescent.py ;
16_(2100K)_150W_High_Pressure_Sodium.py ;
17_(1700K)_135W_Low_Pressure_Sodium.py ;
18_(6800K)_175W_Mercury_Vapor.py ; 19_(5200K)_700W_Carbon_Arc.py ;
- 20_(6500K)_15W_LED_Spot.py ; 21_(2700K)_7W_OLED_Panel.py ;
+ 20_(6500K)_15W_LED_Spot.py ; 21_(2700K)_7W_OLED_Panel.py ;
22_(30000K)_40W_Black_Light_Fluorescent.py ;
23_(30000K)_40W_Black_Light_Bulb.py; 24_(1850K)_Candle.py
templates:
@@ -93,22 +93,22 @@ Blender stand up to other POV IDEs such as povwin or QTPOV.
bl_info = {
"name": "Persistence of Vision",
"author": "Campbell Barton, "
- "Maurice Raybaud, "
- "Leonid Desyatkov, "
- "Bastien Montagne, "
- "Constantin Rahn, "
- "Silvio Falcinelli",
+ "Maurice Raybaud, "
+ "Leonid Desyatkov, "
+ "Bastien Montagne, "
+ "Constantin Rahn, "
+ "Silvio Falcinelli",
"version": (0, 1, 0),
"blender": (2, 81, 0),
"location": "Render Properties > Render Engine > Persistence of Vision",
"description": "Persistence of Vision integration for blender",
- "wiki_url": "https://docs.blender.org/manual/en/dev/addons/"
- "render/povray.html",
+ "wiki_url": "https://docs.blender.org/manual/en/dev/addons/render/povray.html",
"category": "Render",
}
if "bpy" in locals():
import importlib
+
importlib.reload(ui)
importlib.reload(render)
importlib.reload(shading)
@@ -117,36 +117,30 @@ if "bpy" in locals():
else:
import bpy
from bpy.utils import register_class, unregister_class
- #import addon_utils # To use some other addons
- import nodeitems_utils #for Nodes
- from nodeitems_utils import NodeCategory, NodeItem #for Nodes
+ # import addon_utils # To use some other addons
+ import nodeitems_utils # for Nodes
+ from nodeitems_utils import NodeCategory, NodeItem # for Nodes
from bl_operators.presets import AddPresetBase
- from bpy.types import (
- AddonPreferences,
- PropertyGroup,
- #Operator,
- )
+ from bpy.types import AddonPreferences, PropertyGroup
from bpy.props import (
- StringProperty,
- BoolProperty,
- IntProperty,
- FloatProperty,
- FloatVectorProperty,
- EnumProperty,
- PointerProperty,
- CollectionProperty,
- )
- from . import (
- ui,
- render,
- update_files,
- )
+ StringProperty,
+ BoolProperty,
+ IntProperty,
+ FloatProperty,
+ FloatVectorProperty,
+ EnumProperty,
+ PointerProperty,
+ CollectionProperty,
+ )
+ from . import ui, render, update_files
+
def string_strip_hyphen(name):
"""Remove hyphen characters from a string to avoid POV errors."""
return name.replace("-", "")
-def active_texture_name_from_uilist(self,context):
+
+def active_texture_name_from_uilist(self, context):
mat = context.scene.view_layers["View Layer"].objects.active.active_material
index = mat.pov.active_texture_index
name = mat.pov_texture_slots[index].name
@@ -156,7 +150,7 @@ def active_texture_name_from_uilist(self,context):
mat.pov_texture_slots[index].name = newname
-def active_texture_name_from_search(self,context):
+def active_texture_name_from_search(self, context):
mat = context.scene.view_layers["View Layer"].objects.active.active_material
index = mat.pov.active_texture_index
name = mat.pov_texture_slots[index].texture_search
@@ -167,1373 +161,1734 @@ def active_texture_name_from_search(self,context):
except:
pass
+
###############################################################################
# Scene POV properties.
###############################################################################
class RenderPovSettingsScene(PropertyGroup):
"""Declare scene level properties controllable in UI and translated to POV."""
- #Linux SDL-window enable
+
+ # Linux SDL-window enable
sdl_window_enable: BoolProperty(
- name="Enable SDL window",
- description="Enable the SDL window in Linux OS",
- default=True)
+ name="Enable SDL window",
+ description="Enable the SDL window in Linux OS",
+ default=True,
+ )
# File Options
text_block: StringProperty(
- name="Text Scene Name",
- description="Name of POV scene to use. "
- "Set when clicking Run to render current text only",
- maxlen=1024)
+ name="Text Scene Name",
+ description="Name of POV scene to use. "
+ "Set when clicking Run to render current text only",
+ maxlen=1024,
+ )
tempfiles_enable: BoolProperty(
- name="Enable Tempfiles",
- description="Enable the OS-Tempfiles. Otherwise set the path where"
- " to save the files",
- default=True)
+ name="Enable Tempfiles",
+ description="Enable the OS-Tempfiles. Otherwise set the path where"
+ " to save the files",
+ default=True,
+ )
pov_editor: BoolProperty(
- name="POV editor",
- description="Don't Close POV editor after rendering (Overridden"
- " by /EXIT command)",
- default=False)
+ name="POV editor",
+ description="Don't Close POV editor after rendering (Overridden"
+ " by /EXIT command)",
+ default=False,
+ )
deletefiles_enable: BoolProperty(
- name="Delete files",
- description="Delete files after rendering. "
- "Doesn't work with the image",
- default=True)
+ name="Delete files",
+ description="Delete files after rendering. "
+ "Doesn't work with the image",
+ default=True,
+ )
scene_name: StringProperty(
- name="Scene Name",
- description="Name of POV scene to create. Empty name will use "
- "the name of the blend file",
- maxlen=1024)
+ name="Scene Name",
+ description="Name of POV scene to create. Empty name will use "
+ "the name of the blend file",
+ maxlen=1024,
+ )
scene_path: StringProperty(
- name="Export scene path",
- # Bug in POV-Ray RC3
- # description="Path to directory where the exported scene "
- # "(POV and INI) is created",
- description="Path to directory where the files are created",
- maxlen=1024, subtype="DIR_PATH")
+ name="Export scene path",
+ # Bug in POV-Ray RC3
+ # description="Path to directory where the exported scene "
+ # "(POV and INI) is created",
+ description="Path to directory where the files are created",
+ maxlen=1024,
+ subtype="DIR_PATH",
+ )
renderimage_path: StringProperty(
- name="Rendered image path",
- description="Full path to directory where the rendered image is "
- "saved",
- maxlen=1024, subtype="DIR_PATH")
+ name="Rendered image path",
+ description="Full path to directory where the rendered image is "
+ "saved",
+ maxlen=1024,
+ subtype="DIR_PATH",
+ )
list_lf_enable: BoolProperty(
- name="LF in lists",
- description="Enable line breaks in lists (vectors and indices). "
- "Disabled: lists are exported in one line",
-
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-extensions-cvs
mailing list