[Bf-extensions-cvs] SVN commit: /data/svn/bf-extensions [997] trunk/py/scripts/addons: update for changes in blender.

Campbell Barton ideasman42 at gmail.com
Fri Sep 10 04:32:58 CEST 2010


Revision: 997
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-extensions&revision=997
Author:   campbellbarton
Date:     2010-09-10 04:32:56 +0200 (Fri, 10 Sep 2010)

Log Message:
-----------
update for changes in blender.

Modified Paths:
--------------
    trunk/py/scripts/addons/mesh_surface_sketch.py
    trunk/py/scripts/addons/render_povray/__init__.py
    trunk/py/scripts/addons/render_povray/ui.py

Modified: trunk/py/scripts/addons/mesh_surface_sketch.py
===================================================================
--- trunk/py/scripts/addons/mesh_surface_sketch.py	2010-09-09 19:29:12 UTC (rev 996)
+++ trunk/py/scripts/addons/mesh_surface_sketch.py	2010-09-10 02:32:56 UTC (rev 997)
@@ -788,20 +788,20 @@
 
 
 def register():
-    bpy.types.Scene.IntProperty(attr = "SURFSK_edges_U", name = "Cross", description = "Number of edge rings crossing the strokes (perpendicular to strokes direction)", default = 10, min = 0, max = 100000)
-    bpy.types.Scene.IntProperty(attr = "SURFSK_edges_V", name = "Follow", description = "Number of edge rings following the strokes (parallel to strokes direction)", default = 10, min = 0, max = 100000)
-    bpy.types.Scene.IntProperty(attr = "SURFSK_precision", name = "Precision", description = "Precision level of the surface calculation", default = 4, min = 0, max = 100000)
-    bpy.types.Scene.BoolProperty(attr = "SURFSK_keep_strokes", name = "Keep strokes", description = "Keeps the sketched strokes after adding the surface", default = False)
+    bpy.types.Scene.SURFSK_edges_U = bpy.props.IntProperty(name="Cross", description="Number of edge rings crossing the strokes (perpendicular to strokes direction)", default=10, min=0, max=100000)
+    bpy.types.Scene.SURFSK_edges_V = bpy.props.IntProperty(name="Follow", description="Number of edge rings following the strokes (parallel to strokes direction)", default=10, min=0, max=100000)
+    bpy.types.Scene.SURFSK_precision = bpy.props.IntProperty(name="Precision", description="Precision level of the surface calculation", default=4, min=0, max=100000)
+    bpy.types.Scene.SURFSK_keep_strokes = bpy.props.BoolProperty(name="Keep strokes", description="Keeps the sketched strokes after adding the surface", default=False)
 
     keymap_item_add_surf = bpy.data.window_managers[0].keyconfigs.active.keymaps["3D View"].items.new("GPENCIL_OT_SURFSK_add_surface","E","PRESS", key_modifier="D")
     keymap_item_stroke_to_curve = bpy.data.window_managers[0].keyconfigs.active.keymaps["3D View"].items.new("GPENCIL_OT_SURFSK_strokes_to_curves","C","PRESS", key_modifier="D")
 
 
 def unregister():
-    bpy.types.Scene.RemoveProperty("SURFSK_edges_U")
-    bpy.types.Scene.RemoveProperty("SURFSK_edges_V")
-    bpy.types.Scene.RemoveProperty("SURFSK_precision")
-    bpy.types.Scene.RemoveProperty("SURFSK_keep_strokes")
+    del bpy.types.Scene.SURFSK_edges_U
+    del bpy.types.Scene.SURFSK_edges_V
+    del bpy.types.Scene.SURFSK_precision
+    del bpy.types.Scene.SURFSK_keep_strokes
 
     km = bpy.data.window_managers[0].keyconfigs.active.keymaps["3D View"]
     for kmi in km.items:

Modified: trunk/py/scripts/addons/render_povray/__init__.py
===================================================================
--- trunk/py/scripts/addons/render_povray/__init__.py	2010-09-09 19:29:12 UTC (rev 996)
+++ trunk/py/scripts/addons/render_povray/__init__.py	2010-09-10 02:32:56 UTC (rev 997)
@@ -31,24 +31,101 @@
         "func=detail&aid=23145&group_id=153&atid=469",
     "category": "Render"}
 
-try:
-    init_data
 
+if "bpy" in locals():
     reload(render)
     reload(ui)
-except:
+
+else:
+    import bpy
+    from bpy.props import *
     from render_povray import render
     from render_povray import ui
 
-init_data = True
 
 def register():
-    pass
+    Scene = bpy.types.Scene
 
+    # Not a real pov option, just to know if we should write
+    Scene.pov_radio_enable = BoolProperty(
+            name="Enable Radiosity",
+            description="Enable povrays radiosity calculation",
+            default=False)
+    Scene.pov_radio_display_advanced = BoolProperty(
+            name="Advanced Options",
+            description="Show advanced options",
+            default=False)
 
