From cfd6d5f3cf5b0b0e2997f82892d1dd3ee216f21c Mon Sep 17 00:00:00 2001 From: Simon Wendsche Date: Tue, 30 Apr 2019 00:38:19 +0200 Subject: [PATCH] add shadow catcher option to only consider shadows from infinite lights --- nodes/materials/output.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/nodes/materials/output.py b/nodes/materials/output.py index a50ba761..565697b0 100644 --- a/nodes/materials/output.py +++ b/nodes/materials/output.py @@ -11,6 +11,11 @@ "Remember to enable transparent film in camera settings" ) +ONLY_INFINITE_DESC = ( + "Only consider shadows of infinite lights (sky, HDRI, " + "flat colored background) for the shadowcatcher" +) + MATERIAL_ID_DESC = ( "ID for Material ID AOV, if -1 is set a random ID is chosen. " "Note that the random IDs of LuxCore can be greater than 32767 " @@ -29,6 +34,8 @@ class LuxCoreNodeMatOutput(LuxCoreNodeOutput): active = BoolProperty(name="Active", default=True, update=update_active) is_shadow_catcher = BoolProperty(name="Shadow Catcher", default=False, description=SHADOWCATCHER_DESC) + shadow_catcher_only_infinite = BoolProperty(name="Only Infinite Lights", default=False, + description=ONLY_INFINITE_DESC) id = IntProperty(name="Material ID", default=-1, min=-1, soft_max=32767, description=MATERIAL_ID_DESC) use_photongi = BoolProperty(name="Use PhotonGI Cache", default=True, @@ -74,6 +81,7 @@ def draw_buttons(self, context, layout): if engine_is_bidir: col.label("Not supported by Bidir engine", icon=icons.INFO) elif self.is_shadow_catcher: + col.prop(self, "shadow_catcher_only_infinite") # Some settings that should be used with shadow catcher if utils.is_valid_camera(context.scene.camera): pipeline = context.scene.camera.data.luxcore.imagepipeline @@ -121,6 +129,7 @@ def export(self, exporter, props, luxcore_name): # LuxCore only assigns a random ID if the ID is not set at all props.Set(pyluxcore.Property(prefix + "id", self.id)) props.Set(pyluxcore.Property(prefix + "shadowcatcher.enable", self.is_shadow_catcher)) + props.Set(pyluxcore.Property(prefix + "shadowcatcher.onlyinfinitelights", self.shadow_catcher_only_infinite)) props.Set(pyluxcore.Property(prefix + "photongi.enable", self.use_photongi)) def _convert_volume(self, exporter, node_tree, props):