Skip to content
Snippets Groups Projects
Commit c958b22a authored by Campbell Barton's avatar Campbell Barton
Browse files

update for changes in blender.

parent a8feeaca
No related branches found
No related tags found
No related merge requests found
...@@ -788,20 +788,20 @@ class GPENCIL_OT_SURFSK_strokes_to_curves(bpy.types.Operator): ...@@ -788,20 +788,20 @@ class GPENCIL_OT_SURFSK_strokes_to_curves(bpy.types.Operator):
def register(): 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.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.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.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.IntProperty(attr = "SURFSK_precision", name = "Precision", description = "Precision level of the surface calculation", default = 4, 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.BoolProperty(attr = "SURFSK_keep_strokes", name = "Keep strokes", description = "Keeps the sketched strokes after adding the surface", default = False) 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_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") 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(): def unregister():
bpy.types.Scene.RemoveProperty("SURFSK_edges_U") del bpy.types.Scene.SURFSK_edges_U
bpy.types.Scene.RemoveProperty("SURFSK_edges_V") del bpy.types.Scene.SURFSK_edges_V
bpy.types.Scene.RemoveProperty("SURFSK_precision") del bpy.types.Scene.SURFSK_precision
bpy.types.Scene.RemoveProperty("SURFSK_keep_strokes") del bpy.types.Scene.SURFSK_keep_strokes
km = bpy.data.window_managers[0].keyconfigs.active.keymaps["3D View"] km = bpy.data.window_managers[0].keyconfigs.active.keymaps["3D View"]
for kmi in km.items: for kmi in km.items:
......
...@@ -31,23 +31,100 @@ bl_addon_info = { ...@@ -31,23 +31,100 @@ bl_addon_info = {
"func=detail&aid=23145&group_id=153&atid=469", "func=detail&aid=23145&group_id=153&atid=469",
"category": "Render"} "category": "Render"}
try:
init_data
if "bpy" in locals():
reload(render) reload(render)
reload(ui) reload(ui)
except:
else:
import bpy
from bpy.props import *
from render_povray import render from render_povray import render
from render_povray import ui from render_povray import ui
init_data = True
def register(): 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(): 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__": if __name__ == "__main__":
......
...@@ -18,86 +18,6 @@ ...@@ -18,86 +18,6 @@
import bpy 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",
default=False)
FloatProperty(attr="pov_radio_minimum_reuse",
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)
IntProperty(attr="pov_radio_nearest_count",
name="Nearest Count",
description="Number of old ambient values blended together to create a new interpolated value",
min=1, max=20, default=5)
BoolProperty(attr="pov_radio_normal",
name="Normals",
description="Radiosity estimation can be affected by normals",
default=False)
IntProperty(attr="pov_radio_recursion_limit",
name="Recursion Limit",
description="how many recursion levels are used to calculate the diffuse inter-reflection",
min=1, max=20, default=3)
# Use some of the existing buttons. # Use some of the existing buttons.
import properties_render import properties_render
properties_render.RENDER_PT_render.COMPAT_ENGINES.add('POVRAY_RENDER') properties_render.RENDER_PT_render.COMPAT_ENGINES.add('POVRAY_RENDER')
...@@ -214,6 +134,3 @@ class RENDER_PT_povray_radiosity(RenderButtonsPanel, bpy.types.Panel): ...@@ -214,6 +134,3 @@ class RENDER_PT_povray_radiosity(RenderButtonsPanel, bpy.types.Panel):
col = split.column() col = split.column()
col.prop(scene, "pov_radio_always_sample") col.prop(scene, "pov_radio_always_sample")
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment