[Bf-extensions-cvs] [e44e5845] master: fix: Texture slots for world and materials fix: Orthographic and perspective camera view angle thanks to Iari Marino add: some numpy functions to export mesh possibly faster in next version fix: parametric surfaces much accelerated and now actually usable (max gradient defaults were wrong from the time of their implementation in most pov literature. Thanks to William F. Pokorny for finding this out! add: very basic "blurry reflection" hack for when using plain official POV add: push of (as of yet badly formatted) feedback to interactive console add: POV centric workspace, default when addon is left activated from previous session. add: Sound signal support on finished render (set from addon preferences) add: support for pov 3.8 and decremented in a few areas, waiting for the release add: freestyle interface with convoluted workflow currently but preparing for next release. fix: commented out Charset feature because POV 3.8 auto detects encoding fix: a few dot notation look ups aliased and removed fix: restored some more removed properties from 2.79 ( a few remain to do) fix: texture mapped specular max value increased fix: faster defaults for radiosity fix: many default texture influences switched to 1 because boolean enabling is required anyway so 0 was a bad default fix: some icons were missing since 2.8 fix: some formatting improvement was started

Maurice Raybaud noreply at git.blender.org
Sun Aug 2 00:08:37 CEST 2020


Commit: e44e5845ee2b9e8de3b06d5678f60eb0ea09bc4f
Author: Maurice Raybaud
Date:   Sun Aug 2 00:07:39 2020 +0200
Branches: master
https://developer.blender.org/rBAe44e5845ee2b9e8de3b06d5678f60eb0ea09bc4f

fix: Texture slots for world and materials
fix: Orthographic and perspective camera view angle thanks to Iari Marino
add: some numpy functions to export mesh possibly faster in next version
fix: parametric surfaces much accelerated and now actually usable (max gradient defaults were wrong from the time of their implementation in most pov literature. Thanks to William F. Pokorny for finding this out!
add: very basic "blurry reflection" hack for when using plain official POV
add: push of (as of yet badly formatted) feedback to interactive console
add: POV centric workspace, default when addon is left activated from previous session.
add: Sound signal support on finished render (set from addon preferences)
add: support for pov 3.8 and decremented in a few areas, waiting for the release
add: freestyle interface with convoluted workflow currently but preparing for next release.
fix: commented out Charset feature because POV 3.8 auto detects encoding
fix: a few dot notation look ups aliased and removed
fix: restored some more removed properties from 2.79 ( a few remain to do)
fix: texture mapped specular max value increased
fix: faster defaults for radiosity
fix: many default texture influences switched to 1 because boolean enabling is required anyway so 0 was a bad default
fix: some icons were missing since 2.8
fix: some formatting improvement was started

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

M	render_povray/__init__.py
M	render_povray/nodes.py
M	render_povray/primitives.py
M	render_povray/render.py
M	render_povray/shading.py
M	render_povray/ui.py

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

diff --git a/render_povray/__init__.py b/render_povray/__init__.py
index 7a6332ee..fded5cff 100644
--- a/render_povray/__init__.py
+++ b/render_povray/__init__.py
@@ -25,16 +25,16 @@ Scene Description Language. The script has been split in as few files
 as possible :
 
 ___init__.py :
-    Initialize variables
+    Initialize properties
 
 update_files.py
-    Update new variables to values from older API. This file needs an update.
+    Update new variables to values from older API. This file needs an update
 
 ui.py :
-    Provide property buttons for the user to set up the variables.
+    Provide property buttons for the user to set up the variables
 
 primitives.py :
-    Display some POV native primitives in 3D view for input and output.
+    Display some POV native primitives in 3D view for input and output
 
 shading.py
     Translate shading properties to declared textures at the top of a pov file
@@ -50,7 +50,7 @@ render.py :
 
 
 Along these essential files also coexist a few additional libraries to help make
-Blender stand up to other POV IDEs such as povwin or QTPOV.
+Blender stand up to other POV IDEs such as povwin or QTPOV
     presets :
         Material (sss)
             apple.py ; chicken.py ; cream.py ; Ketchup.py ; marble.py ;
@@ -64,11 +64,14 @@ Blender stand up to other POV IDEs such as povwin or QTPOV.
             01_Clear_Blue_Sky.py ; 02_Partly_Hazy_Sky.py ; 03_Overcast_Sky.py ;
             04_Cartoony_Sky.py ; 05_Under_Water.py ;
         Light
-            01_(5400K)_Direct_Sun.py ; 02_(5400K)_High_Noon_Sun.py ;
+            01_(4800K)_Direct_Sun.py ;
+            02_(5400K)_High_Noon_Sun.py ;
             03_(6000K)_Daylight_Window.py ;
             04_(6000K)_2500W_HMI_(Halogen_Metal_Iodide).py ;
-            05_(4000K)_100W_Metal_Halide.py ; 06_(3200K)_100W_Quartz_Halogen.py ;
-            07_(2850K)_100w_Tungsten.py ; 08_(2600K)_40w_Tungsten.py ;
+            05_(4000K)_100W_Metal_Halide.py ;
+            06_(3200K)_100W_Quartz_Halogen.py ;
+            07_(2850K)_100w_Tungsten.py ;
+            08_(2600K)_40w_Tungsten.py ;
             09_(5000K)_75W_Full_Spectrum_Fluorescent_T12.py ;
             10_(4300K)_40W_Vintage_Fluorescent_T12.py ;
             11_(5000K)_18W_Standard_Fluorescent_T8 ;
@@ -78,10 +81,13 @@ Blender stand up to other POV IDEs such as povwin or QTPOV.
             15_(3200K)_40W_Induction_Fluorescent.py ;
             16_(2100K)_150W_High_Pressure_Sodium.py ;
             17_(1700K)_135W_Low_Pressure_Sodium.py ;
-            18_(6800K)_175W_Mercury_Vapor.py ; 19_(5200K)_700W_Carbon_Arc.py ;
-            20_(6500K)_15W_LED_Spot.py ; 21_(2700K)_7W_OLED_Panel.py ;
+            18_(6800K)_175W_Mercury_Vapor.py ;
+            19_(5200K)_700W_Carbon_Arc.py ;
+            20_(6500K)_15W_LED_Spot.py ;
+            21_(2700K)_7W_OLED_Panel.py ;
             22_(30000K)_40W_Black_Light_Fluorescent.py ;
-            23_(30000K)_40W_Black_Light_Bulb.py; 24_(1850K)_Candle.py
+            23_(30000K)_40W_Black_Light_Bulb.py;
+            24_(1850K)_Candle.py
     templates:
         abyss.pov ; biscuit.pov ; bsp_Tango.pov ; chess2.pov ;
         cornell.pov ; diffract.pov ; diffuse_back.pov ; float5 ;
@@ -98,20 +104,23 @@ bl_info = {
     "Bastien Montagne, "
     "Constantin Rahn, "
     "Silvio Falcinelli",
-    "version": (0, 1, 0),
+    "version": (0, 1, 1),
     "blender": (2, 81, 0),
     "location": "Render Properties > Render Engine > Persistence of Vision",
     "description": "Persistence of Vision integration for blender",
     "doc_url": "{BLENDER_MANUAL_URL}/addons/render/povray.html",
     "category": "Render",
+    "warning": "Under active development, seeking co-maintainer(s)",
 }
 
 if "bpy" in locals():
     import importlib
 
     importlib.reload(ui)
+    importlib.reload(nodes)
     importlib.reload(render)
     importlib.reload(shading)
+    importlib.reload(primitives)
     importlib.reload(update_files)
 
 else:
@@ -121,13 +130,18 @@ else:
     import nodeitems_utils  # for Nodes
     from nodeitems_utils import NodeCategory, NodeItem  # for Nodes
     from bl_operators.presets import AddPresetBase
-    from bpy.types import AddonPreferences, PropertyGroup
+    from bpy.types import (
+        AddonPreferences,
+        PropertyGroup,
+        NodeSocket,
+    )
+
     from bpy.props import (
+        FloatVectorProperty,
         StringProperty,
         BoolProperty,
         IntProperty,
         FloatProperty,
-        FloatVectorProperty,
         EnumProperty,
         PointerProperty,
         CollectionProperty,
@@ -137,39 +151,94 @@ else:
 
 def string_strip_hyphen(name):
 
-    """Remove hyphen characters from a string to avoid POV errors."""
+    """Remove hyphen characters from a string to avoid POV errors"""
 
     return name.replace("-", "")
 
+def pov_context_tex_datablock(context):
+    """Texture context type recreated as deprecated in blender 2.8"""
+
+    idblock = context.brush
+    if idblock and context.scene.texture_context == 'OTHER':
+        return idblock
+
+    # idblock = bpy.context.active_object.active_material
+    idblock = context.view_layer.objects.active.active_material
+    if idblock and context.scene.texture_context == 'MATERIAL':
+        return idblock
+
+    idblock = context.world
+    if idblock and context.scene.texture_context == 'WORLD':
+        return idblock
+
+    idblock = context.light
+    if idblock and context.scene.texture_context == 'LIGHT':
+        return idblock
+
+    if context.particle_system and context.scene.texture_context == 'PARTICLES':
+        idblock = context.particle_system.settings
+
+    return idblock
+
+    idblock = context.line_style
+    if idblock and context.scene.texture_context == 'LINESTYLE':
+        return idblock
+
+def brush_texture_update(self, context):
+
+    """Brush texture rolldown must show active slot texture props"""
+    idblock = pov_context_tex_datablock(context)
+    if idblock is not None:
+        #mat = context.view_layer.objects.active.active_material
+        idblock = pov_context_tex_datablock(context)
+        slot = idblock.pov_texture_slots[idblock.pov.active_texture_index]
+        tex = slot.texture
+
+        if tex:
+            # Switch paint brush to active texture so slot and settings remain contextual
+            bpy.context.tool_settings.image_paint.brush.texture = bpy.data.textures[tex]
+            bpy.context.tool_settings.image_paint.brush.mask_texture = bpy.data.textures[tex]
 
 def active_texture_name_from_uilist(self, context):
-    mat = context.scene.view_layers["View Layer"].objects.active.active_material
-    index = mat.pov.active_texture_index
-    name = mat.pov_texture_slots[index].name
-    newname = mat.pov_texture_slots[index].texture
-    tex = bpy.data.textures[name]
-    tex.name = newname
-    mat.pov_texture_slots[index].name = newname
+
+    idblock = pov_context_tex_datablock(context)
+    #mat = context.view_layer.objects.active.active_material
+    if idblock is not None:
+        index = idblock.pov.active_texture_index
+        name = idblock.pov_texture_slots[index].name
+        newname = idblock.pov_texture_slots[index].texture
+        tex = bpy.data.textures[name]
+        tex.name = newname
+        idblock.pov_texture_slots[index].name = newname
 
 
 def active_texture_name_from_search(self, context):
-    mat = context.scene.view_layers["View Layer"].objects.active.active_material
-    index = mat.pov.active_texture_index
-    name = mat.pov_texture_slots[index].texture_search
+    """Texture rolldown to change the data linked by an existing texture"""
+    idblock = pov_context_tex_datablock(context)
+    #mat = context.view_layer.objects.active.active_material
+    if idblock is not None:
+        index = idblock.pov.active_texture_index
+        slot = idblock.pov_texture_slots[index]
+        name = slot.texture_search
+
     try:
         tex = bpy.data.textures[name]
-        mat.pov_texture_slots[index].name = name
-        mat.pov_texture_slots[index].texture = name
+        slot.name = name
+        slot.texture = name
+        # Switch paint brush to this texture so settings remain contextual
+        #bpy.context.tool_settings.image_paint.brush.texture = tex
+        #bpy.context.tool_settings.image_paint.brush.mask_texture = tex
     except:
         pass
 
 
+
 ###############################################################################
 # Scene POV properties.
 ###############################################################################
 class RenderPovSettingsScene(PropertyGroup):
 
-    """Declare scene level properties controllable in UI and translated to POV."""
+    """Declare scene level properties controllable in UI and translated to POV"""
 
     # Linux SDL-window enable
     sdl_window_enable: BoolProperty(
@@ -770,7 +839,7 @@ class RenderPovSettingsScene(PropertyGroup):
         name="Error Bound",
         description="One of the two main speed/quality tuning values, "
         "lower values are more accurate",
-        min=0.0, max=1000.0, soft_min=0.1, soft_max=10.0, default=1.8
+        min=0.0, max=1000.0, soft_min=0.1, soft_max=10.0, default=10.0
     )
 
     radio_gray_threshold: FloatProperty(
@@ -837,14 +906,15 @@ class RenderPovSettingsScene(PropertyGroup):
         name="Pretrace Start",
         description="Fraction of the screen width which sets the size of the "
         "blocks in the mosaic preview first pass",
-        min=0.01, max=1.00, soft_min=0.02, soft_max=1.0, default=0.08
+        min=0.005, max=1.00, soft_min=0.02, soft_max=1.0, default=0.04
     )
-
+    # XXX TODO set automatically to  pretrace_end = 8 / max (image_width, image_height)
+    # for non advanced mode
     radio_pretrace_end: FloatProperty(
         name="Pretrace End",
         description="Fraction of the screen width which sets the size of the blocks "
         "in the mosaic preview last pass",
-        min=0.000925, max=1.00, soft_min=0.01, soft_max=1.00, default=0.04, precision=3
+        min=0.000925, max=1.00, soft_min=0.01, soft_max=1.00, default=0.004, precision=3
     )
 
 ###############################################################################
@@ -856,19 +926,28 @@ class MaterialTe

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-extensions-cvs mailing list