Fix #103284: Cycles uses sampling pattern from debug UI

The sampling pattern is only a debug setting at this point
and should not be used without the debug UI enabled where
users can actually see and edit the value.

Pull Request: https://projects.blender.org/blender/blender/pulls/112606
This commit is contained in:
Alaska
2023-09-27 20:31:14 +02:00
committed by Brecht Van Lommel
parent e9fb0be754
commit c8365bb217
2 changed files with 10 additions and 3 deletions

View File

@@ -375,7 +375,8 @@ class CYCLES_RENDER_PT_sampling_advanced(CyclesButtonsPanel, Panel):
layout.separator()
heading = layout.column(align=True, heading="Scrambling Distance")
heading.active = cscene.sampling_pattern == 'TABULATED_SOBOL'
# Tabulated Sobol is used when the debug UI is turned off.
heading.active = cscene.sampling_pattern == 'TABULATED_SOBOL' or not CyclesDebugButtonsPanel.poll(context)
heading.prop(cscene, "auto_scrambling_distance", text="Automatic")
heading.prop(cscene, "preview_scrambling_distance", text="Viewport")
heading.prop(cscene, "scrambling_distance", text="Multiplier")

View File

@@ -355,8 +355,14 @@ void BlenderSync::sync_integrator(BL::ViewLayer &b_view_layer, bool background)
scene->light_manager->tag_update(scene, LightManager::UPDATE_ALL);
}
SamplingPattern sampling_pattern = (SamplingPattern)get_enum(
cscene, "sampling_pattern", SAMPLING_NUM_PATTERNS, SAMPLING_PATTERN_TABULATED_SOBOL);
SamplingPattern sampling_pattern;
if (use_developer_ui) {
sampling_pattern = (SamplingPattern)get_enum(
cscene, "sampling_pattern", SAMPLING_NUM_PATTERNS, SAMPLING_PATTERN_TABULATED_SOBOL);
}
else {
sampling_pattern = SAMPLING_PATTERN_TABULATED_SOBOL;
}
integrator->set_sampling_pattern(sampling_pattern);
int samples = 1;