import bpy, math from mathutils import Vector sc = bpy.context.scene # colour management: neutral tone-map keeps the red/cyan emissives saturated for vt in ('Khronos PBR Neutral', 'AgX', 'Standard'): try: sc.view_settings.view_transform = vt break except Exception: continue sc.view_settings.look = 'None' if 'None' in [i.identifier for i in sc.view_settings.bl_rna.properties['look'].enum_items] else sc.view_settings.look try: sc.eevee.use_raytracing = True sc.eevee.taa_render_samples = 48 except Exception: pass # world: soft studio gradient (brighter overhead so metals have something to reflect) w = sc.world w.use_nodes = True nt = w.node_tree for n in list(nt.nodes): if n.type not in ('OUTPUT_WORLD',): nt.nodes.remove(n) out = nt.nodes['World Output'] bg = nt.nodes.new('ShaderNodeBackground') tc = nt.nodes.new('ShaderNodeTexCoord') gr = nt.nodes.new('ShaderNodeTexGradient') mp = nt.nodes.new('ShaderNodeMapping') ramp = nt.nodes.new('ShaderNodeValToRGB') nt.links.new(tc.outputs['Generated'], mp.inputs['Vector']) mp.inputs['Rotation'].default_value = (math.radians(90), 0, 0) nt.links.new(mp.outputs['Vector'], gr.inputs['Vector']) nt.links.new(gr.outputs['Fac'], ramp.inputs['Fac']) ramp.color_ramp.elements[0].position = 0.35 ramp.color_ramp.elements[0].color = (0.09, 0.10, 0.12, 1) ramp.color_ramp.elements[1].position = 0.9 ramp.color_ramp.elements[1].color = (0.75, 0.82, 0.92, 1) nt.links.new(ramp.outputs['Color'], bg.inputs['Color']) bg.inputs['Strength'].default_value = 0.55 nt.links.new(bg.outputs['Background'], out.inputs['Surface']) # interior work light (render only, not exported) CS = bpy.data.collections["Studio"] if "Interior_Light" not in bpy.data.objects: ld = bpy.data.lights.new("Interior_Light", 'POINT') o = bpy.data.objects.new("Interior_Light", ld) CS.objects.link(o) ld = bpy.data.objects["Interior_Light"] ld.location = (0.35, -0.85, 2.05) ld.data.energy = 90 ld.data.shadow_soft_size = 0.15 ld.data.color = (0.85, 0.95, 1.0) # floor (studio only, not exported) if "Floor" not in bpy.data.objects: import bmesh me = bpy.data.meshes.new("Floor") bm = bmesh.new() vs = [bm.verts.new(p) for p in ((-25, -25, 0), (25, -25, 0), (25, 25, 0), (-25, 25, 0))] bm.faces.new(vs) bm.to_mesh(me); bm.free() fm = bpy.data.materials.get("Floor_Concrete") or bpy.data.materials.new("Floor_Concrete") fm.use_nodes = True b = fm.node_tree.nodes["Principled BSDF"] b.inputs["Base Color"].default_value = (0.10, 0.105, 0.115, 1) b.inputs["Roughness"].default_value = 0.35 me.materials.append(fm) fo = bpy.data.objects.new("Floor", me) CS.objects.link(fo)