+    # Real pov options
+    Scene.pov_radio_adc_bailout = FloatProperty(
+            name="ADC Bailout", description="The adc_bailout for radiosity rays. Use adc_bailout = 0.01 / brightest_ambient_object for good results",
+            min=0.0, max=1000.0, soft_min=0.0, soft_max=1.0, default=0.01)
+
+    Scene.pov_radio_always_sample = BoolProperty(
+            name="Always Sample", description="Only use the data from the pretrace step and not gather any new samples during the final radiosity pass",
+            default=True)
+
+    Scene.pov_radio_brightness = FloatProperty(
+            name="Brightness", description="Amount objects are brightened before being returned upwards to the rest of the system",
+            min=0.0, max=1000.0, soft_min=0.0, soft_max=10.0, default=1.0)
+
+    Scene.pov_radio_count = IntProperty(
+            name="Ray Count", description="Number of rays that are sent out whenever a new radiosity value has to be calculated",
+            min=1, max=1600, default=35)
+
+    Scene.pov_radio_error_bound = FloatProperty(
+            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)
+
+    Scene.pov_radio_gray_threshold = FloatProperty(
+            name="Gray Threshold", description="One of the two main speed/quality tuning values, lower values are more accurate",
+            min=0.0, max=1.0, soft_min=0, soft_max=1, default=0.0)
+
+    Scene.pov_radio_low_error_factor = FloatProperty(
+            name="Low Error Factor", description="If you calculate just enough samples, but no more, you will get an image which has slightly blotchy lighting",
+            min=0.0, max=1.0, soft_min=0.0, soft_max=1.0, default=0.5)
+
+    # max_sample - not available yet
+    Scene.pov_radio_media = BoolProperty(
+            name="Media", description="Radiosity estimation can be affected by media",
+            default=False)
+
+    Scene.pov_radio_minimum_reuse = FloatProperty(
+            name="Minimum Reuse", description="Fraction of the screen width which sets the minimum radius of reuse for each sample point (At values higher than 2% expect errors)",
+            min=0.0, max=1.0, soft_min=0.1, soft_max=0.1, default=0.015)
+
+    Scene.pov_radio_nearest_count = IntProperty(
+            name="Nearest Count", description="Number of old ambient values blended together to create a new interpolated value",
+            min=1, max=20, default=5)
+
+    Scene.pov_radio_normal = BoolProperty(
+            name="Normals", description="Radiosity estimation can be affected by normals",
+            default=False)
+
+    Scene.pov_radio_recursion_limit = IntProperty(
+            name="Recursion Limit", description="how many recursion levels are used to calculate the diffuse inter-reflection",
+            min=1, max=20, default=3)
+
+
 def unregister():
-    pass
+    import bpy
+    Scene = bpy.types.Scene
 
+    del Scene.pov_radio_enable
+    del Scene.pov_radio_display_advanced
+    del Scene.pov_radio_adc_bailout
+    del Scene.pov_radio_always_sample
+    del Scene.pov_radio_brightness
+    del Scene.pov_radio_count
+    del Scene.pov_radio_error_bound
+    del Scene.pov_radio_gray_threshold
+    del Scene.pov_radio_low_error_factor
+    del Scene.pov_radio_media
+    del Scene.pov_radio_minimum_reuse
+    del Scene.pov_radio_nearest_count
+    del Scene.pov_radio_normal
+    del Scene.pov_radio_recursion_limit
 
+
 if __name__ == "__main__":
     register()

Modified: trunk/py/scripts/addons/render_povray/ui.py
===================================================================
--- trunk/py/scripts/addons/render_povray/ui.py	2010-09-09 19:29:12 UTC (rev 996)
+++ trunk/py/scripts/addons/render_povray/ui.py	2010-09-10 02:32:56 UTC (rev 997)
@@ -18,86 +18,6 @@
 
 import bpy
 
-
-# Radiosity panel, use in the scene for now.
-FloatProperty = bpy.types.Scene.FloatProperty
-IntProperty = bpy.types.Scene.IntProperty
-BoolProperty = bpy.types.Scene.BoolProperty
-
-# Not a real pov option, just to know if we should write
-BoolProperty(attr="pov_radio_enable",
-                name="Enable Radiosity",
-                description="Enable povrays radiosity calculation",
-                default=False)
-BoolProperty(attr="pov_radio_display_advanced",
-                name="Advanced Options",
-                description="Show advanced options",
-                default=False)
-
-# Real pov options
-FloatProperty(attr="pov_radio_adc_bailout",
-                name="ADC Bailout",
-                description="The adc_bailout for radiosity rays. Use adc_bailout = 0.01 / brightest_ambient_object for good results",
-                min=0.0, max=1000.0, soft_min=0.0, soft_max=1.0, default=0.01)
-
-BoolProperty(attr="pov_radio_always_sample",
-                name="Always Sample",
-                description="Only use the data from the pretrace step and not gather any new samples during the final radiosity pass",
-                default=True)
-
-FloatProperty(attr="pov_radio_brightness",
-                name="Brightness",
-                description="Amount objects are brightened before being returned upwards to the rest of the system",
-                min=0.0, max=1000.0, soft_min=0.0, soft_max=10.0, default=1.0)
-
-IntProperty(attr="pov_radio_count",
-                name="Ray Count",
-                description="Number of rays that are sent out whenever a new radiosity value has to be calculated",
-                min=1, max=1600, default=35)
-
-FloatProperty(attr="pov_radio_error_bound",
-                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)
-
-FloatProperty(attr="pov_radio_gray_threshold",
-                name="Gray Threshold",
-                description="One of the two main speed/quality tuning values, lower values are more accurate",
-                min=0.0, max=1.0, soft_min=0, soft_max=1, default=0.0)
-
-FloatProperty(attr="pov_radio_low_error_factor",
-                name="Low Error Factor",
-                description="If you calculate just enough samples, but no more, you will get an image which has slightly blotchy lighting",
-                min=0.0, max=1.0, soft_min=0.0, soft_max=1.0, default=0.5)
-
-# max_sample - not available yet
-BoolProperty(attr="pov_radio_media",
-                name="Media",
-                description="Radiosity estimation can be affected by media",

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-extensions-cvs mailing list