From e506c8013686d0d3e967083163d5b60520454f3c Mon Sep 17 00:00:00 2001 From: Simon Wendsche Date: Fri, 14 Dec 2018 16:10:34 +0100 Subject: [PATCH] expose resolutionreduction parameter --- export/config.py | 6 ++++-- properties/viewport.py | 3 +++ ui/viewport.py | 7 ++++++- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/export/config.py b/export/config.py index 798e0c9f..56680044 100644 --- a/export/config.py +++ b/export/config.py @@ -121,13 +121,15 @@ def _convert_opencl_settings(scene, definitions, is_final_render): def _convert_viewport_engine(scene, definitions, config): _convert_path(config, definitions) - use_cpu = scene.luxcore.viewport.device == "CPU" + viewport = scene.luxcore.viewport + + use_cpu = viewport.device == "CPU" if not use_cpu and not utils.is_opencl_build(): msg = "Config: LuxCore was built without OpenCL support, can't use OpenCL engine in viewport" scene.luxcore.errorlog.add_warning(msg) use_cpu = True - resolutionreduction = 4 if scene.luxcore.viewport.reduce_resolution_on_edit else 1 + resolutionreduction = viewport.resolution_reduction if viewport.reduce_resolution_on_edit else 1 if use_cpu: luxcore_engine = "RTPATHCPU" diff --git a/properties/viewport.py b/properties/viewport.py index a8253c22..8c922568 100644 --- a/properties/viewport.py +++ b/properties/viewport.py @@ -38,6 +38,9 @@ class LuxCoreViewportSettings(bpy.types.PropertyGroup): reduce_resolution_on_edit = BoolProperty(name="Reduce first sample resolution", default=True, description="Render the first sample after editing the scene " "with reduced resolution to provide a quicker response") + resolution_reduction = IntProperty(name="Block Size", default=4, min=2, + description="Size of the startup blocks in pixels. A size of 4 means that " + "one sample is spread over 4x4 pixels on startup") use_bidir = BoolProperty(name="Use Bidir in Viewport", default=True, description="Enable if your scene requires Bidir for complex light paths and " diff --git a/ui/viewport.py b/ui/viewport.py index 1bae8f19..6cbcf25e 100644 --- a/ui/viewport.py +++ b/ui/viewport.py @@ -18,7 +18,12 @@ def draw(self, context): viewport = context.scene.luxcore.viewport layout.prop(viewport, "halt_time") - layout.prop(viewport, "reduce_resolution_on_edit") + + split = layout.split(percentage=0.6) + split.prop(viewport, "reduce_resolution_on_edit") + sub = split.row() + sub.active = viewport.reduce_resolution_on_edit + sub.prop(viewport, "resolution_reduction") col = layout.column() col.prop(viewport, "pixel_size")