From d38caca4e9e69cce17cd1ef08bfaf2c4f9c92c60 Mon Sep 17 00:00:00 2001 From: Sebastian Sille Date: Mon, 13 May 2024 22:10:57 +0200 Subject: [PATCH] Import_3ds: Improved light path linking Use diffuse ray for background if there is no volume mix shader Improved node layout for a better overview --- io_scene_3ds/import_3ds.py | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/io_scene_3ds/import_3ds.py b/io_scene_3ds/import_3ds.py index 9fb8a03e..d9533e1f 100644 --- a/io_scene_3ds/import_3ds.py +++ b/io_scene_3ds/import_3ds.py @@ -949,7 +949,7 @@ def process_next_chunk(context, file, previous_chunk, imported_objects, bitmapnode.image = load_image(bitmap_name, dirname, place_holder=False, recursive=IMAGE_SEARCH, check_existing=True) bitmap_mix.inputs[0].default_value = 0.5 if bitmapnode.image is not None else 1.0 bitmapnode.location = (-520, 400) - bitmap_mix.location = (-200, 380) + bitmap_mix.location = (-200, 360) bitmapping.location = (-740, 400) coordinates = next((wn for wn in nodes if wn.type == 'TEX_COORD'), False) links.new(bitmap_mix.outputs[0], nodes['Background'].inputs[0]) @@ -979,10 +979,10 @@ def process_next_chunk(context, file, previous_chunk, imported_objects, coordinate = next((wn for wn in nodes if wn.type == 'TEX_COORD'), False) backgroundmix = next((wn for wn in nodes if wn.type in {'MIX', 'MIX_RGB'}), False) mappingnode = next((wn for wn in nodes if wn.type == 'MAPPING'), False) - conversion.location = (-740, 40) - layerweight.location = (-940, 230) - gradientnode.location = (-520, 40) - normalnode.location = (-1140, 330) + conversion.location = (-740, -60) + layerweight.location = (-940, 170) + normalnode.location = (-1140, 300) + gradientnode.location = (-520, -20) gradientnode.label = "Gradient" conversion.operation = 'MULTIPLY_ADD' conversion.name = conversion.label = "Multiply" @@ -1095,10 +1095,10 @@ def process_next_chunk(context, file, previous_chunk, imported_objects, layerfog.label = "Layer Fog" layerfog.location = (10, -120) worldout.location = (440, 160) - litepath.location = (-1140, 60) + litepath.location = (-200, 70) links.new(layerfog.outputs[0], worldfog) links.new(litepath.outputs[8], layerfog.inputs[2]) - links.new(litepath.outputs[0], nodes['Background'].inputs[1]) + links.new(litepath.outputs[2], nodes['Background'].inputs[1]) contextWorld.mist_settings.use_mist = True contextWorld.mist_settings.start = read_float(new_chunk) contextWorld.mist_settings.height = read_float(new_chunk) @@ -1134,13 +1134,13 @@ def process_next_chunk(context, file, previous_chunk, imported_objects, camera_data = nodes.new(type='ShaderNodeCameraData') distcue_node.label = "Distance Cue" distcue_node.clamp = False - distcue_node.location = (-940, 100) - camera_data.location = (-1340, 160) + distcue_node.location = (-940, 10) + camera_data.location = (-1340, 170) distcue_mix = next((wn for wn in worldnodes if wn.name == "Volume" and wn.type == 'MIX_SHADER'), False) distcuepath = next((wn for wn in worldnodes if wn.type == 'LIGHT_PATH'), False) if not distcuepath: distcuepath = nodes.new(type='ShaderNodeLightPath') - distcuepath.location = (-1140, 60) + distcuepath.location = (-1140, 70) raysource = distcuepath.outputs[7] if distcue_mix else distcuepath.outputs[0] raytarget = distcue_mix.inputs[0] if distcue_mix else nodes['Background'].inputs[1] links.new(camera_data.outputs[1], distcue_node.inputs[1]) @@ -1434,13 +1434,13 @@ def process_next_chunk(context, file, previous_chunk, imported_objects, if not litepath: litepath = nodes.new('ShaderNodeLightPath') ambinode.location = (10, 160) - ambilite.location = (-200, 10) worldout.location = (440, 160) mixshade.location = (220, 280) - litefall.location = (-1140, 0) - raymixer.location = (-200, 200) - litepath.location = (-1340, 60) - mathnode.location = (-1140, 160) + ambilite.location = (-200, -30) + raymixer.location = (-200, 170) + litepath.location = (-1340, 70) + mathnode.location = (-1140, 100) + litefall.location = (-1140, -80) links.new(litepath.outputs[0], mathnode.inputs[0]) links.new(litepath.outputs[3], mathnode.inputs[1]) links.new(litepath.outputs[5], litefall.inputs[0]) -- 2.11.4.GIT