Skip to content
This repository has been archived by the owner on Jul 18, 2020. It is now read-only.

Commit

Permalink
AA Panel UI: more fixes for enabled/disabled fields
Browse files Browse the repository at this point in the history
The previous fix was not good, it caused some fields to be incorrectly disabled in other integrators apart from SPPM
  • Loading branch information
DavidBluecame committed Apr 30, 2017
1 parent 5a341ba commit 9ec5000
Showing 1 changed file with 24 additions and 32 deletions.
56 changes: 24 additions & 32 deletions ui/properties_yaf_AA_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,33 +40,31 @@ def draw(self, context):

split = layout.split()
col = split.column()
spp = col.column()
sub = col.column()
sub.prop(scene, "AA_filter_type")
spp.prop(scene, "AA_min_samples")
sub.prop(scene, "AA_pixelwidth")
spp.enabled = False
if scene.intg_light_method != "SPPM":
sub.enabled = scene.AA_passes > 1
spp.enabled = True
# fix suggest by 'samo' in http://www.yafaray.org/node/581
sub_always = col.column()
sub_nosppm = col.column()
sub_nosppm.enabled = scene.intg_light_method != "SPPM"
sub_morethan1pass = col.column()
sub_morethan1pass.enabled = scene.AA_passes > 1
sub_nosppm_morethan1pass = col.column()
sub_nosppm_morethan1pass.enabled = scene.intg_light_method != "SPPM" and scene.AA_passes > 1
sub_always.prop(scene, "AA_filter_type")
sub_nosppm.prop(scene, "AA_min_samples")
sub_always.prop(scene, "AA_pixelwidth")

col = split.column()
spp = col.column()
sub = col.column()
spp.enabled = False
if scene.intg_light_method != "SPPM":
sub.enabled = scene.AA_passes > 1
spp.enabled = True
#
spp.prop(scene, "AA_passes")
spp.prop(scene, "AA_inc_samples")
spp.prop(scene.yafaray.noise_control, "background_resampling")
sub_always = col.column()
sub_nosppm = col.column()
sub_nosppm.enabled = scene.intg_light_method != "SPPM"
sub_morethan1pass = col.column()
sub_morethan1pass.enabled = scene.AA_passes > 1
sub_nosppm_morethan1pass = col.column()
sub_nosppm_morethan1pass.enabled = scene.intg_light_method != "SPPM" and scene.AA_passes > 1
sub_nosppm.prop(scene, "AA_passes")
sub_nosppm_morethan1pass.prop(scene, "AA_inc_samples")
sub_nosppm_morethan1pass.prop(scene.yafaray.noise_control, "background_resampling")

row = layout.row()
row.enabled = False

if scene.AA_passes > 1 and scene.intg_light_method != "SPPM":
row.enabled = True
row.enabled = scene.intg_light_method != "SPPM" and scene.AA_passes > 1

row.prop(scene.yafaray.noise_control, "dark_detection_type")
col = row.column()
Expand All @@ -79,18 +77,12 @@ def draw(self, context):
col.prop(scene, "AA_threshold")

row = layout.row()
row.enabled = False

if scene.AA_passes > 1 and scene.intg_light_method != "SPPM":
row.enabled = True
row.enabled = scene.intg_light_method != "SPPM" and scene.AA_passes > 1

row.prop(scene.yafaray.noise_control, "detect_color_noise")

row = layout.row()
row.enabled = False

if scene.AA_passes > 1 and scene.intg_light_method != "SPPM":
row.enabled = True
row.enabled = scene.intg_light_method != "SPPM" and scene.AA_passes > 1

col = row.column()
col.prop(scene.yafaray.noise_control, "sample_multiplier_factor")
Expand Down

0 comments on commit 9ec5000

Please sign in to comment.