Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender-addons.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2011-03-04 07:39:13 +0300
committerCampbell Barton <ideasman42@gmail.com>2011-03-04 07:39:13 +0300
commit6e152ce9e0eef551d30bf77bcea2f16593148e18 (patch)
treefc003ea93b18c92f04e86cb9a35e7697974bd2ce /render_povray
parent2b6daa8b06b5bb49b9dab6963606f90867c1ad54 (diff)
pep8 edits for povray, also dont use string addition for textblock contents, write newlines separate.
Diffstat (limited to 'render_povray')
-rw-r--r--render_povray/__init__.py19
-rw-r--r--render_povray/render.py16
-rw-r--r--render_povray/ui.py17
3 files changed, 23 insertions, 29 deletions
diff --git a/render_povray/__init__.py b/render_povray/__init__.py
index b2010524..72846fb4 100644
--- a/render_povray/__init__.py
+++ b/render_povray/__init__.py
@@ -45,7 +45,6 @@ else:
from render_povray import ui
-
def register():
bpy.utils.register_module(__name__)
@@ -252,7 +251,6 @@ def register():
#############################MATERIAL######################################
-
Mat.pov_irid_enable = BoolProperty(
name="Enable Iridescence",
description="Newton's thin film interference (like an oil slick on a puddle of water or the rainbow hues of a soap bubble.)",
@@ -339,28 +337,27 @@ def register():
default="1")
##################################CustomPOV Code############################
Mat.pov_replacement_text = StringProperty(
- name = "Declared name:",
+ name="Declared name:",
description="Type the declared name in custom POV code or an external .inc it points at. texture {} expected",
default="")
- #Only DUMMIES below for now:
+ #Only DUMMIES below for now:
Tex.pov_replacement_text = StringProperty(
- name = "Declared name:",
+ name="Declared name:",
description="Type the declared name in custom POV code or an external .inc it points at. pigment {} expected",
default="")
Obj.pov_replacement_text = StringProperty(
- name = "Declared name:",
+ name="Declared name:",
description="Type the declared name in custom POV code or an external .inc it points at. Any POV shape expected e.g: isosurface {}",
default="")
Cam.pov_replacement_text = StringProperty(
- name = "Texts in blend file",
+ name="Texts in blend file",
description="Type the declared name in custom POV code or an external .inc it points at. camera {} expected",
default="")
##############################TEXTURE######################################
-
#Custom texture gamma
Tex.pov_tex_gamma_enable = BoolProperty(
name="Enable custom texture gamma",
@@ -374,7 +371,6 @@ def register():
#################################OBJECT####################################
-
#Importance sampling
Obj.pov_importance_value = FloatProperty(
name="Radiosity Importance",
@@ -424,7 +420,6 @@ def register():
###################################TEXT####################################
-
Text.pov_custom_code = BoolProperty(
name="Custom Code",
description="Add this text at the top of the exported POV-Ray file",
@@ -514,7 +509,7 @@ def unregister():
del Cam.pov_dof_variance # MR
del Cam.pov_dof_confidence # MR
del Cam.pov_replacement_text # MR
- del Text.pov_custom_code #MR
-
+ del Text.pov_custom_code # MR
+
if __name__ == "__main__":
register()
diff --git a/render_povray/render.py b/render_povray/render.py
index f0eb3bf9..9e6176d7 100644
--- a/render_povray/render.py
+++ b/render_povray/render.py
@@ -198,6 +198,7 @@ def safety(name, Level):
tabLevel = 0
+
def write_pov(filename, scene=None, info_callback=None):
import mathutils
#file = filename
@@ -957,7 +958,7 @@ def write_pov(filename, scene=None, info_callback=None):
t_alpha = t
##############################################################################################################
-
+
if material.pov_replacement_text != "":
file.write("\n")
file.write(" texture{%s}\n" % material.pov_replacement_text)
@@ -1465,12 +1466,13 @@ def write_pov(filename, scene=None, info_callback=None):
tabWrite("}\n")
def exportCustomCode():
-
- for Text in bpy.data.texts:
- if Text.pov_custom_code:
- file.write("\n" + Text.as_string())
- file.write("\n")
+ for txt in bpy.data.texts:
+ if txt.pov_custom_code:
+ # Why are the newlines needed?
+ file.write("\n")
+ file.write(txt.as_string())
+ file.write("\n")
sel = scene.objects
comments = scene.pov_comments_enable
@@ -1481,7 +1483,7 @@ def write_pov(filename, scene=None, info_callback=None):
if not scene.pov_tempfiles_enable and comments:
file.write("\n//--CUSTOM CODE--\n\n")
exportCustomCode()
-
+
if not scene.pov_tempfiles_enable and comments:
file.write("\n//--Global settings and background--\n\n")
diff --git a/render_povray/ui.py b/render_povray/ui.py
index 65b7e885..7619d2b2 100644
--- a/render_povray/ui.py
+++ b/render_povray/ui.py
@@ -508,7 +508,7 @@ class MATERIAL_PT_povray_caustics(MaterialButtonsPanel, bpy.types.Panel):
class MATERIAL_PT_povray_replacement_text(MaterialButtonsPanel, bpy.types.Panel):
bl_label = "Custom POV Code"
- COMPAT_ENGINES = {'POVRAY_RENDER'}
+ COMPAT_ENGINES = {'POVRAY_RENDER'}
def draw(self, context):
layout = self.layout
@@ -540,7 +540,7 @@ class TEXTURE_PT_povray_tex_gamma(TextureButtonsPanel, bpy.types.Panel):
class TEXTURE_PT_povray_replacement_text(TextureButtonsPanel, bpy.types.Panel):
bl_label = "Custom POV Code"
- COMPAT_ENGINES = {'POVRAY_RENDER'}
+ COMPAT_ENGINES = {'POVRAY_RENDER'}
def draw(self, context):
layout = self.layout
@@ -569,9 +569,10 @@ class OBJECT_PT_povray_obj_importance(ObjectButtonsPanel, bpy.types.Panel):
col.label(text="Photons:")
col.prop(obj, "pov_collect_photons", text="Receive Photon Caustics")
+
class OBJECT_PT_povray_replacement_text(ObjectButtonsPanel, bpy.types.Panel):
bl_label = "Custom POV Code"
- COMPAT_ENGINES = {'POVRAY_RENDER'}
+ COMPAT_ENGINES = {'POVRAY_RENDER'}
def draw(self, context):
layout = self.layout
@@ -602,7 +603,7 @@ class CAMERA_PT_povray_cam_dof(CameraDataButtonsPanel, bpy.types.Panel):
layout.prop(cam, "pov_dof_aperture")
split = layout.split()
-
+
col = split.column()
col.prop(cam, "pov_dof_samples_min")
col.prop(cam, "pov_dof_variance")
@@ -614,7 +615,7 @@ class CAMERA_PT_povray_cam_dof(CameraDataButtonsPanel, bpy.types.Panel):
class CAMERA_PT_povray_replacement_text(CameraDataButtonsPanel, bpy.types.Panel):
bl_label = "Custom POV Code"
- COMPAT_ENGINES = {'POVRAY_RENDER'}
+ COMPAT_ENGINES = {'POVRAY_RENDER'}
def draw(self, context):
layout = self.layout
@@ -628,7 +629,7 @@ class CAMERA_PT_povray_replacement_text(CameraDataButtonsPanel, bpy.types.Panel)
class TEXT_PT_povray_custom_code(TextButtonsPanel, bpy.types.Panel):
bl_label = "P.O.V-Ray"
- COMPAT_ENGINES = {'POVRAY_RENDER'}
+ COMPAT_ENGINES = {'POVRAY_RENDER'}
def draw(self, context):
layout = self.layout
@@ -636,7 +637,3 @@ class TEXT_PT_povray_custom_code(TextButtonsPanel, bpy.types.Panel):
text = context.space_data.text
if text:
layout.prop(text, "pov_custom_code", text="Add as POV code")
-
-
-
-