From d17d622c48d88937ec8b48c65be7a29a88bf5c18 Mon Sep 17 00:00:00 2001 From: Sebastian Sille Date: Sun, 12 May 2024 12:41:22 +0200 Subject: [PATCH] Import_3ds: Set unique names for world mixshaders Set unique name for mixshaders to avoid unbound errors --- io_scene_3ds/import_3ds.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/io_scene_3ds/import_3ds.py b/io_scene_3ds/import_3ds.py index e256c23e..7b3c84ce 100644 --- a/io_scene_3ds/import_3ds.py +++ b/io_scene_3ds/import_3ds.py @@ -980,7 +980,6 @@ def process_next_chunk(context, file, previous_chunk, imported_objects, layerweight.location = (-940, 150) gradientnode.location = (-520, 20) normalnode.location = (-1140, 300) - layerweight.label = "Weight" gradientnode.label = "Gradient" conversion.operation = 'MULTIPLY_ADD' conversion.name = conversion.label = "Multiply" @@ -1039,7 +1038,7 @@ def process_next_chunk(context, file, previous_chunk, imported_objects, fognode = nodes.new(type='ShaderNodeVolumeAbsorption') fognode.label = "Fog" fognode.location = (10, 20) - volumemix = next((wn for wn in worldnodes if wn.label == 'Volume' and wn.type in {'ADD_SHADER', 'MIX_SHADER'}), False) + volumemix = next((wn for wn in worldnodes if wn.name == 'Volume' and wn.type in {'ADD_SHADER', 'MIX_SHADER'}), False) if volumemix: links.new(fognode.outputs[0], volumemix.inputs[1]) else: @@ -1080,7 +1079,7 @@ def process_next_chunk(context, file, previous_chunk, imported_objects, fognode = next((wn for wn in worldnodes if wn.type == 'VOLUME_ABSORPTION'), False) if fognode: mxvolume = nodes.new(type='ShaderNodeMixShader') - mxvolume.label = "Volume" + mxvolume.label = mxvolume.name = "Volume" mxvolume.location = (220, 0) links.new(litepath.outputs[7], mxvolume.inputs[0]) links.new(fognode.outputs[0], mxvolume.inputs[1]) @@ -1382,7 +1381,7 @@ def process_next_chunk(context, file, previous_chunk, imported_objects, mixshade = nodes.new(type='ShaderNodeMixShader') litefall = nodes.new(type='ShaderNodeLightFalloff') ambilite.label = "Ambient Color" - mixshade.label = "Surface" + mixshade.label = mixshade.name = "Surface" litepath = next((n for n in nodes if n.type == 'LIGHT_PATH'), False) ambinode.inputs[0].default_value[:3] = child.color if not litepath: @@ -1668,7 +1667,8 @@ def process_next_chunk(context, file, previous_chunk, imported_objects, if (cld and cld.data) and cld.type == 'MESH': cld.data.transform(mtx) - # Assign parents to objects. Check if we need to assign first because doing so recalcs the depsgraph + # Assign parents to objects + # Check if we need to assign first because doing so recalcs the depsgraph for ind, ob in enumerate(object_list): if ob is None: continue -- 2.11.4.GIT