From b5faa814dc34dfae45f31e9ab8ab44ff8a450071 Mon Sep 17 00:00:00 2001
From: Philipp Oeser <info@graphics-engineer.com>
Date: Thu, 7 May 2020 11:12:27 +0200
Subject: [PATCH] Fix T76485: Export Paper Model: error using (removed) cycles
 subsurface pass

Since rBe0085bfd24da, Cycles is not using a dedicated subsurface pass
anymore, update this Addon accordingly.
---
 io_export_paper_model.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/io_export_paper_model.py b/io_export_paper_model.py
index 10658dd6a..f44038f10 100644
--- a/io_export_paper_model.py
+++ b/io_export_paper_model.py
@@ -252,7 +252,7 @@ class Unfolder:
             # TODO: do we really need all this recollection?
             recall = rd.engine, sce.cycles.bake_type, sce.cycles.samples, bk.use_selected_to_active, bk.margin, bk.cage_extrusion, bk.use_cage, bk.use_clear
             rd.engine = 'CYCLES'
-            recall_pass = {p: getattr(bk, f"use_pass_{p}") for p in ('ambient_occlusion', 'color', 'diffuse', 'direct', 'emit', 'glossy', 'indirect', 'subsurface', 'transmission')}
+            recall_pass = {p: getattr(bk, f"use_pass_{p}") for p in ('ambient_occlusion', 'color', 'diffuse', 'direct', 'emit', 'glossy', 'indirect', 'transmission')}
             for p in recall_pass:
                 setattr(bk, f"use_pass_{p}", (properties.output_type != 'TEXTURE'))
             lookup = {'TEXTURE': 'DIFFUSE', 'AMBIENT_OCCLUSION': 'AO', 'RENDER': 'COMBINED', 'SELECTED_TO_ACTIVE': 'COMBINED'}
@@ -266,7 +266,7 @@ class Unfolder:
                 sce.cycles.samples = properties.bake_samples
             if sce.cycles.bake_type == 'COMBINED':
                 bk.use_pass_direct, bk.use_pass_indirect = True, True
-                bk.use_pass_diffuse, bk.use_pass_glossy, bk.use_pass_transmission, bk.use_pass_subsurface, bk.use_pass_ambient_occlusion, bk.use_pass_emit = True, False, False, True, True, True
+                bk.use_pass_diffuse, bk.use_pass_glossy, bk.use_pass_transmission, bk.use_pass_ambient_occlusion, bk.use_pass_emit = True, False, False, True, True
 
             if image_packing == 'PAGE_LINK':
                 self.mesh.save_image(printable_size * ppm, filepath)
-- 
GitLab