[SCM] yafaray-exporter/master: Imported Upstream version 0.1.2~beta2.3

mfv-guest at users.alioth.debian.org mfv-guest at users.alioth.debian.org
Mon Jan 2 19:45:35 UTC 2012


The following commit has been merged in the master branch:
commit c41d28a511622eb5636fa3524a07f52cac781389
Author: Matteo F. Vescovi <mfv.debian at gmail.com>
Date:   Mon Jan 2 20:04:12 2012 +0100

    Imported Upstream version 0.1.2~beta2.3

diff --git a/README b/README
index 4c09840..7b90ccb 100644
--- a/README
+++ b/README
@@ -1,4 +1,4 @@
-Yafaray exporter for Blender 2.59:
+Yafaray exporter for Blender 2.61:
 
 The exporter is in an experimental stage, so use it for testing purposes only.
 For the latest exporter updates check:
@@ -14,7 +14,7 @@ or look into this forum post for other platform builds:
 
 http://www.yafaray.org/community/forum/viewtopic.php?f=16&t=3520
 
-Download and extract the exporter files and folders to the 'Blender/2.59/scripts/addons/yafaray' directory.
+Download and extract the exporter files and folders to the 'Blender/2.61/scripts/addons/yafaray' directory.
 
 We need to test it, please post bugreports and feature requests here:
 http://www.yafaray.org/development/bugtracker/yafaray
diff --git a/__init__.py b/__init__.py
index ab4b9b4..82115cf 100644
--- a/__init__.py
+++ b/__init__.py
@@ -16,6 +16,8 @@
 #
 # ##### END GPL LICENSE BLOCK #####
 
+# <pep8 compliant>
+
 import sys
 import os
 import ctypes
