io_scene_3ds: Added spotlight aspect and projector #104813

Merged
Sebastian Sille merged 69 commits from :main into main 2023-08-03 00:41:35 +02:00
Showing only changes of commit 82ec2ab06d - Show all commits

View File

@ -807,14 +807,14 @@ def process_next_chunk(context, file, previous_chunk, imported_objects, CONSTRAI
if contextWorld is None: if contextWorld is None:
path, filename = os.path.split(file.name) path, filename = os.path.split(file.name)
realname, ext = os.path.splitext(filename) realname, ext = os.path.splitext(filename)
newWorld = bpy.data.worlds.new("LayerFog: " + realname) newWorld = bpy.data.worlds.new("Fog: " + realname)
context.scene.world = contextWorld context.scene.world = contextWorld
contextWorld.use_nodes = True contextWorld.use_nodes = True
links = contextWorld.node_tree.links links = contextWorld.node_tree.links
nodes = contextWorld.node_tree.nodes nodes = contextWorld.node_tree.nodes
fognode = nodes.new(type='ShaderNodeVolumeAbsorption') fognode = nodes.new(type='ShaderNodeVolumeAbsorption')
fognode.label = "Fog" fognode.label = "Fog"
fognode.location = (300, 60) fognode.location = (10, 60)
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.label == 'Volume' and wn.type in {'ADD_SHADER', 'MIX_SHADER'}), False)
if volumemix: if volumemix:
links.new(fognode.outputs['Volume'], volumemix.inputs[1]) links.new(fognode.outputs['Volume'], volumemix.inputs[1])
@ -860,7 +860,6 @@ def process_next_chunk(context, file, previous_chunk, imported_objects, CONSTRAI
fognode = next((wn for wn in worldnodes if wn.type == 'VOLUME_ABSORPTION'), False) fognode = next((wn for wn in worldnodes if wn.type == 'VOLUME_ABSORPTION'), False)
if fognode: if fognode:
links.new(fognode.outputs['Volume'], mxvolume.inputs[1]) links.new(fognode.outputs['Volume'], mxvolume.inputs[1])
fognode.location = (10, 60)
context.view_layer.use_pass_mist = False context.view_layer.use_pass_mist = False
contextWorld.mist_settings.use_mist = True contextWorld.mist_settings.use_mist = True
contextWorld.mist_settings.start = read_float(new_chunk) contextWorld.mist_settings.start = read_float(new_chunk)