@@ -34,8 +36,8 @@ bl_info = {
               "Michele Castigliego (subcomandante), Bert Buchholz, "
               "Rodrigo Placencia (DarkTide), Alexander Smirnov (Exvion)",
     "version": (0, 1, 2, 'alpha'),
-    "blender": (2, 5, 9),
-    "api": 39324,
+    "blender": (2, 6, 1),
+    "api": 42615,
     "location": "Info Header > Engine dropdown menu",
     "warning": "both YafaRay 0.1.2 and this script are in alpha state",
     "wiki_url": "http://www.yafaray.org/community/forum",
@@ -67,12 +69,30 @@ if "bpy" in locals():
     imp.reload(ot)
 else:
     import bpy
-    from . import prop, io, ui, ot
+    from bpy.app.handlers import persistent
+    from . import prop
+    from . import io
+    from . import ui
+    from . import ot
+
+
+ at persistent
+def load_handler(dummy):
+    for tex in bpy.data.textures:
+        if tex is not None:
+            # set the correct texture type on file load....
+            # converts old files, where propertie yaf_tex_type wasn't defined
+            print("Load Handler: Convert Yafaray texture \"{0}\" with texture type: \"{1}\" to \"{2}\"".format(tex.name, tex.yaf_tex_type, tex.type))
+            tex.yaf_tex_type = tex.type
+    # convert image output file type setting from blender to yafaray's file type setting on file load, so that both are the same...
+    if bpy.context.scene.render.image_settings.file_format != bpy.context.scene.img_output:
+        bpy.context.scene.img_output = bpy.context.scene.render.image_settings.file_format
 
 
 def register():
     prop.register()
     bpy.utils.register_module(__name__)
+    bpy.app.handlers.load_post.append(load_handler)
     # register keys for 'render 3d view', 'render still' and 'render animation'
     km = bpy.context.window_manager.keyconfigs.addon.keymaps.new(name='Screen')
     kmi = km.keymap_items.new('render.render_view', 'F12', 'PRESS', False, False, False, True)
@@ -89,6 +109,7 @@ def unregister():
         or kmi.idname == 'render.render_still':
             kma.keymap_items.remove(kmi)
     bpy.utils.unregister_module(__name__)
+    bpy.app.handlers.load_post.remove(load_handler)
 
 
 if __name__ == '__main__':
diff --git a/io/__init__.py b/io/__init__.py
index cbf5cd2..2c3d19f 100644
--- a/io/__init__.py
+++ b/io/__init__.py
@@ -16,6 +16,8 @@
 #
 # ##### END GPL LICENSE BLOCK #####
 
+# <pep8 compliant>
+
 import yafrayinterface
 from . import yaf_export
 from . import yaf_world
diff --git a/io/yaf_export.py b/io/yaf_export.py
index 56ae372..2c1a795 100644
--- a/io/yaf_export.py
+++ b/io/yaf_export.py
@@ -16,14 +16,13 @@
 #
 # ##### END GPL LICENSE BLOCK #####
 
+# <pep8 compliant>
+
 #TODO: Use Blender enumerators if any
 import bpy
 import os
+import threading
 import time
-import tempfile
-import sys
-import platform
-
 import yafrayinterface
 from yafaray import PLUGIN_PATH
 from yafaray import YAF_ID_NAME
@@ -52,54 +51,65 @@ class YafaRayRenderEngine(bpy.types.RenderEngine):
         self.materials = set()
         self.yi = yi
 
-        if self.preview:
-            pass
+        if self.is_preview:
             self.yi.setVerbosityMute()
+        elif self.scene.gs_verbose:
+            self.yi.setVerbosityInfo()
         else:
-            if self.scene.gs_verbose:
-                self.yi.setVerbosityInfo()
-            else:
-                self.yi.setVerbosityMute()
+            self.yi.setVerbosityMute()
 
         self.yi.loadPlugins(PLUGIN_PATH)
         self.yaf_object = yafObject(self.yi, self.materialMap)
-        self.yaf_lamp = yafLight(self.yi, self.preview)
+        self.yaf_lamp = yafLight(self.yi, self.is_preview)
         self.yaf_world = yafWorld(self.yi)
         self.yaf_integrator = yafIntegrator(self.yi)
         self.yaf_texture = yafTexture(self.yi)
         self.yaf_material = yafMaterial(self.yi, self.materialMap, self.yaf_texture.loadedTextures)
 
     def exportScene(self):
-        self.exportTextures()
+        for obj in self.scene.objects:
+            self.exportTexture(obj)
         self.exportMaterials()
         self.yaf_object.setScene(self.scene)
         self.exportObjects()
         self.yaf_object.createCamera()
         self.yaf_world.exportWorld(self.scene)
 
-    def exportTextures(self):
-        # Textures needs to be exported first, so we handle here the textures
-        # for the 'blend' material type, check ALL objects in the scene whether
-        # they are visible or hidden for rendering.
-        for obj in self.scene.objects:
-            for mat_slot in [m for m in obj.material_slots if m.material is not None]:
-                if mat_slot.material.mat_type != 'blend':
+    def exportTexture(self, obj):
+        # First export the textures of the materials type 'blend'
+        for mat_slot in [m for m in obj.material_slots if m.material is not None]:
+            if mat_slot.material.mat_type == 'blend':
+                mat1 = bpy.data.materials[mat_slot.material.material1]
+                mat2 = bpy.data.materials[mat_slot.material.material2]
+                for bm in [mat1, mat2]:
+                    for blendtex in [bt for bt in bm.texture_slots if (bt and bt.texture and bt.use)]:
+                        if self.is_preview and blendtex.texture.name == 'fakeshadow':
+                            continue
+                        self.yaf_texture.writeTexture(self.scene, blendtex.texture)
+            else:
+                continue
+
+        for mat_slot in [m for m in obj.material_slots if m.material is not None]:
+            for tex in [t for t in mat_slot.material.texture_slots if (t and t.texture and t.use)]:
+                if self.is_preview and tex.texture.name == "fakeshadow":
                     continue
+                # stretched plane needs to be fixed for texture preview
+                if self.is_preview and obj.name == 'texture':
+                    bpy.types.YAFA_RENDER.is_texPrev = True
                 else:
-                    self.handleBlendTex(mat_slot.material)
-        # export textures from visible objects only. Won't work with
-        # blend mat, there the textures need to be handled separately (see above).
-        for obj in [o for o in self.scene.objects if (not o.hide_render and o.is_visible(self.scene))]:
-            for mat_slot in [m for m in obj.material_slots if m.material is not None]:
-                for tex in [t for t in mat_slot.material.texture_slots if (t and t.texture and t.use)]:
-                    if self.preview and tex.texture.name == "fakeshadow":
-                        continue
-                    # stretched plane needs to be fixed for tex preview
-                    if self.preview and obj.name == 'texture':
-                        bpy.types.YAFA_RENDER.is_texPrev = True
-                    else:
-                        bpy.types.YAFA_RENDER.is_texPrev = False
-                    self.yaf_texture.writeTexture(self.scene, tex.texture)
+                    bpy.types.YAFA_RENDER.is_texPrev = False
+                self.yaf_texture.writeTexture(self.scene, tex.texture)
+
+    def checkForOrco(self, obj):
+        has_orco = False
+        for mat_slot in [m for m in obj.material_slots if m.material is not None]:
+            for tex in [t for t in mat_slot.material.texture_slots if (t and t.texture and t.use)]:
+                if tex.texture_coords == 'ORCO':
+                    has_orco = True
+                    break  # break tex loop
+            if has_orco:
+                break  # break mat_slot loop
+        return has_orco
 
     def exportObjects(self):
         self.yi.printInfo("Exporter: Processing Lamps...")
@@ -120,63 +130,105 @@ class YafaRayRenderEngine(bpy.types.RenderEngine):
                 self.yaf_lamp.createLight(self.yi, obj, obj.matrix_world)
 
         self.yi.printInfo("Exporter: Processing Geometry...")
-        self.yaf_object.writeObjects()
 
-    def handleBlendTex(self, mat):
-        if mat.name == mat.material1:
-            self.yi.printError("Exporter: Blend material " + mat.name + " contains itself!")
-            return
-        if mat.name == mat.material2:
-            self.yi.printError("Exporter: Blend material " + mat.name + " contains itself!")
-            return
-        if mat.material1 == mat.material2:
-            self.yi.printError("Exporter: Blend material " + mat.material1 + " and " + mat.material2 + " are the same!")
-            return
-        if not (mat.material1 and mat.material2 in bpy.data.materials):
-            self.yi.printWarning("Exporter: Problem with blend material " + mat.name + ". Could not find one of the two blended materials.")
-            return
+        # export only visible objects
+        baseIds = {}
+        dupBaseIds = {}
 
-        mat1 = bpy.data.materials[mat.material1]
-        mat2 = bpy.data.materials[mat.material2]
+        for obj in [o for o in self.scene.objects if not o.hide_render and o.is_visible(self.scene) \
+        and (o.type in {'MESH', 'SURFACE', 'CURVE', 'FONT', 'EMPTY'})]:
+            # Exporting dupliObjects as instances: disabled exporting instances when global
+            # option "transp. shadows" is on -> crashes yafaray render engine
+            # also check for dupliObject type 'EMPTY' and don't export them as geometry
+            if obj.is_duplicator:
+                self.yi.printInfo("Processing duplis for: {0}".format(obj.name))
+                obj.dupli_list_create(self.scene)
+
+                for obj_dupli in [od for od in obj.dupli_list if not od.object.type == 'EMPTY']:
+                    has_orco = self.checkForOrco(obj_dupli.object)
+                    self.exportTexture(obj_dupli.object)
+                    for mat_slot in obj_dupli.object.material_slots:
+                        if mat_slot.material not in self.materials:
+                            self.exportMaterial(mat_slot.material)
+
+                    if self.scene.gs_transp_shad or has_orco:
+                        matrix = obj_dupli.matrix.copy()
+                        self.yaf_object.writeMesh(obj_dupli.object, matrix)
+                    else:
+                        if obj_dupli.object.name not in dupBaseIds:
+                            dupBaseIds[obj_dupli.object.name] = self.yaf_object.writeInstanceBase(obj_dupli.object)
+                        matrix = obj_dupli.matrix.copy()
+                        self.yaf_object.writeInstance(dupBaseIds[obj_dupli.object.name], matrix, obj_dupli.object.name)
+
+                if obj.dupli_list is not None:
+                    obj.dupli_list_clear()
+
+                # check if object has particle system and uses the option for 'render emitter'
+                if hasattr(obj, 'particle_systems'):
+                    for pSys in obj.particle_systems:
+                        check_rendertype = pSys.settings.render_type in {'OBJECT', 'GROUP'}
+                        if check_rendertype and pSys.settings.use_render_emitter:
+                            matrix = obj.matrix_world.copy()
+                            self.yaf_object.writeMesh(obj, matrix)
+
+            # no need to write empty object from here on, so continue with next object in loop
+            elif obj.type == 'EMPTY':
+                continue
+
+            # Exporting objects with shared mesh data blocks as instances: disabled exporting instances when global
+            # option "transparent shadows" is on -> crashes yafaray render engine
+            elif obj.data.users > 1 and not self.scene.gs_transp_shad:
+                # check materials and textures of object for 'ORCO' texture coordinates
+                # if so: do not export them as instances -> gives weird rendering results!
+                has_orco = self.checkForOrco(obj)
+
+                if has_orco:
+                    self.yaf_object.writeObject(obj)
+                else:
+                    self.yi.printInfo("Processing shared mesh data node object: {0}".format(obj.name))
+                    if obj.data.name not in baseIds:
+                        baseIds[obj.data.name] = self.yaf_object.writeInstanceBase(obj)
 
-        for m in [mat1, mat2]:
-            for tex in [t for t in m.texture_slots if (t and t.texture and t.use)]:
-                if self.preview and tex.texture.name == 'fakeshadow':
-                    continue
-                self.yaf_texture.writeTexture(self.scene, tex.texture)
+                    if obj.name not in dupBaseIds:
+                        matrix = obj.matrix_world.copy()
+                        self.yaf_object.writeInstance(baseIds[obj.data.name], matrix, obj.data.name)
+
+            else:
+                if obj.data.name not in baseIds and obj.name not in dupBaseIds:
+                    self.yaf_object.writeObject(obj)
 
     def handleBlendMat(self, mat):
         if mat.name == mat.material1:
             self.yi.printError("Exporter: Blend material " + mat.name + " contains itself!")
             return
-        if mat.name == mat.material2:
+        elif mat.name == mat.material2:
             self.yi.printError("Exporter: Blend material " + mat.name + " contains itself!")
             return
-        if mat.material1 == mat.material2:
+        elif mat.material1 == mat.material2:
             self.yi.printError("Exporter: Blend material " + mat.material1 + " and " + mat.material2 + " are the same!")
             return
-        if not (mat.material1 and mat.material2 in bpy.data.materials):
+        elif not (mat.material1 and mat.material2 in bpy.data.materials):
             self.yi.printWarning("Exporter: Problem with blend material " + mat.name + ". Could not find one of the two blended materials.")
             return
+        else:
+            mat1 = bpy.data.materials[mat.material1]
+            mat2 = bpy.data.materials[mat.material2]
 
-        mat1 = bpy.data.materials[mat.material1]
-        mat2 = bpy.data.materials[mat.material2]
-
-        if mat1.mat_type == 'blend':
-            self.handleBlendMat(mat1)
-        elif mat1 not in self.materials:
-            self.materials.add(mat1)
-            self.yaf_material.writeMaterial(mat1)
+            if mat1.mat_type == 'blend':
+                self.handleBlendMat(mat1)
+            elif mat1 not in self.materials:
+                self.materials.add(mat1)
+                self.yaf_material.writeMaterial(mat1)
 
-        if mat2.mat_type == 'blend':
-            self.handleBlendMat(mat2)
-        elif mat2 not in self.materials:
-            self.materials.add(mat2)
-            self.yaf_material.writeMaterial(mat2)
+            if mat2.mat_type == 'blend':
+                self.handleBlendMat(mat2)
+            elif mat2 not in self.materials:
+                self.materials.add(mat2)
+                self.yaf_material.writeMaterial(mat2)
 
-        if mat not in self.materials:
-            self.materials.add(mat)
-            self.yaf_material.writeMaterial(mat)
+            if mat not in self.materials:
+                self.materials.add(mat)
+                self.yaf_material.writeMaterial(mat)
 
     def exportMaterials(self):
         self.yi.printInfo("Exporter: Processing Materials...")
@@ -212,7 +264,7 @@ class YafaRayRenderEngine(bpy.types.RenderEngine):
                 self.handleBlendMat(material)
             else:
                 self.materials.add(material)
-                self.yaf_material.writeMaterial(material, self.preview)
+                self.yaf_material.writeMaterial(material, self.is_preview)
 
     def decideOutputFileName(self, output_path, filetype):
 
@@ -242,53 +294,52 @@ class YafaRayRenderEngine(bpy.types.RenderEngine):
 
         return outputFile, output, filetype
 
-    # callback to render scene
-    def render(self, scene):
-
-        self.preview = (scene.name == "preview")
-        self.bl_use_postprocess = False
+    # callback to export the scene
+    def update(self, data, scene):
         self.update_stats("", "Setting up render")
-
-        if not self.preview:
+        if not self.is_preview:
             scene.frame_set(scene.frame_current)
 
         self.scene = scene
-        r = scene.render
-
-        [sizeX, sizeY, bStartX, bStartY, bsizeX, bsizeY, camDummy] = yaf_scene.getRenderCoords(scene)
-
-        if r.use_border:
-            x = bsizeX
-            y = bsizeY
-        else:
-            x = sizeX
-            y = sizeY
+        render = scene.render
 
-        self.setInterface(yafrayinterface.yafrayInterface_t())
+        fp = bpy.path.abspath(render.filepath)
+        fp = os.path.realpath(fp)
+        fp = os.path.normpath(fp)
 
-        self.yi.setInputGamma(scene.gs_gamma_input, True)
+        [self.sizeX, self.sizeY, self.bStartX, self.bStartY, self.bsizeX, self.bsizeY, camDummy] = yaf_scene.getRenderCoords(scene)
 
-        rfilepath = bpy.path.abspath(r.filepath)
-        rfilepath = os.path.realpath(rfilepath)
-        rfilepath = os.path.normpath(rfilepath)
+        if render.use_border:
+            self.x = self.bsizeX
+            self.y = self.bsizeY
+        else:
+            self.x = self.sizeX
+            self.y = self.sizeY
 
         if scene.gs_type_render == "file":
-            outputFile, output, file_type = self.decideOutputFileName(rfilepath, scene.img_output)
+            self.setInterface(yafrayinterface.yafrayInterface_t())
+            self.yi.setInputGamma(scene.gs_gamma_input, True)
+            self.outputFile, self.output, self.file_type = self.decideOutputFileName(fp, scene.img_output)
             self.yi.paramsClearAll()
-            self.yi.paramsSetString("type", file_type)
-            self.yi.paramsSetBool("alpha_channel", r.color_mode == "RGBA")
+            self.yi.paramsSetString("type", self.file_type)
+            self.yi.paramsSetBool("alpha_channel", render.image_settings.color_mode == "RGBA")
             self.yi.paramsSetBool("z_channel", scene.gs_z_channel)
-            self.yi.paramsSetInt("width", x + bStartX)
-            self.yi.paramsSetInt("height", y + bStartY)
-            ih = self.yi.createImageHandler("outFile")
-            co = yafrayinterface.imageOutput_t(ih, str(outputFile), 0, 0)
-
-        # Export the Scene to XML File
-        if scene.gs_type_render == "xml":
-            outputFile, output, file_type = self.decideOutputFileName(rfilepath, 'XML')
+            self.yi.paramsSetInt("width", self.x + self.bStartX)
+            self.yi.paramsSetInt("height", self.y + self.bStartY)
+            self.ih = self.yi.createImageHandler("outFile")
+            self.co = yafrayinterface.imageOutput_t(self.ih, str(self.outputFile), 0, 0)
+
+        elif scene.gs_type_render == "xml":
             self.setInterface(yafrayinterface.xmlInterface_t())
-            co = yafrayinterface.imageOutput_t()
-            self.yi.setOutfile(outputFile)
+            self.yi.setInputGamma(scene.gs_gamma_input, True)
+            self.outputFile, self.output, self.file_type = self.decideOutputFileName(fp, 'XML')
+            self.yi.paramsClearAll()
+            self.co = yafrayinterface.imageOutput_t()
+            self.yi.setOutfile(self.outputFile)
+
+        else:
+            self.setInterface(yafrayinterface.yafrayInterface_t())
+            self.yi.setInputGamma(scene.gs_gamma_input, True)
 
         self.yi.startScene()
         self.exportScene()
@@ -298,28 +349,33 @@ class YafaRayRenderEngine(bpy.types.RenderEngine):
         # must be called last as the params from here will be used by render()
         yaf_scene.exportRenderSettings(self.yi, self.scene)
 
+    # callback to render scene
+    def render(self, scene):
+        self.bl_use_postprocess = False
+
         if scene.gs_type_render == "file":
-            self.yi.printInfo("Exporter: Rendering to file {0}".format(outputFile))
-            self.update_stats("YafaRay Rendering:", "Rendering to {0}".format(outputFile))
-            self.yi.render(co)
-            result = self.begin_result(bStartX, bStartY, x + bStartX, y + bStartY)
+            self.yi.printInfo("Exporter: Rendering to file {0}".format(self.outputFile))
+            self.update_stats("YafaRay Rendering:", "Rendering to {0}".format(self.outputFile))
+            self.yi.render(self.co)
+            result = self.begin_result(self.bStartX,
+                                       self.bStartY,
+                                       self.x + self.bStartX,
+                                       self.y + self.bStartY)
             lay = result.layers[0]
 
             # exr format has z-buffer included, so no need to load '_zbuffer' - file
             if scene.gs_z_channel and not scene.img_output == 'OPEN_EXR':
-                lay.load_from_file(output + '_zbuffer.' + file_type)
+                lay.load_from_file("{0}_zbuffer.{1}".format(self.output, self.file_type))
             else:
-                lay.load_from_file(outputFile)
+                lay.load_from_file(self.outputFile)
 
             self.end_result(result)
 
-        # Export the Scene to XML File
-        if scene.gs_type_render == "xml":
-            self.yi.printInfo("Exporter: Writing XML to file {0}".format(outputFile))
-            self.yi.render(co)
+        elif scene.gs_type_render == "xml":
+            self.yi.printInfo("Exporter: Writing XML to file {0}".format(self.outputFile))
+            self.yi.render(self.co)
 
-        elif scene.gs_type_render == "into_blender":
-            import threading
+        else:
 
             def progressCallback(command, *args):
                 if not self.test_break():
@@ -327,7 +383,10 @@ class YafaRayRenderEngine(bpy.types.RenderEngine):
                         self.tag = args[0]
                     elif command == "progress":
                         self.prog = args[0]
-                    self.update_stats("YafaRay Rendering... ", "{0} - {1:.2f}%".format(self.tag, self.prog))
+                    self.update_stats("YafaRay Rendering... ", "{0}".format(self.tag))
+                    # use blender's progress bar in the header to show progress of render
+                    # update_progress needs float range 0.0 to 1.0, yafaray returns 0.0 to 100.0
+                    self.update_progress(self.prog / 100)
 
             def drawAreaCallback(*args):
                 x, y, w, h, tile = args
@@ -349,8 +408,8 @@ class YafaRayRenderEngine(bpy.types.RenderEngine):
 
             t = threading.Thread(
                                     target=self.yi.render,
-                                    args=(sizeX, sizeY, 0, 0,
-                                    self.preview,
+                                    args=(self.sizeX, self.sizeY, 0, 0,
+                                    self.is_preview,
                                     drawAreaCallback,
                                     flushCallback,
                                     progressCallback)
@@ -370,9 +429,7 @@ class YafaRayRenderEngine(bpy.types.RenderEngine):
                 self.bl_use_postprocess = True
                 return
 
-        self.update_stats("", "Done!")
-        if scene.gs_type_render == "into_blender":
-            t.join()
         self.yi.clearAll()
         del self.yi
+        self.update_stats("", "Done!")
         self.bl_use_postprocess = True
diff --git a/io/yaf_integrator.py b/io/yaf_integrator.py
index e8bfa31..0947b9f 100644
--- a/io/yaf_integrator.py
+++ b/io/yaf_integrator.py
@@ -16,7 +16,7 @@
 #
 # ##### END GPL LICENSE BLOCK #####
 
-import bpy
+# <pep8 compliant>
 
 
 class yafIntegrator:
@@ -33,7 +33,7 @@ class yafIntegrator:
         yi.paramsSetBool("transpShad", scene.gs_transp_shad)
 
         light_type = scene.intg_light_method
-        yi.printInfo("Exporting Integrator:" + light_type)
+        yi.printInfo("Exporting Integrator: {0}".format(light_type))
 
         if light_type == "Direct Lighting":
             yi.paramsSetString("type", "directlighting")
@@ -74,25 +74,23 @@ class yafIntegrator:
             yi.paramsSetInt("bounces", scene.intg_bounces)
             yi.paramsSetBool("no_recursive", scene.intg_no_recursion)
 
-            caus_type = scene.intg_caustic_method
-            photons = False
-
-            if caus_type == "None":
-                    yi.paramsSetString("caustic_type", "none")
-            elif caus_type == "Path":
-                    yi.paramsSetString("caustic_type", "path")
-            elif caus_type == "Photon":
-                    yi.paramsSetString("caustic_type", "photon")
-                    photons = True
-            elif caus_type == "Path+Photon":
-                    yi.paramsSetString("caustic_type", "both")
-                    photons = True
-
-            if photons:
-                    yi.paramsSetInt("photons", scene.intg_photons)
-                    yi.paramsSetInt("caustic_mix", scene.intg_caustic_mix)
-                    yi.paramsSetInt("caustic_depth", scene.intg_caustic_depth)
-                    yi.paramsSetFloat("caustic_radius", scene.intg_caustic_radius)
+            #-- test for simplify code
+            causticTypeStr = scene.intg_caustic_method
+            switchCausticType = {
+                'None': 'none',
+                'Path': 'path',
+                'Photon': 'photon',
+                'Path+Photon': 'both',
+            }
+
+            causticType = switchCausticType.get(causticTypeStr)
+            yi.paramsSetString("caustic_type", causticType)
+
+            if causticType != 'none' and causticType != 'path':
+                yi.paramsSetInt("photons", scene.intg_photons)
+                yi.paramsSetInt("caustic_mix", scene.intg_caustic_mix)
+                yi.paramsSetInt("caustic_depth", scene.intg_caustic_depth)
+                yi.paramsSetFloat("caustic_radius", scene.intg_caustic_radius)
 
         elif light_type == "Bidirectional":
             yi.paramsSetString("type", "bidirectional")
@@ -136,7 +134,7 @@ class yafIntegrator:
 
         if world:
             vint_type = world.v_int_type
-            yi.printInfo("Exporter: Creating Volume Integrator: \"" + vint_type + "\"...")
+            yi.printInfo("Exporting Volume Integrator: {0}".format(vint_type))
 
             if vint_type == 'Single Scatter':
                 yi.paramsSetString("type", "SingleScatterIntegrator")
diff --git a/io/yaf_light.py b/io/yaf_light.py
index 9d3b70c..4de9eb0 100644
--- a/io/yaf_light.py
+++ b/io/yaf_light.py
@@ -16,9 +16,10 @@
 #
 # ##### END GPL LICENSE BLOCK #####
 
-import bpy
+# <pep8 compliant>
+
 import os
-import mathutils
+from mathutils import Vector
 from math import degrees, pi, sin, cos
 from bpy.path import abspath
 
@@ -73,9 +74,11 @@ class yafLight:
 
         if matrix is None:
             matrix = lamp_object.matrix_world.copy()
-        pos = matrix[3]
-        dir = matrix[2]
-        up = matrix[1]
+        # matrix indexing (row, colums) changed in Blender rev.42816, for explanation see also:
+        # http://wiki.blender.org/index.php/User:TrumanBlending/Matrix_Indexing
+        pos = matrix.col[3]
+        dir = matrix.col[2]
+        # up = matrix[1]  /* UNUSED */
         to = pos - dir
 
         lampType = lamp.lamp_type
@@ -175,10 +178,10 @@ class yafLight:
             # the light's position as the centerpoint and transform it
             # using its transformation matrix
 
-            point = mathutils.Vector((-sizeX / 2, -sizeY / 2, 0))
-            corner1 = mathutils.Vector((-sizeX / 2, sizeY / 2, 0))
-            corner2 = mathutils.Vector((sizeX / 2, sizeY / 2, 0))
-            corner3 = mathutils.Vector((sizeX / 2, -sizeY / 2, 0))
+            point = Vector((-sizeX / 2, -sizeY / 2, 0))
+            corner1 = Vector((-sizeX / 2, sizeY / 2, 0))
+            corner2 = Vector((sizeX / 2, sizeY / 2, 0))
+            corner3 = Vector((sizeX / 2, -sizeY / 2, 0))
             point = matrix * point  # use reverse vector multiply order, API changed with rev. 38674
             corner1 = matrix * corner1  # use reverse vector multiply order, API changed with rev. 38674
             corner2 = matrix * corner2  # use reverse vector multiply order, API changed with rev. 38674
diff --git a/io/yaf_material.py b/io/yaf_material.py
index f4deb8f..bea86db 100644
--- a/io/yaf_material.py
+++ b/io/yaf_material.py
@@ -16,8 +16,9 @@
 #
 # ##### END GPL LICENSE BLOCK #####
 
+# <pep8 compliant>
+
 import bpy
-import mathutils
 import yafrayinterface
 
 
@@ -104,9 +105,9 @@ class yafMaterial:
         tex = mtex.texture  # texture object instance
         # lots to do...
 
-        isImage = (tex.type == 'IMAGE')
+        isImage = (tex.yaf_tex_type == 'IMAGE')
 
-        if (isImage or (tex.type == 'VORONOI' and tex.color_mode != 'INTENSITY')):
+        if (isImage or (tex.yaf_tex_type == 'VORONOI' and tex.color_mode != 'INTENSITY')):
             isColored = True
         else:
             isColored = False
@@ -148,7 +149,7 @@ class yafMaterial:
         yi.paramsSetString("element", "shader_node")
         yi.paramsSetString("type", "texture_mapper")
         yi.paramsSetString("name", name)
-        yi.paramsSetString("texture", mtex.texture.name)
+        yi.paramsSetString("texture", texname)
 
         switchTexCoords = {
             'UV': 'uv',
@@ -233,7 +234,7 @@ class yafMaterial:
         yi.paramsSetBool("fake_shadows", mat.fake_shadows)
 
         mcolRoot = ''
-        fcolRoot = ''
+        # fcolRoot = '' /* UNUSED */
         bumpRoot = ''
 
         i = 0
@@ -289,7 +290,7 @@ class yafMaterial:
         yi.paramsSetFloat("exp_v", mat.exp_v)
 
         diffRoot = ''
-        mcolRoot = ''
+        # mcolRoot = ''  /* UNUSED */
         glossRoot = ''
         glRefRoot = ''
         bumpRoot = ''
diff --git a/io/yaf_object.py b/io/yaf_object.py
index 9845d18..3d24cf6 100644
--- a/io/yaf_object.py
+++ b/io/yaf_object.py
@@ -16,6 +16,8 @@
 #
 # ##### END GPL LICENSE BLOCK #####
 
+# <pep8 compliant>
+
 import bpy
 import time
 import math
@@ -56,8 +58,7 @@ class yafObject(object):
             # at 0,0,0 looking towards 0,0,1 (y axis being up)
 
             m = bpy.types.YAFA_RENDER.viewMatrix
-
-            m.transpose()
+            # m.transpose() --> not needed anymore: matrix indexing changed with Blender rev.42816
             inv = m.inverted()
 
             pos = multiplyMatrix4x4Vector4(inv, mathutils.Vector((0, 0, 0, 1)))
@@ -68,10 +69,13 @@ class yafObject(object):
             up = aboveCam
 
         else:
-            matrix = camera.matrix_world.copy()  # get cam worldspace transformation matrix, e.g. if cam is parented local does not work
-            pos = matrix[3]
-            dir = matrix[2]
-            up = pos + matrix[1]
+            # get cam worldspace transformation matrix, e.g. if cam is parented matrix_local does not work
+            matrix = camera.matrix_world.copy()
+            # matrix indexing (row, colums) changed in Blender rev.42816, for explanation see also:
+            # http://wiki.blender.org/index.php/User:TrumanBlending/Matrix_Indexing
+            pos = matrix.col[3]
+            dir = matrix.col[2]
+            up = pos + matrix.col[1]
 
         to = pos - dir
 
@@ -99,18 +103,27 @@ class yafObject(object):
                 yi.paramsSetFloat("scale", camera.ortho_scale)
 
             elif camType in {"perspective", "architect"}:
-                f_aspect = 1.0
-                if x < y:
+                # Blenders GSOC 2011 project "tomato branch" merged into trunk.
+                # Check for sensor settings and use them in yafaray exporter also.
+                if camera.sensor_fit == 'AUTO':
+                    horizontal_fit = (x > y)
+                    sensor_size = camera.sensor_width
+                elif camera.sensor_fit == 'HORIZONTAL':
+                    horizontal_fit = True
+                    sensor_size = camera.sensor_width
+                else:
+                    horizontal_fit = False
+                    sensor_size = camera.sensor_height
+
+                if horizontal_fit:
+                    f_aspect = 1.0
+                else:
                     f_aspect = x / y
 
-                sensor_width = 32.0
-                if hasattr(camera, "sensor_width"):
-                    sensor_width = camera.sensor_width
-                yi.paramsSetFloat("focal", camera.lens / (f_aspect * sensor_width))
+                yi.paramsSetFloat("focal", camera.lens / (f_aspect * sensor_size))
 
                 # DOF params, only valid for real camera
                 # use DOF object distance if present or fixed DOF
-
                 if camera.dof_object is not None:
                     # use DOF object distance
                     dist = (pos.xyz - camera.dof_object.location.xyz).length
@@ -164,72 +177,6 @@ class yafObject(object):
 
         return ret
 
-    def writeObjects(self):
-
-        baseIds = {}
-        dupBaseIds = {}
-        # export only visible objects
-        for obj in [o for o in self.scene.objects if not o.hide_render and o.is_visible(self.scene) \
-        and (o.type in {'MESH', 'SURFACE', 'CURVE', 'FONT', 'EMPTY'})]:
-            # Exporting dupliObjects as instances: disabled exporting instances when global
-            # option "transp. shadows" is on -> crashes yafaray render engine
-            if obj.is_duplicator:
-                self.yi.printInfo("Processing duplis for: {0}".format(obj.name))
-                obj.dupli_list_create(self.scene)
-
-                for obj_dupli in obj.dupli_list:
-                    if self.scene.gs_transp_shad:
-                        matrix = obj_dupli.matrix.copy()
-                        self.writeMesh(obj_dupli.object, matrix)
-                    else:
-                        if obj_dupli.object.name not in dupBaseIds:
-                            dupBaseIds[obj_dupli.object.name] = self.writeInstanceBase(obj_dupli.object)
-                        matrix = obj_dupli.matrix.copy()
-                        self.writeInstance(dupBaseIds[obj_dupli.object.name], matrix, obj_dupli.object.name)
-
-                if obj.dupli_list is not None:
-                    obj.dupli_list_clear()
-
-                # check if object has particle system and uses the option for 'render emitter'
-                if hasattr(obj, 'particle_systems'):
-                    for pSys in obj.particle_systems:
-                        check_rendertype = pSys.settings.render_type in {'OBJECT', 'GROUP'}
-                        if check_rendertype and pSys.settings.use_render_emitter:
-                            matrix = obj.matrix_world.copy()
-                            self.writeMesh(obj, matrix)
-
-            # no need to write empty object from here on, so continue with next object in loop
-            elif obj.type == 'EMPTY':
-                continue
-
-            # Exporting objects with shared mesh data blocks as instances: disabled exporting instances when global
-            # option "transparent shadows" is on -> crashes yafaray render engine
-            elif obj.data.users > 1 and not self.scene.gs_transp_shad:
-                has_orco = False
-                # check materials and textures of object for 'ORCO' texture coordinates
-                # if so: do not export them as instances -> gives weird rendering results!
-                for mat_slot in [m for m in obj.material_slots if m.material is not None]:
-                    for tex in [t for t in mat_slot.material.texture_slots if (t and t.texture and t.use)]:
-                        if tex.texture_coords == 'ORCO':
-                            has_orco = True
-                            break  # break tex loop
-                    if has_orco:
-                        break  # break mat_slot loop
-                if has_orco:
-                    self.writeObject(obj)
-                else:
-                    self.yi.printInfo("Processing shared mesh data node object: {0}".format(obj.name))
-                    if obj.data.name not in baseIds:
-                        baseIds[obj.data.name] = self.writeInstanceBase(obj)
-
-                    if obj.name not in dupBaseIds:
-                        matrix = obj.matrix_world.copy()
-                        self.writeInstance(baseIds[obj.data.name], matrix, obj.data.name)
-
-            else:
-                if obj.data.name not in baseIds and obj.name not in dupBaseIds:
-                    self.writeObject(obj)
-
     def writeObject(self, obj, matrix=None):
 
         if not matrix:
@@ -244,8 +191,8 @@ class yafObject(object):
         elif obj.bgp_enable:  # BGPortal Light
             self.writeBGPortal(obj, matrix)
 
-        elif obj.particle_systems:  # Particle system
-            self.writeParticlesObject(obj, matrix)
+        elif obj.particle_systems:  # Particle Hair system
+            self.writeParticleStrands(obj, matrix)
 
         else:  # The rest of the object types
             self.writeMesh(obj, matrix)
@@ -268,7 +215,7 @@ class yafObject(object):
         self.yi.printInfo("Exporting Instance of {0} [ID = {1:d}]".format(name, oID))
 
         mat4 = obj2WorldMatrix.to_4x4()
-        mat4.transpose()
+        # mat4.transpose() --> not needed anymore: matrix indexing changed with Blender rev.42816
 
         o2w = self.get4x4Matrix(mat4)
 
@@ -344,15 +291,8 @@ class yafObject(object):
         self.yi.printInfo("Exporting Volume Region: {0}".format(obj.name))
 
         yi = self.yi
-        me = obj.data
-        me_materials = me.materials
-
-        mesh = obj.to_mesh(self.scene, True, 'RENDER')
-
-        if matrix is not None:
-            mesh.transform(matrix)
-        else:
-            return
+        # me = obj.data  /* UNUSED */
+        # me_materials = me.materials  /* UNUSED */
 
         yi.paramsClearAll()
 
@@ -365,12 +305,12 @@ class yafObject(object):
             yi.paramsSetString("type", "UniformVolume")
 
         elif obj.vol_region == 'Noise Volume':
-            if not obj.data.materials[0]:
+            if not obj.active_material:
                 yi.printError("Volume object ({0}) is missing the materials".format(obj.name))
-            elif not obj.data.materials[0].texture_slots[0].texture:
+            elif not obj.active_material.active_texture:
                 yi.printError("Volume object's material ({0}) is missing the noise texture".format(obj.name))
             else:
-                texture = obj.data.materials[0].texture_slots[0].texture
+                texture = obj.active_material.active_texture
 
                 yi.paramsSetString("type", "NoiseVolume")
                 yi.paramsSetFloat("sharpness", obj.vol_sharpness)
@@ -385,45 +325,35 @@ class yafObject(object):
         yi.paramsSetFloat("sigma_s", obj.vol_scatter)
         yi.paramsSetInt("attgridScale", self.scene.world.v_int_attgridres)
 
-        min = [1e10, 1e10, 1e10]
-        max = [-1e10, -1e10, -1e10]
-        vertLoc = []
-        for v in mesh.vertices:
-            vertLoc.append(v.co[0])
-            vertLoc.append(v.co[1])
-            vertLoc.append(v.co[2])
-
-            if vertLoc[0] < min[0]:
-                min[0] = vertLoc[0]
-            if vertLoc[1] < min[1]:
-                min[1] = vertLoc[1]
-            if vertLoc[2] < min[2]:
-                min[2] = vertLoc[2]
-            if vertLoc[0] > max[0]:
-                max[0] = vertLoc[0]
-            if vertLoc[1] > max[1]:
-                max[1] = vertLoc[1]
-            if vertLoc[2] > max[2]:
-                max[2] = vertLoc[2]
-
-            vertLoc = []
-
-        yi.paramsSetFloat("minX", min[0])
-        yi.paramsSetFloat("minY", min[1])
-        yi.paramsSetFloat("minZ", min[2])
-        yi.paramsSetFloat("maxX", max[0])
-        yi.paramsSetFloat("maxY", max[1])
-        yi.paramsSetFloat("maxZ", max[2])
-
-        yi.createVolumeRegion("VR_" + obj.name + "." + str(obj.__hash__()))
+        v = [list(bb) for bb in obj.bound_box]
+        bmin = min(v)
+        bmax = max(v)
+
+        # BoundingBox: get the low corner (minx, miny, minz) and the
+        # up corner (maxx, maxy, maxz) then apply object scale, also
+        # clamp the values to min: -1e10 and max: 1e10
+        minx = max(bmin[0] * obj.scale.x, -1e10)
+        miny = max(bmin[1] * obj.scale.y, -1e10)
+        minz = max(bmin[2] * obj.scale.z, -1e10)
+        maxx = min(bmax[0] * obj.scale.x, 1e10)
+        maxy = min(bmax[1] * obj.scale.y, 1e10)
+        maxz = min(bmax[2] * obj.scale.z, 1e10)
+
+        yi.paramsSetFloat("minX", minx)
+        yi.paramsSetFloat("minY", miny)
+        yi.paramsSetFloat("minZ", minz)
+        yi.paramsSetFloat("maxX", maxx)
+        yi.paramsSetFloat("maxY", maxy)
+        yi.paramsSetFloat("maxZ", maxz)
+
+        yi.createVolumeRegion("VR.{0}-{1}".format(obj.name, str(obj.__hash__())))
 
     def writeGeometry(self, ID, obj, matrix, obType=0, oMat=None):
 
         mesh = obj.to_mesh(self.scene, True, 'RENDER')
         isSmooth = False
         hasOrco = False
-        # TODO: this may not be the best way to check for uv maps
-        hasUV = (len(mesh.uv_textures) > 0)
+        hasUV = mesh.uv_textures
 
         # Check if the object has an orco mapped texture
         for mat in [mmat for mmat in mesh.materials if mmat is not None]:
@@ -500,14 +430,12 @@ class yafObject(object):
 
         self.yi.endTriMesh()
 
-        if isSmooth == True:
-            if mesh.use_auto_smooth:
-                self.yi.smoothMesh(0, math.degrees(mesh.auto_smooth_angle))
-            else:
-                if obj.type == 'FONT':  # getting nicer result with smooth angle 60 degr. for text objects
-                    self.yi.smoothMesh(0, 60)
-                else:
-                    self.yi.smoothMesh(0, 181)
+        if isSmooth and mesh.use_auto_smooth:
+            self.yi.smoothMesh(0, math.degrees(mesh.auto_smooth_angle))
+        elif isSmooth and obj.type == 'FONT':  # getting nicer result with smooth angle 60 degr. for text objects
+            self.yi.smoothMesh(0, 60)
+        elif isSmooth:
+            self.yi.smoothMesh(0, 181)
 
         self.yi.endGeometry()
 
@@ -517,77 +445,77 @@ class yafObject(object):
 
         ymaterial = self.materialMap["default"]
 
-        if not self.scene.gs_clay_render:
-            if len(meshMats) and meshMats[matIndex]:
-                mat = meshMats[matIndex]
-
-                if mat in self.materialMap:
-                    ymaterial = self.materialMap[mat]
-            else:
-                for mat_slot in matSlots:
-                    if mat_slot.material in self.materialMap:
-                        ymaterial = self.materialMap[mat_slot.material]
-        else:
-            # set material to "clay", if "Clay Render" option is enabled in general settings
+        if self.scene.gs_clay_render:
             ymaterial = self.materialMap["clay"]
+        elif len(meshMats) and meshMats[matIndex]:
+            mat = meshMats[matIndex]
+            if mat in self.materialMap:
+                ymaterial = self.materialMap[mat]
+        else:
+            for mat_slots in [ms for ms in matSlots if ms.material in self.materialMap]:
+                ymaterial = self.materialMap[mat_slots.material]
 
         return ymaterial
 
-    def writeParticlesObject(self, object, matrix):
+    def writeParticleStrands(self, object, matrix):
 
         yi = self.yi
         renderEmitter = False
         if hasattr(object, 'particle_systems') == False:
             return
 
+        # Check for hair particles:
         for pSys in object.particle_systems:
-
-            if pSys.settings.render_type == 'PATH':  # Export Hair particles
-                yi.printInfo("Exporter: Creating Particle System {!r}".format(pSys.name))
-                tstart = time.time()
-                # TODO: clay particles uses at least materials thikness?
-                if object.active_material is not None:
-                    pmaterial = object.active_material
-
-                    if pmaterial.strand.use_blender_units:
-                        strandStart = pmaterial.strand.root_size
-                        strandEnd = pmaterial.strand.tip_size
-                        strandShape = pmaterial.strand.shape
-                    else:  # Blender unit conversion
-                        strandStart = pmaterial.strand.root_size / 100
-                        strandEnd = pmaterial.strand.tip_size / 100
-                        strandShape = pmaterial.strand.shape
-                else:
-                    pmaterial = "default"  # No material assigned in blender, use default one
-                    strandStart = 0.01
-                    strandEnd = 0.01
-                    strandShape = 0.0
-
-                for particle in pSys.particles:
-                    if particle.is_exist and particle.is_visible:
-                        p = True
-                    else:
-                        p = False
-                    CID = yi.getNextFreeID()
-                    yi.paramsClearAll()
-                    yi.startGeometry()
-                    yi.startCurveMesh(CID, p)
-                    for location in particle.hair_keys:
-                        vertex = matrix * location.co  # use reverse vector multiply order, API changed with rev. 38674
-                        yi.addVertex(vertex[0], vertex[1], vertex[2])
-                    #this section will be changed after the material settings been exported
-                    if self.materialMap[pmaterial]:
-                        yi.endCurveMesh(self.materialMap[pmaterial], strandStart, strandEnd, strandShape)
+            for mod in [m for m in object.modifiers if (m is not None) and (m.type == 'PARTICLE_SYSTEM')]:
+                if (pSys.settings.render_type == 'PATH') and mod.show_render and (pSys.name == mod.particle_system.name):
+                    yi.printInfo("Exporter: Creating Hair Particle System {!r}".format(pSys.name))
+                    tstart = time.time()
+                    # TODO: clay particles uses at least materials thikness?
+                    if object.active_material is not None:
+                        pmaterial = object.active_material
+
+                        if pmaterial.strand.use_blender_units:
+                            strandStart = pmaterial.strand.root_size
+                            strandEnd = pmaterial.strand.tip_size
+                            strandShape = pmaterial.strand.shape
+                        else:  # Blender unit conversion
+                            strandStart = pmaterial.strand.root_size / 100
+                            strandEnd = pmaterial.strand.tip_size / 100
+                            strandShape = pmaterial.strand.shape
                     else:
-                        yi.endCurveMesh(self.materialMap["default"], strandStart, strandEnd, strandShape)
-                # TODO: keep object smooth
-                #yi.smoothMesh(0, 60.0)
-                    yi.endGeometry()
-                yi.printInfo("Exporter: Particle creation time: {0:.3f}".format(time.time() - tstart))
-
-                if (pSys.settings.use_render_emitter):
-                    renderEmitter = True
+                        pmaterial = "default"  # No material assigned in blender, use default one
+                        strandStart = 0.01
+                        strandEnd = 0.01
+                        strandShape = 0.0
+
+                    for particle in pSys.particles:
+                        if particle.is_exist and particle.is_visible:
+                            p = True
+                        else:
+                            p = False
+                        CID = yi.getNextFreeID()
+                        yi.paramsClearAll()
+                        yi.startGeometry()
+                        yi.startCurveMesh(CID, p)
+                        for location in particle.hair_keys:
+                            vertex = matrix * location.co  # use reverse vector multiply order, API changed with rev. 38674
+                            yi.addVertex(vertex[0], vertex[1], vertex[2])
+                        #this section will be changed after the material settings been exported
+                        if self.materialMap[pmaterial]:
+                            yi.endCurveMesh(self.materialMap[pmaterial], strandStart, strandEnd, strandShape)
+                        else:
+                            yi.endCurveMesh(self.materialMap["default"], strandStart, strandEnd, strandShape)
+                    # TODO: keep object smooth
+                    #yi.smoothMesh(0, 60.0)
+                        yi.endGeometry()
+                    yi.printInfo("Exporter: Particle creation time: {0:.3f}".format(time.time() - tstart))
+
+                    if pSys.settings.use_render_emitter:
+                        renderEmitter = True
+                else:
+                    self.writeMesh(object, matrix)
+
         # We only need to render emitter object once
         if renderEmitter:
-            ymat = self.materialMap["default"]
+            # ymat = self.materialMap["default"]  /* UNUSED */
             self.writeMesh(object, matrix)
diff --git a/io/yaf_scene.py b/io/yaf_scene.py
index 5e2b0b3..938a6cb 100644
--- a/io/yaf_scene.py
+++ b/io/yaf_scene.py
@@ -16,6 +16,8 @@
 #
 # ##### END GPL LICENSE BLOCK #####
 
+# <pep8 compliant>
+
 
 def computeSceneSize(render):
     sizeX = int(render.resolution_x * render.resolution_percentage * 0.01)
diff --git a/io/yaf_texture.py b/io/yaf_texture.py
index 923d509..d27a09e 100644
--- a/io/yaf_texture.py
+++ b/io/yaf_texture.py
@@ -16,8 +16,11 @@
 #
 # ##### END GPL LICENSE BLOCK #####
 
+# <pep8 compliant>
+
 import bpy
 import os
+from bpy.path import abspath, clean_name
 
 
 def noise2string(ntype):
@@ -266,20 +269,47 @@ class yafTexture:
 
             textureConfigured = True
 
-        elif tex.yaf_tex_type == 'IMAGE' and tex.image:
-            image_tex = tex.image
-            image_file = bpy.path.abspath(image_tex.filepath)
-            image_file = os.path.realpath(image_file)
-            image_file = os.path.normpath(image_file)
+        elif tex.yaf_tex_type == 'IMAGE' and tex.image and tex.image.source in {'FILE', 'GENERATED'}:
 
-            if image_file != "" and not os.path.exists(image_file):
-                yi.printInfo("Exporter: No valid texture image supplied.")
-                return False
+            filename = os.path.splitext(os.path.basename(bpy.data.filepath))[0]
 
-            yi.printInfo("Exporter: Creating Texture: '{0}' type {1}: {2}".format(name, tex.yaf_tex_type, image_file))
+            if not any(filename):
+                filename = "untitled"
+                save_dir = os.path.expanduser("~")
+            else:
+                save_dir = "//"
+
+            filename = clean_name(filename)
+            fileformat = scene.render.image_settings.file_format.lower()
+            extract_path = os.path.join(filename, "{:05d}".format(scene.frame_current))
+
+            if tex.image.source == 'GENERATED':
+                image_tex = "yaf_baked_image_{0}.{1}".format(clean_name(tex.name), fileformat)
+                image_tex = os.path.join(save_dir, extract_path, image_tex)
+                image_tex = abspath(image_tex)
+                tex.image.save_render(image_tex, scene)
+            if tex.image.source == 'FILE':
+                if tex.image.packed_file:
+                    image_tex = "yaf_extracted_image_{0}.{1}".format(clean_name(tex.name), fileformat)
+                    image_tex = os.path.join(save_dir, extract_path, image_tex)
+                    image_tex = abspath(image_tex)
+                    texture.image.save_render(image_tex, scene)
+                else:
+                    if tex.image.library is not None:
+                        image_tex = abspath(tex.image.filepath, library=tex.image.library)
+                    else:
+                        image_tex = abspath(tex.image.filepath)
+                    if not os.path.exists(image_tex):
+                        yi.printError("Exporter: Image texture {0} not found on: {1}".format(tex.name, image_tex))
+                        return False
+
+            image_tex = os.path.realpath(image_tex)
+            image_tex = os.path.normpath(image_tex)
+
+            yi.printInfo("Exporter: Creating Texture: '{0}' type {1}: {2}".format(name, tex.yaf_tex_type, image_tex))
 
             yi.paramsSetString("type", "image")
-            yi.paramsSetString("filename", image_file)
+            yi.paramsSetString("filename", image_tex)
 
             yi.paramsSetBool("use_alpha", tex.use_alpha)
             yi.paramsSetBool("calc_alpha", tex.use_calculate_alpha)
diff --git a/io/yaf_world.py b/io/yaf_world.py
index 0521005..8ae2e34 100644
--- a/io/yaf_world.py
+++ b/io/yaf_world.py
@@ -16,156 +16,157 @@
 #
 # ##### END GPL LICENSE BLOCK #####
 
-import bpy
+# <pep8 compliant>
+
 from bpy.path import abspath
 from os.path import realpath, normpath
 
 
 class yafWorld:
-        def __init__(self, interface):
-                self.yi = interface
-
-        def exportWorld(self, scene):
-                yi = self.yi
-
-                world = scene.world
-
-                if world:
-                    bg_type = world.bg_type
-                    useIBL = world.bg_use_ibl
-                    iblSamples = world.bg_ibl_samples
-                    bgPower = world.bg_power
-                    with_caustic = world.bg_with_caustic
-                    with_diffuse = world.bg_with_diffuse
-                    c = world.bg_single_color
-                else:
-                    bg_type = "Single Color"
-                    c = (0.0, 0.0, 0.0)
-                    useIBL = False
-                    iblSamples = 16
-                    bgPower = 1
-
-                self.yi.printInfo("Exporting World, type: {0}".format(bg_type))
-                yi.paramsClearAll()
-
-                if bg_type == 'Texture':
-                    if world.active_texture is not None:
-                        worldTex = world.active_texture
-                        self.yi.printInfo("World Texture, name: {0}".format(worldTex.name))
-                    else:
-                        worldTex = None
+    def __init__(self, interface):
+        self.yi = interface
 
-                    if worldTex is not None:
+    def exportWorld(self, scene):
+        yi = self.yi
 
-                        if worldTex.type == "IMAGE" and (worldTex.image is not None):
+        world = scene.world
 
-                            yi.paramsSetString("type", "image")
+        if world:
+            bg_type = world.bg_type
+            useIBL = world.bg_use_ibl
+            iblSamples = world.bg_ibl_samples
+            bgPower = world.bg_power
+            with_caustic = world.bg_with_caustic
+            with_diffuse = world.bg_with_diffuse
+            c = world.bg_single_color
+        else:
+            bg_type = "Single Color"
+            c = (0.0, 0.0, 0.0)
+            useIBL = False
+            iblSamples = 16
+            bgPower = 1
 
-                            image_file = abspath(worldTex.image.filepath)
-                            image_file = realpath(image_file)
-                            image_file = normpath(image_file)
+        self.yi.printInfo("Exporting World, type: {0}".format(bg_type))
+        yi.paramsClearAll()
 
-                            yi.paramsSetString("filename", image_file)
+        if bg_type == 'Texture':
+            if world.active_texture is not None:
+                worldTex = world.active_texture
+                self.yi.printInfo("World Texture, name: {0}".format(worldTex.name))
+            else:
+                worldTex = None
 
-                            # exposure_adjust not restricted to integer range anymore
-                            yi.paramsSetFloat("exposure_adjust", world.bg_exposure)
+            if worldTex is not None:
 
-                            if worldTex.use_interpolation == True:
-                                yi.paramsSetString("interpolate", "bilinear")
-                            else:
-                                yi.paramsSetString("interpolate", "none")
+                if worldTex.type == "IMAGE" and (worldTex.image is not None):
 
-                            yi.createTexture("world_texture")
+                    yi.paramsSetString("type", "image")
 
-                            # Export the actual background
-                            texco = world.texture_slots[world.active_texture_index].texture_coords
-                            yi.paramsClearAll()
+                    image_file = abspath(worldTex.image.filepath)
+                    image_file = realpath(image_file)
+                    image_file = normpath(image_file)
 
-                            if texco == 'ANGMAP':
-                                yi.paramsSetString("mapping", "probe")
-                            elif texco == 'SPHERE':
-                                yi.paramsSetString("mapping", "sphere")
-                            else:
-                                yi.printWarning("World texture mapping neither Sphere nor AngMap, set it to Sphere now by default!")
-                                yi.paramsSetString("mapping", "sphere")
+                    yi.paramsSetString("filename", image_file)
 
-                            yi.paramsSetString("type", "textureback")
-                            yi.paramsSetString("texture", "world_texture")
-                            yi.paramsSetBool("ibl", useIBL)
-                            # 'with_caustic' and 'with_diffuse' settings gets checked in textureback.cc,
-                            # so if IBL enabled when they are used...
-                            yi.paramsSetBool("with_caustic", with_caustic)
-                            yi.paramsSetBool("with_diffuse", with_diffuse)
-                            yi.paramsSetInt("ibl_samples", iblSamples)
-                            yi.paramsSetFloat("power", bgPower)
-                            yi.paramsSetFloat("rotation", world.bg_rotation)
+                    # exposure_adjust not restricted to integer range anymore
+                    yi.paramsSetFloat("exposure_adjust", world.bg_exposure)
 
-                elif bg_type == 'Gradient':
-                    c = world.bg_horizon_color
-                    yi.paramsSetColor("horizon_color", c[0], c[1], c[2])
+                    if worldTex.use_interpolation == True:
+                        yi.paramsSetString("interpolate", "bilinear")
+                    else:
+                        yi.paramsSetString("interpolate", "none")
 
-                    c = world.bg_zenith_color
-                    yi.paramsSetColor("zenith_color", c[0], c[1], c[2])
+                    yi.createTexture("world_texture")
 
-                    c = world.bg_horizon_ground_color
-                    yi.paramsSetColor("horizon_ground_color", c[0], c[1], c[2])
+                    # Export the actual background
+                    texco = world.texture_slots[world.active_texture_index].texture_coords
+                    yi.paramsClearAll()
 
-                    c = world.bg_zenith_ground_color
-                    yi.paramsSetColor("zenith_ground_color", c[0], c[1], c[2])
+                    if texco == 'ANGMAP':
+                        yi.paramsSetString("mapping", "probe")
+                    elif texco == 'SPHERE':
+                        yi.paramsSetString("mapping", "sphere")
+                    else:
+                        yi.printWarning("World texture mapping neither Sphere nor AngMap, set it to Sphere now by default!")
+                        yi.paramsSetString("mapping", "sphere")
 
-                    yi.paramsSetFloat("power", bgPower)
-                    yi.paramsSetBool("ibl", useIBL)
-                    yi.paramsSetInt("ibl_samples", iblSamples)
-                    yi.paramsSetString("type", "gradientback")
-
-                elif bg_type == 'Sunsky1':
-                    f = world.bg_from
-                    yi.paramsSetPoint("from", f[0], f[1], f[2])
-                    yi.paramsSetFloat("turbidity", world.bg_turbidity)
-                    yi.paramsSetFloat("a_var", world.bg_a_var)
-                    yi.paramsSetFloat("b_var", world.bg_b_var)
-                    yi.paramsSetFloat("c_var", world.bg_c_var)
-                    yi.paramsSetFloat("d_var", world.bg_d_var)
-                    yi.paramsSetFloat("e_var", world.bg_e_var)
-                    yi.paramsSetBool("add_sun", world.bg_add_sun)
-                    yi.paramsSetFloat("sun_power", world.bg_sun_power)
-                    yi.paramsSetBool("background_light", world.bg_background_light)
-                    yi.paramsSetInt("light_samples", world.bg_light_samples)
-                    yi.paramsSetFloat("power", world.bg_power)
-                    yi.paramsSetString("type", "sunsky")
-
-                elif bg_type == "Sunsky2":
-                    f = world.bg_from
-                    yi.paramsSetPoint("from", f[0], f[1], f[2])
-                    yi.paramsSetFloat("turbidity", world.bg_ds_turbidity)
-                    yi.paramsSetFloat("altitude", world.bg_dsaltitude)
-                    yi.paramsSetFloat("a_var", world.bg_a_var)
-                    yi.paramsSetFloat("b_var", world.bg_b_var)
-                    yi.paramsSetFloat("c_var", world.bg_c_var)
-                    yi.paramsSetFloat("d_var", world.bg_d_var)
-                    yi.paramsSetFloat("e_var", world.bg_e_var)
-                    yi.paramsSetBool("add_sun", world.bg_add_sun)
-                    yi.paramsSetFloat("sun_power", world.bg_sun_power)
-                    yi.paramsSetBool("background_light", world.bg_background_light)
-                    yi.paramsSetBool("with_caustic", world.bg_with_caustic)
-                    yi.paramsSetBool("with_diffuse", world.bg_with_diffuse)
-                    yi.paramsSetInt("light_samples", world.bg_light_samples)
-                    yi.paramsSetFloat("power", world.bg_power)
-                    yi.paramsSetFloat("bright", world.bg_dsbright)
-                    yi.paramsSetBool("night", world.bg_dsnight)
-                    yi.paramsSetFloat("exposure", world.bg_exposure)
-                    yi.paramsSetBool("clamp_rgb", world.bg_clamp_rgb)
-                    yi.paramsSetBool("gamma_enc", world.bg_gamma_enc)
-                    yi.paramsSetString("color_space", world.bg_color_space)
-                    yi.paramsSetString("type", "darksky")
-
-                else:
-                    yi.paramsSetColor("color", c[0], c[1], c[2])
+                    yi.paramsSetString("type", "textureback")
+                    yi.paramsSetString("texture", "world_texture")
                     yi.paramsSetBool("ibl", useIBL)
+                    # 'with_caustic' and 'with_diffuse' settings gets checked in textureback.cc,
+                    # so if IBL enabled when they are used...
+                    yi.paramsSetBool("with_caustic", with_caustic)
+                    yi.paramsSetBool("with_diffuse", with_diffuse)
                     yi.paramsSetInt("ibl_samples", iblSamples)
                     yi.paramsSetFloat("power", bgPower)
-                    yi.paramsSetString("type", "constant")
-
-                yi.createBackground("world_background")
-
-                return True
+                    yi.paramsSetFloat("rotation", world.bg_rotation)
+
+        elif bg_type == 'Gradient':
+            c = world.bg_horizon_color
+            yi.paramsSetColor("horizon_color", c[0], c[1], c[2])
+
+            c = world.bg_zenith_color
+            yi.paramsSetColor("zenith_color", c[0], c[1], c[2])
+
+            c = world.bg_horizon_ground_color
+            yi.paramsSetColor("horizon_ground_color", c[0], c[1], c[2])
+
+            c = world.bg_zenith_ground_color
+            yi.paramsSetColor("zenith_ground_color", c[0], c[1], c[2])
+
+            yi.paramsSetFloat("power", bgPower)
+            yi.paramsSetBool("ibl", useIBL)
+            yi.paramsSetInt("ibl_samples", iblSamples)
+            yi.paramsSetString("type", "gradientback")
+
+        elif bg_type == 'Sunsky1':
+            f = world.bg_from
+            yi.paramsSetPoint("from", f[0], f[1], f[2])
+            yi.paramsSetFloat("turbidity", world.bg_turbidity)
+            yi.paramsSetFloat("a_var", world.bg_a_var)
+            yi.paramsSetFloat("b_var", world.bg_b_var)
+            yi.paramsSetFloat("c_var", world.bg_c_var)
+            yi.paramsSetFloat("d_var", world.bg_d_var)
+            yi.paramsSetFloat("e_var", world.bg_e_var)
+            yi.paramsSetBool("add_sun", world.bg_add_sun)
+            yi.paramsSetFloat("sun_power", world.bg_sun_power)
+            yi.paramsSetBool("background_light", world.bg_background_light)
+            yi.paramsSetInt("light_samples", world.bg_light_samples)
+            yi.paramsSetFloat("power", world.bg_power)
+            yi.paramsSetString("type", "sunsky")
+
+        elif bg_type == "Sunsky2":
+            f = world.bg_from
+            yi.paramsSetPoint("from", f[0], f[1], f[2])
+            yi.paramsSetFloat("turbidity", world.bg_ds_turbidity)
+            yi.paramsSetFloat("altitude", world.bg_dsaltitude)
+            yi.paramsSetFloat("a_var", world.bg_a_var)
+            yi.paramsSetFloat("b_var", world.bg_b_var)
+            yi.paramsSetFloat("c_var", world.bg_c_var)
+            yi.paramsSetFloat("d_var", world.bg_d_var)
+            yi.paramsSetFloat("e_var", world.bg_e_var)
+            yi.paramsSetBool("add_sun", world.bg_add_sun)
+            yi.paramsSetFloat("sun_power", world.bg_sun_power)
+            yi.paramsSetBool("background_light", world.bg_background_light)
+            yi.paramsSetBool("with_caustic", world.bg_with_caustic)
+            yi.paramsSetBool("with_diffuse", world.bg_with_diffuse)
+            yi.paramsSetInt("light_samples", world.bg_light_samples)
+            yi.paramsSetFloat("power", world.bg_power)
+            yi.paramsSetFloat("bright", world.bg_dsbright)
+            yi.paramsSetBool("night", world.bg_dsnight)
+            yi.paramsSetFloat("exposure", world.bg_exposure)
+            yi.paramsSetBool("clamp_rgb", world.bg_clamp_rgb)
+            yi.paramsSetBool("gamma_enc", world.bg_gamma_enc)
+            yi.paramsSetString("color_space", world.bg_color_space)
+            yi.paramsSetString("type", "darksky")
+
+        else:
+            yi.paramsSetColor("color", c[0], c[1], c[2])
+            yi.paramsSetBool("ibl", useIBL)
+            yi.paramsSetInt("ibl_samples", iblSamples)
+            yi.paramsSetFloat("power", bgPower)
+            yi.paramsSetString("type", "constant")
+
+        yi.createBackground("world_background")
+
+        return True
diff --git a/ot/__init__.py b/ot/__init__.py
index b83225d..bbde49b 100644
--- a/ot/__init__.py
+++ b/ot/__init__.py
@@ -16,6 +16,8 @@
 #
 # ##### END GPL LICENSE BLOCK #####
 
+# <pep8 compliant>
+
 from . import yafaray_operators
 from . import yafaray_converter
 from . import yafaray_presets
diff --git a/ot/yafaray_converter.py b/ot/yafaray_converter.py
index 639a51e..8670abe 100644
--- a/ot/yafaray_converter.py
+++ b/ot/yafaray_converter.py
@@ -16,6 +16,8 @@
 #
 # ##### END GPL LICENSE BLOCK #####
 
+# <pep8 compliant>
+
 import bpy
 
 
@@ -187,35 +189,6 @@ def convertLight(lightObj):
     return problemList
 
 
-def convertTextures(textures):
-    problemList = []
-
-    for tex in textures:
-        try:
-            tex.name = tex.name
-        except:
-            tex.name = "Problem"
-            problemList.append("Renaming texture name to {0}".format(tex.name))
-
-    for tex in textures:
-        problemList += convertTexture(tex)
-
-    return problemList
-
-
-def convertTexture(tex):
-    problemList = []
-
-    texType = tex.type
-
-    if texType is not None:
-        tex.yaf_tex_type = texType
-    else:
-        problemList.append("No texture type on texture {0}".format(tex.name))
-
-    return problemList
-
-
 def convertMaterials(materials):
     problemList = []
 
@@ -312,6 +285,14 @@ def convertWorld(world):
     world.bg_type = switch_bg_Type.get(props["bg_type"], "Single Color")
     world.bg_from = props["from"]
 
+    # check for Volume Integrator settings...
+    if props.get("volType"):
+        world.v_int_type = props["volType"]
+        world.v_int_step_size = props["stepSize"]
+        world.v_int_adaptive = props["adaptive"]
+        world.v_int_optimize = props["optimize"]
+        world.v_int_attgridres = props["attgridScale"]
+
     variableDict = dict(
         color="single_color",
         ibl="use_ibl",
@@ -326,19 +307,14 @@ def convertWorld(world):
         dsd="d_var",
         dse="e_var",
         dscolorspace="color_space",
-        dspower="dsbright",
+        dspower="power",
         dsexposure="exposure",
-        dsgammaenc="gamma_enc",
-        volType="v_int_type",
-        stepSize="v_int_step_size",
-        adaptive="v_int_adaptive",
-        optimize="v_int_optimize",
-        attgridScale="v_int_attgridres")
+        dsgammaenc="gamma_enc")
 
     for p in props:
         value = props[p]
 
-        if p in {"bg_type", "from"}:
+        if p in {"bg_type", "from", "volType", "stepSize", "adaptive", "optimize", "attgridScale"}:
             continue
 
         if p in variableDict:
@@ -411,7 +387,7 @@ def convertGeneralSettings(scene):
     props = propsDummy.get("Renderer", None)
 
     switch_output_method = {"GUI": "into_blender", "Image": "file", "XML": "xml"}
-    if hasattr(props, "output_method"):
+    if props.get("output_method"):
         scene.gs_type_render = switch_output_method.get(props["output_method"], "into_blender")
         if props["output_method"] == "Image":
             switch_file_type = {"TIFF [Tag Image File Format]": "TIFF", "TGA [Truevision TARGA]": "TARGA", \
@@ -515,7 +491,6 @@ class ConvertYafarayProperties(bpy.types.Operator):
 
         problemList = []
 
-        problemList += convertTextures(data.textures)
         problemList += convertMaterials(data.materials)
         problemList += convertLights([l for l in data.objects if l.type == "LAMP"])
         problemList += convertCameras([c for c in data.objects if c.type == "CAMERA"])
diff --git a/ot/yafaray_operators.py b/ot/yafaray_operators.py
index f58efeb..fe5e27b 100644
--- a/ot/yafaray_operators.py
+++ b/ot/yafaray_operators.py
@@ -16,13 +16,14 @@
 #
 # ##### END GPL LICENSE BLOCK #####
 
+# <pep8 compliant>
+
 import bpy
-import math
 import mathutils
-from bpy.props import FloatProperty, StringProperty
+from bpy.types import Operator
 
 
-class OBJECT_OT_get_position(bpy.types.Operator):
+class OBJECT_OT_get_position(Operator):
     bl_label = "From( get position )"
     bl_idname = "world.get_position"
     bl_description = "Get position from selected sun lamp"
@@ -36,7 +37,7 @@ class OBJECT_OT_get_position(bpy.types.Operator):
             return{'FINISHED'}
 
 
-class OBJECT_OT_get_angle(bpy.types.Operator):
+class OBJECT_OT_get_angle(Operator):
     bl_label = "From( get angle )"
     bl_idname = "world.get_angle"
     bl_description = "Get angle from selected sun lamp"
@@ -50,7 +51,7 @@ class OBJECT_OT_get_angle(bpy.types.Operator):
             return{'FINISHED'}
 
 
-class OBJECT_OT_update_sun(bpy.types.Operator):
+class OBJECT_OT_update_sun(Operator):
     bl_label = "From( update sun )"
     bl_idname = "world.update_sun"
     bl_description = "Update position and angle of selected sun lamp according to GUI values"
@@ -68,7 +69,6 @@ def sunPosAngle(mode="get", val="position"):
     active_object = bpy.context.active_object
     scene = bpy.context.scene
     world = scene.world
-    warning_message = ""
 
     if active_object and active_object.type == "LAMP" and active_object.data.type == "SUN":
 
@@ -146,13 +146,13 @@ def checkSceneLights():
     return sceneLights
 
 
-class RENDER_OT_render_view(bpy.types.Operator):
+class RENDER_OT_render_view(Operator):
     bl_label = "YafaRay render view"
     bl_idname = "render.render_view"
     bl_description = "Renders using the view in the active 3d viewport"
 
     @classmethod
-    def poll(self, context):
+    def poll(cls, context):
 
         return context.scene.render.engine == 'YAFA_RENDER'
 
@@ -191,13 +191,13 @@ class RENDER_OT_render_view(bpy.types.Operator):
             return {'FINISHED'}
 
 
-class RENDER_OT_render_animation(bpy.types.Operator):
+class RENDER_OT_render_animation(Operator):
     bl_label = "YafaRay render animation"
     bl_idname = "render.render_animation"
     bl_description = "Render active scene"
 
     @classmethod
-    def poll(self, context):
+    def poll(cls, context):
 
         return context.scene.render.engine == 'YAFA_RENDER'
 
@@ -220,17 +220,19 @@ class RENDER_OT_render_animation(bpy.types.Operator):
             return {'FINISHED'}
 
 
-class RENDER_OT_render_still(bpy.types.Operator):
+class RENDER_OT_render_still(Operator):
     bl_label = "YafaRay render still"
     bl_idname = "render.render_still"
     bl_description = "Render active scene"
 
     @classmethod
-    def poll(self, context):
+    def poll(cls, context):
 
         # turn off Blenders color management for correct YafaRay render results
-        if context.scene.render.use_color_management:
-            context.scene.render.use_color_management = False
+        # YafaRay has own settings 'Gamma' and 'Gamma input' for linear workflow
+        render = context.scene.render
+        if render.use_color_management and render.engine == 'YAFA_RENDER':
+            render.use_color_management = False
         return context.scene.render.engine == 'YAFA_RENDER'
 
     def execute(self, context):
@@ -252,14 +254,14 @@ class RENDER_OT_render_still(bpy.types.Operator):
             return {'FINISHED'}
 
 
-class YAF_OT_presets_ior_list(bpy.types.Operator):
+class YAF_OT_presets_ior_list(Operator):
     bl_idname = "material.set_ior_preset"
     bl_label = "IOR presets"
     index = bpy.props.FloatProperty()
     name = bpy.props.StringProperty()
 
     @classmethod
-    def poll(self, context):
+    def poll(cls, context):
         yaf_mat = context.material
         return yaf_mat.mat_type in {"glass", "rough_glass"}
 
diff --git a/ot/yafaray_presets.py b/ot/yafaray_presets.py
index 21178ac..c1a76fd 100644
--- a/ot/yafaray_presets.py
+++ b/ot/yafaray_presets.py
@@ -16,7 +16,10 @@
 #
 # ##### END GPL LICENSE BLOCK #####
 
+# <pep8 compliant>
+
 import bpy
+from bpy.types import Operator
 import os
 import sys
 from bpy.path import clean_name, display_name
@@ -136,7 +139,7 @@ class YAF_AddPresetBase():
             return self.execute(context)
 
 
-class YAFARAY_OT_presets_renderset(YAF_AddPresetBase, bpy.types.Operator):
+class YAFARAY_OT_presets_renderset(YAF_AddPresetBase, Operator):
     '''Add a Yafaray Render Preset'''
     bl_idname = "yafaray.preset_add"
     bl_label = "Yafaray Render Presets"
diff --git a/prop/__init__.py b/prop/__init__.py
index ffb4ec0..373bf0d 100644
--- a/prop/__init__.py
+++ b/prop/__init__.py
@@ -16,6 +16,8 @@
 #
 # ##### END GPL LICENSE BLOCK #####
 
+# <pep8 compliant>
+
 from . import yaf_object
 from . import yaf_material
 from . import yaf_light
diff --git a/prop/yaf_camera.py b/prop/yaf_camera.py
index 698eebe..fbdd23a 100644
--- a/prop/yaf_camera.py
+++ b/prop/yaf_camera.py
@@ -16,6 +16,8 @@
 #
 # ##### END GPL LICENSE BLOCK #####
 
+# <pep8 compliant>
+
 import bpy
 from bpy.props import (FloatProperty,
                        EnumProperty,
diff --git a/prop/yaf_light.py b/prop/yaf_light.py
index d1c6f2c..1620ac0 100644
--- a/prop/yaf_light.py
+++ b/prop/yaf_light.py
@@ -16,6 +16,8 @@
 #
 # ##### END GPL LICENSE BLOCK #####
 
+# <pep8 compliant>
+
 import bpy
 from bpy.props import (EnumProperty,
                        BoolProperty,
@@ -27,10 +29,10 @@ Lamp = bpy.types.Lamp
 
 
 def call_lighttype_update(self, context):
-        lamp = context.lamp
-        if lamp is not None:
-            switchLampType = {'area': 'AREA', 'spot': 'SPOT', 'sun': 'SUN', 'point': 'POINT', 'ies': 'SPOT'}
-            lamp.type = switchLampType.get(lamp.lamp_type)
+    lamp = context.lamp
+    if lamp is not None:
+        switchLampType = {'area': 'AREA', 'spot': 'SPOT', 'sun': 'SUN', 'point': 'POINT', 'ies': 'SPOT'}
+        lamp.type = switchLampType.get(lamp.lamp_type)
 
 
 def register():
diff --git a/prop/yaf_material.py b/prop/yaf_material.py
index cf992b3..e607194 100644
--- a/prop/yaf_material.py
+++ b/prop/yaf_material.py
@@ -16,6 +16,8 @@
 #
 # ##### END GPL LICENSE BLOCK #####
 
+# <pep8 compliant>
+
 import bpy
 from bpy.props import (FloatProperty,
                        BoolProperty,
@@ -248,12 +250,12 @@ def register():
 
     Material.material1 = StringProperty(
         name="Material One",
-        description="First Blend Material. Same material if nothing is set.",
+        description="First Blend Material. Same material if nothing is set",
         default="")
 
     Material.material2 = StringProperty(
         name="Material Two",
-        description="Second Blend Material. Same material if nothing is set.",
+        description="Second Blend Material. Same material if nothing is set",
         default="")
 
 
diff --git a/prop/yaf_object.py b/prop/yaf_object.py
index c2bfcea..fcd5973 100644
--- a/prop/yaf_object.py
+++ b/prop/yaf_object.py
@@ -16,6 +16,8 @@
 #
 # ##### END GPL LICENSE BLOCK #####
 
+# <pep8 compliant>
+
 import bpy
 from bpy.props import (FloatVectorProperty,
                        FloatProperty,
diff --git a/prop/yaf_scene.py b/prop/yaf_scene.py
index ea40a24..c49c1e8 100644
--- a/prop/yaf_scene.py
+++ b/prop/yaf_scene.py
@@ -16,6 +16,8 @@
 #
 # ##### END GPL LICENSE BLOCK #####
 
+# <pep8 compliant>
+
 import bpy
 from sys import platform
 from bpy.props import (IntProperty,
@@ -30,12 +32,12 @@ Scene = bpy.types.Scene
 
 # set fileformat for image saving on same format as in YafaRay, both have default PNG
 def call_update_fileformat(self, context):
-    sc = context.scene
-    rd = sc.render
-    if sc.img_output != rd.file_format:
-        rd.file_format = sc.img_output
-        if rd.file_format == "OPEN_EXR" and sc.gs_z_channel:
-            rd.exr_zbuf = True
+    scene = context.scene
+    render = scene.render
+    if scene.img_output != render.image_settings.file_format:
+        render.image_settings.file_format = scene.img_output
+        if render.image_settings.file_format == "OPEN_EXR" and scene.gs_z_channel:
+            render.image_settings.use_zbuffer = True
 
 
 def register():
@@ -117,7 +119,7 @@ def register():
     Scene.gs_custom_string = StringProperty(
         name="Custom string",
         description="Custom string will be added to the info bar, "
-                    "use it for CPU, RAM etc.",
+                    "use it for CPU, RAM etc",
         default="")
 
     Scene.gs_premult = BoolProperty(
@@ -229,7 +231,7 @@ def register():
 
     Scene.intg_AO_distance = FloatProperty(
         name="Distance",
-        description=("Max. occlusion distance."
+        description=("Max. occlusion distance,"
                      " Surfaces further away do not occlude ambient light"),
         min=0.0, max=10000.0,
         default=1.0)
@@ -357,7 +359,7 @@ def register():
 
     Scene.AA_passes = IntProperty(
         name="Passes",
-        description=("Number of anti-aliasing passes."
+        description=("Number of anti-aliasing passes,"
                      " Adaptive sampling (passes > 1) uses different pattern"),
         min=1,
         default=1)
diff --git a/prop/yaf_texture.py b/prop/yaf_texture.py
index 5cf4b29..063025b 100644
--- a/prop/yaf_texture.py
+++ b/prop/yaf_texture.py
@@ -16,19 +16,23 @@
 #
 # ##### END GPL LICENSE BLOCK #####
 
+# <pep8 compliant>
+
 import bpy
 from bpy.props import (EnumProperty,
-                       StringProperty,
                        BoolProperty)
 
 Texture = bpy.types.Texture
 
 
-# update blender propertie texture.type to YafaRay's texture.yaf_tex_type
+# try to update blender propertie texture.type to YafaRay's texture.yaf_tex_type
 def call_tex_type_update(self, context):
-    tex = context.texture
-    if tex is not None:
-        tex.type = tex.yaf_tex_type
+    try:
+        tex = context.texture
+        if tex is not None:
+            tex.type = tex.yaf_tex_type
+    except:
+        pass
 
 
 def register():
@@ -48,15 +52,6 @@ def register():
         update=call_tex_type_update,
         default='NONE')
 
-    Texture.yaf_tex_interpolate = EnumProperty(
-        name="Interpolation",
-        items=(
-            ('bilinear', "Bilinear", ""),
-            ('bicubic', "Bicubic", ""),
-            ('none', "None", "")
-        ),
-        default='bilinear')
-
     Texture.yaf_is_normal_map = BoolProperty(
         name="Use map as normal map",
         description="Use image RGB values for normal mapping",
@@ -65,5 +60,4 @@ def register():
 
 def unregister():
     Texture.yaf_tex_type
-    Texture.yaf_tex_interpolate
     Texture.yaf_is_normal_map
diff --git a/prop/yaf_world.py b/prop/yaf_world.py
index 1e4e264..9bbf587 100644
--- a/prop/yaf_world.py
+++ b/prop/yaf_world.py
@@ -16,6 +16,8 @@
 #
 # ##### END GPL LICENSE BLOCK #####
 
+# <pep8 compliant>
+
 import bpy
 from bpy.props import (EnumProperty,
                        FloatProperty,
@@ -28,7 +30,7 @@ World = bpy.types.World
 
 def call_world_update(self, context):
     world = context.scene.world
-    world.ambient_color = world.ambient_color
+    world.ambient_color.update_tag()
 
 
 def register():
@@ -231,7 +233,7 @@ def register():
     World.bg_power = FloatProperty(
         name="Skylight power",
         description="Multiplier for background color",
-        min=0.0, max=10.0,
+        min=0.0,
         default=1.0,
         update=call_world_update)
 
@@ -259,6 +261,7 @@ def register():
         description="Set the volume integrator",
         items=(
             ('None', "None", ""),
+            ('Sky', "Sky", ""),
             ('Single Scatter', "Single Scatter", "")
         ),
         default='None')
@@ -287,9 +290,22 @@ def register():
         default=1)
 
     # ??? not sure about the following properties ???
-    # World.v_int_scale = FloatProperty(attr = "v_int_scale")
-    # World.v_int_alpha =       FloatProperty(attr = "v_int_alpha")
-    # World.v_int_dsturbidity = FloatProperty(attr = "v_int_dsturbidity")
+    World.v_int_scale = FloatProperty(
+        name="Sigma T",
+        min=0.0, precision=3,
+        description="",
+        default=0.100)
+
+    World.v_int_alpha = FloatProperty(
+        name="Alpha",
+        min=0.0, precision=3,
+        description="",
+        default=0.500)
+
+    World.v_int_dsturbidity = FloatProperty(
+        name="Turbidity",
+        description="",
+        default=3.0)
 
 
 def unregister():
@@ -330,3 +346,6 @@ def unregister():
     World.v_int_adaptive
     World.v_int_optimize
     World.v_int_attgridres
+    World.v_int_scale
+    World.v_int_alpha
+    World.v_int_dsturbidity
diff --git a/ui/__init__.py b/ui/__init__.py
index e70856b..8f6e52c 100644
--- a/ui/__init__.py
+++ b/ui/__init__.py
@@ -16,6 +16,8 @@
 #
 # ##### END GPL LICENSE BLOCK #####
 
+# <pep8 compliant>
+
 from . import properties_yaf_render
 from . import properties_yaf_camera
 from . import properties_yaf_material
@@ -51,3 +53,22 @@ for member in dir(properties_data_mesh):  # add all "object data" panels from bl
     except:
         pass
 del properties_data_mesh
+
+from bl_ui import properties_data_speaker as properties_data_speaker
+for member in dir(properties_data_speaker):  # add all "speaker (SOC 2011, pepper branch)" panels from blender
+    subclass = getattr(properties_data_speaker, member)
+    try:
+        subclass.COMPAT_ENGINES.add('YAFA_RENDER')
+    except:
+        pass
+del properties_data_speaker
+
+# YafaRay did not display the Scene panels anymore, due to addition of COMPAT_ENGINES to them
+from bl_ui import properties_scene as properties_scene
+for member in dir(properties_scene):
+    subclass = getattr(properties_scene, member)
+    try:
+        subclass.COMPAT_ENGINES.add('YAFA_RENDER')
+    except:
+        pass
+del properties_scene
diff --git a/ui/ior_values.py b/ui/ior_values.py
index eeaf5a4..4f7f882 100644
--- a/ui/ior_values.py
+++ b/ui/ior_values.py
@@ -16,6 +16,8 @@
 #
 # ##### END GPL LICENSE BLOCK #####
 
+# <pep8 compliant>
+
 ior_list = [
     ('Liquid', [
         ('Acetone', 1.360),
diff --git a/ui/properties_yaf_AA_settings.py b/ui/properties_yaf_AA_settings.py
index f594859..8c247df 100644
--- a/ui/properties_yaf_AA_settings.py
+++ b/ui/properties_yaf_AA_settings.py
@@ -16,13 +16,16 @@
 #
 # ##### END GPL LICENSE BLOCK #####
 
+# <pep8 compliant>
+
 import bpy
+from bpy.types import Panel
 from bl_ui.properties_render import RenderButtonsPanel
 
 RenderButtonsPanel.COMPAT_ENGINES = {'YAFA_RENDER'}
 
 
-class YAF_PT_AA_settings(RenderButtonsPanel, bpy.types.Panel):
+class YAF_PT_AA_settings(RenderButtonsPanel, Panel):
     bl_label = "Anti-Aliasing Settings"
 
     def draw(self, context):
@@ -42,3 +45,8 @@ class YAF_PT_AA_settings(RenderButtonsPanel, bpy.types.Panel):
         sub.enabled = scene.AA_passes > 1
         sub.prop(scene, "AA_inc_samples")
         sub.prop(scene, "AA_threshold")
+
+
+if __name__ == "__main__":  # only for live edit.
+    import bpy
+    bpy.utils.register_module(__name__)
diff --git a/ui/properties_yaf_camera.py b/ui/properties_yaf_camera.py
index 39d07be..17d2e49 100644
--- a/ui/properties_yaf_camera.py
+++ b/ui/properties_yaf_camera.py
@@ -16,14 +16,17 @@
 #
 # ##### END GPL LICENSE BLOCK #####
 
+# <pep8 compliant>
+
 import bpy
+from bpy.types import Panel
 from bl_ui.properties_data_camera import CameraButtonsPanel
 
 CameraButtonsPanel.COMPAT_ENGINES = {'YAFA_RENDER'}
 
 
-class YAF_PT_camera(CameraButtonsPanel, bpy.types.Panel):
-    bl_label = "Camera"
+class YAF_PT_lens(CameraButtonsPanel, Panel):
+    bl_label = "Lens"
 
     def draw(self, context):
         layout = self.layout
@@ -61,8 +64,48 @@ class YAF_PT_camera(CameraButtonsPanel, bpy.types.Panel):
             layout.prop(camera, "bokeh_bias")
             layout.prop(camera, "bokeh_rotation")
 
+        layout.separator()
+        split = layout.split()
+        col = split.column()
+        col.prop(camera, "use_clipping")
+
+        col = split.column(align=True)
+        sub = col.column()
+        sub.active = camera.use_clipping
+        sub.prop(camera, "clip_start", text="Start")
+        sub.prop(camera, "clip_end", text="End")
+
+
+class YAF_PT_camera(CameraButtonsPanel, Panel):
+    bl_label = "Camera"
+
+    def draw(self, context):
+        layout = self.layout
+
+        camera = context.camera
+
+        row = layout.row(align=True)
 
-class YAF_PT_camera_display(CameraButtonsPanel, bpy.types.Panel):
+        row.menu("CAMERA_MT_presets", text=bpy.types.CAMERA_MT_presets.bl_label)
+        row.operator("camera.preset_add", text="", icon="ZOOMIN")
+        row.operator("camera.preset_add", text="", icon="ZOOMOUT").remove_active = True
+
+        layout.label(text="Sensor:")
+
+        split = layout.split()
+
+        col = split.column(align=True)
+        if camera.sensor_fit == 'AUTO':
+            col.prop(camera, "sensor_width", text="Size")
+        else:
+            col.prop(camera, "sensor_width", text="Width")
+            col.prop(camera, "sensor_height", text="Height")
+
+        col = split.column(align=True)
+        col.prop(camera, "sensor_fit", text="")
+
+
+class YAF_PT_camera_display(CameraButtonsPanel, Panel):
     bl_label = "Display"
 
     def draw(self, context):
@@ -73,26 +116,20 @@ class YAF_PT_camera_display(CameraButtonsPanel, bpy.types.Panel):
         split = layout.split()
 
         col = split.column()
-        col.prop(camera, "show_limits")
-        col.prop(camera, "show_title_safe")
-        col.prop(camera, "show_name")
+        col.prop(camera, "show_limits", text="Limits")
+        col.prop(camera, "show_title_safe", text="Title Safe")
+        col.prop(camera, "show_sensor", text="Sensor")
+        col.prop(camera, "show_name", text="Name")
 
         col = split.column()
+        col.prop_menu_enum(camera, "show_guide")
         col.prop(camera, "draw_size", text="Size")
         col.prop(camera, "show_passepartout", text="Passepartout")
         sub = col.column()
         sub.active = camera.show_passepartout
         sub.prop(camera, "passepartout_alpha", text="Alpha", slider=True)
 
-        layout.separator()
-        layout.prop(camera, "use_clipping")
-
-        split = layout.split()
-        col = split.column(align=True)
-        clip = col.column()
-        clip.active = camera.use_clipping
-        clip.prop(camera, "clip_start", text="Start")
-        clip.prop(camera, "clip_end", text="End")
 
-        col = split.column()
-        col.prop_menu_enum(camera, "show_guide")
+if __name__ == "__main__":  # only for live edit.
+    import bpy
+    bpy.utils.register_module(__name__)
diff --git a/ui/properties_yaf_general_settings.py b/ui/properties_yaf_general_settings.py
index ec4dcc0..7dc0904 100644
--- a/ui/properties_yaf_general_settings.py
+++ b/ui/properties_yaf_general_settings.py
@@ -16,21 +16,24 @@
 #
 # ##### END GPL LICENSE BLOCK #####
 
+# <pep8 compliant>
+
 import bpy
-from ..ot import yafaray_presets
+from yafaray.ot import yafaray_presets
 from bl_ui.properties_render import RenderButtonsPanel
+from bpy.types import Panel, Menu
 
 RenderButtonsPanel.COMPAT_ENGINES = {'YAFA_RENDER'}
 
 
-class YAFARAY_MT_presets_render(bpy.types.Menu):
+class YAFARAY_MT_presets_render(Menu):
     bl_label = "Yafaray Render Presets"
     preset_subdir = "render"
     preset_operator = "script.execute_preset"
     draw = yafaray_presets.Yafaray_Menu.draw_preset
 
 
-class YAF_PT_general_settings(RenderButtonsPanel, bpy.types.Panel):
+class YAF_PT_general_settings(RenderButtonsPanel, Panel):
     bl_label = "General Settings"
 
     def draw(self, context):
@@ -90,3 +93,8 @@ class YAF_PT_general_settings(RenderButtonsPanel, bpy.types.Panel):
         col = layout.column()
         col.enabled = scene.gs_draw_params
         col.prop(scene, "gs_custom_string")
+
+
+if __name__ == "__main__":  # only for live edit.
+    import bpy
+    bpy.utils.register_module(__name__)
diff --git a/ui/properties_yaf_integrator.py b/ui/properties_yaf_integrator.py
index d95bde9..2c097db 100644
--- a/ui/properties_yaf_integrator.py
+++ b/ui/properties_yaf_integrator.py
@@ -16,13 +16,16 @@
 #
 # ##### END GPL LICENSE BLOCK #####
 
+# <pep8 compliant>
+
 import bpy
+from bpy.types import Panel
 from bl_ui.properties_render import RenderButtonsPanel
 
 RenderButtonsPanel.COMPAT_ENGINES = {'YAFA_RENDER'}
 
 
-class YAF_PT_render(RenderButtonsPanel, bpy.types.Panel):
+class YAF_PT_render(RenderButtonsPanel, Panel):
     bl_label = "Yafaray Integrator"
 
     def draw(self, context):
@@ -109,3 +112,8 @@ class YAF_PT_render(RenderButtonsPanel, bpy.types.Panel):
             col.prop(scene, "intg_diffuse_radius")
             col.prop(scene, "intg_search")
             col.prop(scene, "intg_pm_ire")
+
+
+if __name__ == "__main__":  # only for live edit.
+    import bpy
+    bpy.utils.register_module(__name__)
diff --git a/ui/properties_yaf_light.py b/ui/properties_yaf_light.py
index 31f14d5..3af71a5 100644
--- a/ui/properties_yaf_light.py
+++ b/ui/properties_yaf_light.py
@@ -16,7 +16,9 @@
 #
 # ##### END GPL LICENSE BLOCK #####
 
-import bpy
+# <pep8 compliant>
+
+from bpy.types import Panel
 
 
 class LampButtonsPanel():
@@ -33,7 +35,7 @@ class LampButtonsPanel():
         return lamp and ((lamp.lamp_type == cls.lamp_type) and (lamp.type == switchLampType.get(lamp.lamp_type, None)) and (engine in cls.COMPAT_ENGINES))
 
 
-class YAF_PT_preview(bpy.types.Panel):
+class YAF_PT_preview(Panel):
     bl_space_type = 'PROPERTIES'
     bl_region_type = 'WINDOW'
     bl_context = "data"
@@ -49,7 +51,7 @@ class YAF_PT_preview(bpy.types.Panel):
         self.layout.template_preview(context.lamp)
 
 
-class YAF_PT_lamp_type(bpy.types.Panel):
+class YAF_PT_lamp_type(Panel):
     bl_space_type = 'PROPERTIES'
     bl_region_type = 'WINDOW'
     bl_context = "data"
@@ -68,7 +70,7 @@ class YAF_PT_lamp_type(bpy.types.Panel):
         layout.prop(lamp, "lamp_type", expand=True)
 
 
-class YAF_PT_lamp_area(LampButtonsPanel, bpy.types.Panel):
+class YAF_PT_lamp_area(LampButtonsPanel, Panel):
     bl_label = "Area lamp settings"
     lamp_type = 'area'
 
@@ -82,7 +84,7 @@ class YAF_PT_lamp_area(LampButtonsPanel, bpy.types.Panel):
         layout.prop(lamp, "create_geometry")
 
 
-class YAF_PT_lamp_spot(LampButtonsPanel, bpy.types.Panel):
+class YAF_PT_lamp_spot(LampButtonsPanel, Panel):
     bl_label = "Spot lamp settings"
     lamp_type = 'spot'
 
@@ -102,7 +104,7 @@ class YAF_PT_lamp_spot(LampButtonsPanel, bpy.types.Panel):
         layout.prop(lamp, "photon_only")
 
 
-class YAF_PT_spotshape(LampButtonsPanel, bpy.types.Panel):
+class YAF_PT_spotshape(LampButtonsPanel, Panel):
     bl_label = "Spot shape settings"
     lamp_type = 'spot'
 
@@ -121,7 +123,7 @@ class YAF_PT_spotshape(LampButtonsPanel, bpy.types.Panel):
         col.prop(lamp, "spot_blend", text="Blend", slider=True)
 
 
-class YAF_PT_lamp_sun(LampButtonsPanel, bpy.types.Panel):
+class YAF_PT_lamp_sun(LampButtonsPanel, Panel):
     bl_label = "Sun lamp settings"
     lamp_type = 'sun'
 
@@ -140,7 +142,7 @@ class YAF_PT_lamp_sun(LampButtonsPanel, bpy.types.Panel):
             box.prop(lamp, "infinite")
 
 
-class YAF_PT_lamp_point(LampButtonsPanel, bpy.types.Panel):
+class YAF_PT_lamp_point(LampButtonsPanel, Panel):
     bl_label = "Point lamp settings"
     lamp_type = 'point'
 
@@ -159,7 +161,7 @@ class YAF_PT_lamp_point(LampButtonsPanel, bpy.types.Panel):
                 box.prop(lamp, "create_geometry")
 
 
-class YAF_PT_lamp_ies(LampButtonsPanel, bpy.types.Panel):
+class YAF_PT_lamp_ies(LampButtonsPanel, Panel):
     bl_label = "IES lamp settings"
     lamp_type = 'ies'
 
@@ -173,3 +175,8 @@ class YAF_PT_lamp_ies(LampButtonsPanel, bpy.types.Panel):
         layout.prop(lamp, "ies_soft_shadows", toggle=True)
         if lamp.ies_soft_shadows:
             layout.box().prop(lamp, "yaf_samples")
+
+
+if __name__ == "__main__":  # only for live edit.
+    import bpy
+    bpy.utils.register_module(__name__)
diff --git a/ui/properties_yaf_material.py b/ui/properties_yaf_material.py
index 5e94beb..23bcf8b 100644
--- a/ui/properties_yaf_material.py
+++ b/ui/properties_yaf_material.py
@@ -16,10 +16,12 @@
 #
 # ##### END GPL LICENSE BLOCK #####
 
+# <pep8 compliant>
+
 import bpy
-from .ior_values import ior_list
-from bl_ui.properties_material import (MATERIAL_MT_specials,
-                                       MaterialButtonsPanel,
+from yafaray.ui.ior_values import ior_list
+from bpy.types import Panel, Menu
+from bl_ui.properties_material import (MaterialButtonsPanel,
                                        active_node_mat,
                                        check_material)
 
@@ -36,7 +38,7 @@ class MaterialTypePanel(MaterialButtonsPanel):
         return check_material(yaf_mat) and (yaf_mat.mat_type in cls.material_type) and (engine in cls.COMPAT_ENGINES)
 
 
-class YAF_PT_context_material(MaterialButtonsPanel, bpy.types.Panel):
+class YAF_PT_context_material(MaterialButtonsPanel, Panel):
     bl_label = ""
     bl_options = {'HIDE_HEADER'}
     COMPAT_ENGINES = {'YAFA_RENDER'}
@@ -93,7 +95,7 @@ class YAF_PT_context_material(MaterialButtonsPanel, bpy.types.Panel):
             layout.prop(yaf_mat, "mat_type")
 
 
-class YAF_MATERIAL_PT_preview(MaterialButtonsPanel, bpy.types.Panel):
+class YAF_MATERIAL_PT_preview(MaterialButtonsPanel, Panel):
     bl_label = "Preview"
 
     def draw(self, context):
@@ -117,7 +119,7 @@ for ior_group, ior_n in ior_list:
     submenu_idname = 'YAF_MT_presets_ior_list_cat%d' % len(submenus)
     submenu = type(
         submenu_idname,
-        (bpy.types.Menu,),
+        (Menu,),
         {
             'bl_idname': submenu_idname,
             'bl_label': ior_group,
@@ -128,7 +130,7 @@ for ior_group, ior_n in ior_list:
     submenus.append(submenu)
 
 
-class YAF_MT_presets_ior_list(bpy.types.Menu):
+class YAF_MT_presets_ior_list(Menu):
     bl_label = "Glass"
 
     def draw(self, context):
@@ -137,7 +139,7 @@ class YAF_MT_presets_ior_list(bpy.types.Menu):
             sl.menu(sm.bl_idname)
 
 
-class YAF_PT_shinydiffuse_diffuse(MaterialTypePanel, bpy.types.Panel):
+class YAF_PT_shinydiffuse_diffuse(MaterialTypePanel, Panel):
     bl_label = "Diffuse reflection"
     material_type = 'shinydiffusemat'
 
@@ -171,7 +173,7 @@ class YAF_PT_shinydiffuse_diffuse(MaterialTypePanel, bpy.types.Panel):
         box.row().prop(yaf_mat, "transmit_filter", slider=True)
 
 
-class YAF_PT_shinydiffuse_specular(MaterialTypePanel, bpy.types.Panel):
+class YAF_PT_shinydiffuse_specular(MaterialTypePanel, Panel):
     bl_label = "Specular reflection"
     material_type = 'shinydiffusemat'
 
@@ -192,7 +194,7 @@ class YAF_PT_shinydiffuse_specular(MaterialTypePanel, bpy.types.Panel):
         layout.row().prop(yaf_mat, "specular_reflect", slider=True)
 
 
-class YAF_PT_glossy_diffuse(MaterialTypePanel, bpy.types.Panel):
+class YAF_PT_glossy_diffuse(MaterialTypePanel, Panel):
     bl_label = "Diffuse reflection"
     material_type = 'glossy', 'coated_glossy'
 
@@ -214,7 +216,7 @@ class YAF_PT_glossy_diffuse(MaterialTypePanel, bpy.types.Panel):
         layout.row().prop(yaf_mat, "diffuse_reflect", slider=True)
 
 
-class YAF_PT_glossy_specular(MaterialTypePanel, bpy.types.Panel):
+class YAF_PT_glossy_specular(MaterialTypePanel, Panel):
     bl_label = "Specular reflection"
     material_type = 'glossy', 'coated_glossy'
 
@@ -253,7 +255,7 @@ class YAF_PT_glossy_specular(MaterialTypePanel, bpy.types.Panel):
             col.label()
 
 
-class YAF_PT_glass_real(MaterialTypePanel, bpy.types.Panel):
+class YAF_PT_glass_real(MaterialTypePanel, Panel):
     bl_label = "Real glass settings"
     material_type = 'glass', 'rough_glass'
 
@@ -284,7 +286,7 @@ class YAF_PT_glass_real(MaterialTypePanel, bpy.types.Panel):
             box.row().prop(yaf_mat, "refr_roughness", slider=True)
 
 
-class YAF_PT_glass_fake(MaterialTypePanel, bpy.types.Panel):
+class YAF_PT_glass_fake(MaterialTypePanel, Panel):
     bl_label = "Fake glass settings"
     material_type = 'glass', 'rough_glass'
 
@@ -301,7 +303,7 @@ class YAF_PT_glass_fake(MaterialTypePanel, bpy.types.Panel):
         layout.row().prop(yaf_mat, "fake_shadows")
 
 
-class YAF_PT_blend_(MaterialTypePanel, bpy.types.Panel):
+class YAF_PT_blend_(MaterialTypePanel, Panel):
     bl_label = "Blend material settings"
     material_type = 'blend'
 
@@ -326,3 +328,8 @@ class YAF_PT_blend_(MaterialTypePanel, bpy.types.Panel):
         col = split.column()
         col.label(text="Material Two:")
         col.prop_search(yaf_mat, "material2", bpy.data, 'materials', text="")
+
+
+if __name__ == "__main__":  # only for live edit.
+    import bpy
+    bpy.utils.register_module(__name__)
diff --git a/ui/properties_yaf_object.py b/ui/properties_yaf_object.py
index 8fce986..bd5908a 100644
--- a/ui/properties_yaf_object.py
+++ b/ui/properties_yaf_object.py
@@ -16,10 +16,12 @@
 #
 # ##### END GPL LICENSE BLOCK #####
 
-import bpy
+# <pep8 compliant>
 
+from bpy.types import Panel
 
-class YAF_PT_object_light(bpy.types.Panel):
+
+class YAF_PT_object_light(Panel):
     bl_label = "YafaRay Object Properties"
     bl_space_type = 'PROPERTIES'
     bl_region_type = 'WINDOW'
@@ -75,3 +77,8 @@ class YAF_PT_object_light(bpy.types.Panel):
                 col.prop(ob, "vol_sharpness")
                 col.prop(ob, "vol_cover")
                 col.prop(ob, "vol_density")
+
+
+if __name__ == "__main__":  # only for live edit.
+    import bpy
+    bpy.utils.register_module(__name__)
diff --git a/ui/properties_yaf_render.py b/ui/properties_yaf_render.py
index 81bd50a..40a89b2 100644
--- a/ui/properties_yaf_render.py
+++ b/ui/properties_yaf_render.py
@@ -16,13 +16,16 @@
 #
 # ##### END GPL LICENSE BLOCK #####
 
+# <pep8 compliant>
+
 import bpy
+from bpy.types import Panel
 from bl_ui.properties_render import RenderButtonsPanel
 
 RenderButtonsPanel.COMPAT_ENGINES = {'YAFA_RENDER'}
 
 
-class YAFRENDER_PT_render(RenderButtonsPanel, bpy.types.Panel):
+class YAFRENDER_PT_render(RenderButtonsPanel, Panel):
     bl_label = "Render"
 
     def draw(self, context):
@@ -37,7 +40,7 @@ class YAFRENDER_PT_render(RenderButtonsPanel, bpy.types.Panel):
         layout.prop(rd, "display_mode", text="Display")
 
 
-class YAFRENDER_PT_dimensions(RenderButtonsPanel, bpy.types.Panel):
+class YAFRENDER_PT_dimensions(RenderButtonsPanel, Panel):
     bl_label = "Dimensions"
     bl_options = {'DEFAULT_CLOSED'}
 
@@ -76,7 +79,7 @@ from . import properties_yaf_integrator
 from . import properties_yaf_AA_settings
 
 
-class YAFRENDER_PT_output(RenderButtonsPanel, bpy.types.Panel):
+class YAFRENDER_PT_output(RenderButtonsPanel, Panel):
     bl_label = "Output Settings"
 
     def draw(self, context):
@@ -84,6 +87,7 @@ class YAFRENDER_PT_output(RenderButtonsPanel, bpy.types.Panel):
 
         rd = context.scene.render
         sc = context.scene
+        image_settings = rd.image_settings
 
         layout.prop(rd, "filepath", text="")
 
@@ -91,10 +95,10 @@ class YAFRENDER_PT_output(RenderButtonsPanel, bpy.types.Panel):
         col = split.column()
         col.prop(sc, "img_output", text="", icon='IMAGE_DATA')
         col = split.column()
-        col.row().prop(rd, "color_mode", text="Color", expand=True)
+        col.row().prop(image_settings, "color_mode", text="Color", expand=True)
 
 
-class YAFRENDER_PT_post_processing(RenderButtonsPanel, bpy.types.Panel):
+class YAFRENDER_PT_post_processing(RenderButtonsPanel, Panel):
     bl_label = "Post Processing"
     bl_options = {'DEFAULT_CLOSED'}
 
@@ -113,9 +117,14 @@ class YAFRENDER_PT_post_processing(RenderButtonsPanel, bpy.types.Panel):
         col.prop(rd, "dither_intensity", text="Dither", slider=True)
 
 
-class YAF_PT_convert(RenderButtonsPanel, bpy.types.Panel):
+class YAF_PT_convert(RenderButtonsPanel, Panel):
     bl_label = "Convert old YafaRay Settings"
 
     def draw(self, context):
         layout = self.layout
         layout.column().operator("data.convert_yafaray_properties", text="Convert data from 2.4x")
+
+
+if __name__ == "__main__":  # only for live edit.
+    import bpy
+    bpy.utils.register_module(__name__)
diff --git a/ui/properties_yaf_strand.py b/ui/properties_yaf_strand.py
index 90119c5..8f0b307 100644
--- a/ui/properties_yaf_strand.py
+++ b/ui/properties_yaf_strand.py
@@ -16,10 +16,12 @@
 #
 # ##### END GPL LICENSE BLOCK #####
 
-import bpy
+# <pep8 compliant>
 
+from bpy.types import Panel
 
-class YAF_PT_strand_settings(bpy.types.Panel):
+
+class YAF_PT_strand_settings(Panel):
     bl_label = "Strand Settings"
     bl_space_type = 'PROPERTIES'
     bl_region_type = 'WINDOW'
@@ -59,3 +61,8 @@ class YAF_PT_strand_settings(bpy.types.Panel):
                 col.prop_search(tan, "uv_layer", ob.data, "uv_textures", text="")
             else:
                 col.prop(tan, "uv_layer", text="")
+
+
+if __name__ == "__main__":  # only for live edit.
+    import bpy
+    bpy.utils.register_module(__name__)
diff --git a/ui/properties_yaf_texture.py b/ui/properties_yaf_texture.py
index 3e551da..98c5b3a 100644
--- a/ui/properties_yaf_texture.py
+++ b/ui/properties_yaf_texture.py
@@ -16,9 +16,11 @@
 #
 # ##### END GPL LICENSE BLOCK #####
 
+# <pep8 compliant>
+
 import bpy
-from bl_ui.properties_material import active_node_mat
 from bl_ui.properties_texture import context_tex_datablock
+from bpy.types import Panel
 
 
 class YAF_TextureButtonsPanel():
@@ -33,7 +35,7 @@ class YAF_TextureButtonsPanel():
         return tex and (tex.yaf_tex_type != 'NONE' or tex.use_nodes) and (context.scene.render.engine in cls.COMPAT_ENGINES)
 
 
-class YAF_TEXTURE_PT_context_texture(YAF_TextureButtonsPanel, bpy.types.Panel):
+class YAF_TEXTURE_PT_context_texture(YAF_TextureButtonsPanel, Panel):
     bl_label = "YafaRay Textures"
     bl_options = {'HIDE_HEADER'}
     COMPAT_ENGINES = {'YAFA_RENDER'}
@@ -106,7 +108,7 @@ class YAF_TEXTURE_PT_context_texture(YAF_TextureButtonsPanel, bpy.types.Panel):
                 split.prop(tex, "yaf_tex_type", text="")
 
 
-class YAF_TEXTURE_PT_preview(YAF_TextureButtonsPanel, bpy.types.Panel):
+class YAF_TEXTURE_PT_preview(YAF_TextureButtonsPanel, Panel):
     bl_label = "Preview"
     COMPAT_ENGINES = {'YAFA_RENDER'}
 
@@ -145,7 +147,7 @@ class YAF_TextureTypePanel(YAF_TextureButtonsPanel):
         return tex and ((tex.yaf_tex_type == cls.tex_type and not tex.use_nodes) and (engine in cls.COMPAT_ENGINES))
 
 
-class YAF_TEXTURE_PT_clouds(YAF_TextureTypePanel, bpy.types.Panel):
+class YAF_TEXTURE_PT_clouds(YAF_TextureTypePanel, Panel):
     bl_label = "Clouds"
     tex_type = 'CLOUDS'
     COMPAT_ENGINES = {'YAFA_RENDER'}
@@ -167,7 +169,7 @@ class YAF_TEXTURE_PT_clouds(YAF_TextureTypePanel, bpy.types.Panel):
         split.prop(tex, "noise_depth", text="Depth")
 
 
-class YAF_TEXTURE_PT_wood(YAF_TextureTypePanel, bpy.types.Panel):
+class YAF_TEXTURE_PT_wood(YAF_TextureTypePanel, Panel):
     bl_label = "Wood"
     tex_type = 'WOOD'
     COMPAT_ENGINES = {'YAFA_RENDER'}
@@ -194,7 +196,7 @@ class YAF_TEXTURE_PT_wood(YAF_TextureTypePanel, bpy.types.Panel):
         split.prop(tex, "turbulence")
 
 
-class YAF_TEXTURE_PT_marble(YAF_TextureTypePanel, bpy.types.Panel):
+class YAF_TEXTURE_PT_marble(YAF_TextureTypePanel, Panel):
     bl_label = "Marble"
     tex_type = 'MARBLE'
     COMPAT_ENGINES = {'YAFA_RENDER'}
@@ -218,7 +220,7 @@ class YAF_TEXTURE_PT_marble(YAF_TextureTypePanel, bpy.types.Panel):
         split.prop(tex, "turbulence")
 
 
-class YAF_TEXTURE_PT_blend(YAF_TextureTypePanel, bpy.types.Panel):
+class YAF_TEXTURE_PT_blend(YAF_TextureTypePanel, Panel):
     bl_label = "Blend"
     tex_type = 'BLEND'
     COMPAT_ENGINES = {'YAFA_RENDER'}
@@ -234,7 +236,7 @@ class YAF_TEXTURE_PT_blend(YAF_TextureTypePanel, bpy.types.Panel):
             layout.label(text=" ")
 
 
-class YAF_TEXTURE_PT_image(YAF_TextureTypePanel, bpy.types.Panel):
+class YAF_TEXTURE_PT_image(YAF_TextureTypePanel, Panel):
     bl_label = "Map Image"
     tex_type = 'IMAGE'
     COMPAT_ENGINES = {'YAFA_RENDER'}
@@ -246,7 +248,7 @@ class YAF_TEXTURE_PT_image(YAF_TextureTypePanel, bpy.types.Panel):
         layout.template_image(tex, "image", tex.image_user)
 
 
-class YAF_TEXTURE_PT_image_sampling(YAF_TextureTypePanel, bpy.types.Panel):
+class YAF_TEXTURE_PT_image_sampling(YAF_TextureTypePanel, Panel):
     bl_label = "Image Sampling"
     bl_options = {'DEFAULT_CLOSED'}
     tex_type = 'IMAGE'
@@ -262,7 +264,7 @@ class YAF_TEXTURE_PT_image_sampling(YAF_TextureTypePanel, bpy.types.Panel):
         layout.prop(tex, "use_flip_axis", text="Flip X/Y Axis")
 
 
-class YAF_TEXTURE_PT_image_mapping(YAF_TextureTypePanel, bpy.types.Panel):
+class YAF_TEXTURE_PT_image_mapping(YAF_TextureTypePanel, Panel):
     bl_label = "Image Mapping"
     bl_options = {'DEFAULT_CLOSED'}
     tex_type = 'IMAGE'
@@ -308,7 +310,7 @@ class YAF_TEXTURE_PT_image_mapping(YAF_TextureTypePanel, bpy.types.Panel):
         col.prop(tex, "crop_max_y", text="Y")
 
 
-class YAF_TEXTURE_PT_musgrave(YAF_TextureTypePanel, bpy.types.Panel):
+class YAF_TEXTURE_PT_musgrave(YAF_TextureTypePanel, Panel):
     bl_label = "Musgrave"
     tex_type = 'MUSGRAVE'
     COMPAT_ENGINES = {'YAFA_RENDER'}
@@ -344,7 +346,7 @@ class YAF_TEXTURE_PT_musgrave(YAF_TextureTypePanel, bpy.types.Panel):
         row.prop(tex, "noise_scale", text="Size")
 
 
-class YAF_TEXTURE_PT_voronoi(YAF_TextureTypePanel, bpy.types.Panel):
+class YAF_TEXTURE_PT_voronoi(YAF_TextureTypePanel, Panel):
     bl_label = "Voronoi"
     tex_type = 'VORONOI'
     COMPAT_ENGINES = {'YAFA_RENDER'}
@@ -379,7 +381,7 @@ class YAF_TEXTURE_PT_voronoi(YAF_TextureTypePanel, bpy.types.Panel):
         row.prop(tex, "noise_scale", text="Size")
 
 
-class YAF_TEXTURE_PT_distortednoise(YAF_TextureTypePanel, bpy.types.Panel):
+class YAF_TEXTURE_PT_distortednoise(YAF_TextureTypePanel, Panel):
     bl_label = "Distorted Noise"
     tex_type = 'DISTORTED_NOISE'
     COMPAT_ENGINES = {'YAFA_RENDER'}
@@ -399,7 +401,7 @@ class YAF_TEXTURE_PT_distortednoise(YAF_TextureTypePanel, bpy.types.Panel):
         split.prop(tex, "noise_scale", text="Size")
 
 
-class YAF_TEXTURE_PT_mapping(YAF_TextureSlotPanel, bpy.types.Panel):
+class YAF_TEXTURE_PT_mapping(YAF_TextureSlotPanel, Panel):
     bl_label = "YafaRay Mapping (Map Input)"
     COMPAT_ENGINES = {'YAFA_RENDER'}
 
@@ -483,7 +485,7 @@ class YAF_TEXTURE_PT_mapping(YAF_TextureSlotPanel, bpy.types.Panel):
         row.column().prop(tex, "scale")
 
 
-class YAF_TEXTURE_PT_influence(YAF_TextureSlotPanel, bpy.types.Panel):
+class YAF_TEXTURE_PT_influence(YAF_TextureSlotPanel, Panel):
     bl_label = "YafaRay Influence (Map To)"
     COMPAT_ENGINES = {'YAFA_RENDER'}
 
@@ -571,3 +573,8 @@ class YAF_TEXTURE_PT_influence(YAF_TextureSlotPanel, bpy.types.Panel):
         if isinstance(idblock, bpy.types.Material) or isinstance(idblock, bpy.types.World):
             layout.separator()
             layout.row().prop(tex, "default_value", text="Default Value", slider=True)
+
+
+if __name__ == "__main__":  # only for live edit.
+    import bpy
+    bpy.utils.register_module(__name__)
diff --git a/ui/properties_yaf_volume_integrator.py b/ui/properties_yaf_volume_integrator.py
index e75e54e..e44b7e1 100644
--- a/ui/properties_yaf_volume_integrator.py
+++ b/ui/properties_yaf_volume_integrator.py
@@ -16,13 +16,16 @@
 #
 # ##### END GPL LICENSE BLOCK #####
 
+# <pep8 compliant>
+
 import bpy
+from bpy.types import Panel
 from bl_ui.properties_world import WorldButtonsPanel
 
 WorldButtonsPanel.COMPAT_ENGINES = {'YAFA_RENDER'}
 
 
-class YAF_PT_vol_integrator(WorldButtonsPanel, bpy.types.Panel):
+class YAF_PT_vol_integrator(WorldButtonsPanel, Panel):
     bl_label = "YafaRay Volume Integrator"
 
     def draw(self, context):
@@ -32,9 +35,21 @@ class YAF_PT_vol_integrator(WorldButtonsPanel, bpy.types.Panel):
         layout.prop(world, "v_int_type")
         layout.separator()
 
-        if world.v_int_type == 'Single Scatter':
+        if world.v_int_type == "Single Scatter":
             layout.prop(world, "v_int_step_size")
             layout.prop(world, "v_int_adaptive")
             layout.prop(world, "v_int_optimize")
             if world.v_int_optimize:
                 layout.prop(world, "v_int_attgridres")
+
+        if world.v_int_type == "Sky":
+            layout.prop(world, "v_int_step_size")
+            layout.prop(world, "v_int_dsturbidity")
+            split = layout.split()
+            split.prop(world, "v_int_scale")
+            split.prop(world, "v_int_alpha")
+
+
+if __name__ == "__main__":  # only for live edit.
+    import bpy
+    bpy.utils.register_module(__name__)
diff --git a/ui/properties_yaf_world.py b/ui/properties_yaf_world.py
index 5bc8ac7..c4d5e39 100644
--- a/ui/properties_yaf_world.py
+++ b/ui/properties_yaf_world.py
@@ -16,7 +16,9 @@
 #
 # ##### END GPL LICENSE BLOCK #####
 
-import bpy
+# <pep8 compliant>
+
+from bpy.types import Panel
 from bl_ui.properties_world import WorldButtonsPanel
 
 WorldButtonsPanel.COMPAT_ENGINES = {'YAFA_RENDER'}
@@ -26,7 +28,7 @@ WORLD_PT_preview.COMPAT_ENGINES.add('YAFA_RENDER')
 del WORLD_PT_preview
 
 
-class YAFWORLD_PT_world(WorldButtonsPanel, bpy.types.Panel):
+class YAFWORLD_PT_world(WorldButtonsPanel, Panel):
     bl_label = "Background Settings"
     ibl = True
 
@@ -67,7 +69,7 @@ class YAFWORLD_PT_world(WorldButtonsPanel, bpy.types.Panel):
                     layout.template_ID(context.world, "active_texture")  # new="texture.new")
                 except:
                     pass
-                if  tex.type == "IMAGE":  # it allows to change the used image
+                if  tex.yaf_tex_type == "IMAGE":  # it allows to change the used image
                     try:
                         layout.template_image(tex, "image", tex.image_user, compact=True)
                     except:
@@ -219,6 +221,12 @@ class YAFWORLD_PT_world(WorldButtonsPanel, bpy.types.Panel):
             # for all options that uses IBL
             col = split.column()
             col.prop(world, "bg_ibl_samples")
-            col.prop(world, "bg_power")
+            col.prop(world, "bg_power", text="Power")
+
 
 from . import properties_yaf_volume_integrator
+
+
+if __name__ == "__main__":  # only for live edit.
+    import bpy
+    bpy.utils.register_module(__name__)

-- 
yafaray-exporter packaging



More information about the pkg-multimedia-commits mailing list