import bpy, mathutils mat = bpy.data.materials.new(name = "Material.001") mat.use_nodes = True #initialize Material.001 node group def material_001_node_group(): material_001 = mat.node_tree #start with a clean node tree for node in material_001.nodes: material_001.nodes.remove(node) material_001.color_tag = 'NONE' material_001.description = "" material_001.default_group_node_width = 140 #material_001 interface #initialize material_001 nodes #node Principled BSDF principled_bsdf = material_001.nodes.new("ShaderNodeBsdfPrincipled") principled_bsdf.name = "Principled BSDF" principled_bsdf.distribution = 'MULTI_GGX' principled_bsdf.subsurface_method = 'RANDOM_WALK' #Metallic principled_bsdf.inputs[1].default_value = 0.0949999988079071 #IOR principled_bsdf.inputs[3].default_value = 1.5 #Alpha principled_bsdf.inputs[4].default_value = 1.0 #Diffuse Roughness principled_bsdf.inputs[7].default_value = 0.0 #Subsurface Weight principled_bsdf.inputs[8].default_value = 0.0 #Subsurface Radius principled_bsdf.inputs[9].default_value = (1.0, 0.20000000298023224, 0.10000000149011612) #Subsurface Scale principled_bsdf.inputs[10].default_value = 0.05000000074505806 #Subsurface Anisotropy principled_bsdf.inputs[12].default_value = 0.0 #Specular IOR Level principled_bsdf.inputs[13].default_value = 0.5 #Specular Tint principled_bsdf.inputs[14].default_value = (1.0, 1.0, 1.0, 1.0) #Anisotropic principled_bsdf.inputs[15].default_value = 0.0 #Anisotropic Rotation principled_bsdf.inputs[16].default_value = 0.0 #Tangent principled_bsdf.inputs[17].default_value = (0.0, 0.0, 0.0) #Transmission Weight principled_bsdf.inputs[18].default_value = 0.0 #Coat Weight principled_bsdf.inputs[19].default_value = 0.0 #Coat Roughness principled_bsdf.inputs[20].default_value = 0.029999999329447746 #Coat IOR principled_bsdf.inputs[21].default_value = 1.5 #Coat Tint principled_bsdf.inputs[22].default_value = (1.0, 1.0, 1.0, 1.0) #Coat Normal principled_bsdf.inputs[23].default_value = (0.0, 0.0, 0.0) #Sheen Weight principled_bsdf.inputs[24].default_value = 0.0 #Sheen Roughness principled_bsdf.inputs[25].default_value = 0.5 #Sheen Tint principled_bsdf.inputs[26].default_value = (1.0, 1.0, 1.0, 1.0) #Emission Color principled_bsdf.inputs[27].default_value = (1.0, 1.0, 1.0, 1.0) #Emission Strength principled_bsdf.inputs[28].default_value = 0.0 #Thin Film Thickness principled_bsdf.inputs[29].default_value = 0.0 #Thin Film IOR principled_bsdf.inputs[30].default_value = 1.3300000429153442 #node Material Output material_output = material_001.nodes.new("ShaderNodeOutputMaterial") material_output.name = "Material Output" material_output.is_active_output = True material_output.target = 'ALL' #Thickness material_output.inputs[3].default_value = 0.0 #node Wave Texture wave_texture = material_001.nodes.new("ShaderNodeTexWave") wave_texture.name = "Wave Texture" wave_texture.bands_direction = 'Y' wave_texture.rings_direction = 'X' wave_texture.wave_profile = 'SIN' wave_texture.wave_type = 'BANDS' #Scale wave_texture.inputs[1].default_value = 2.0 #Distortion wave_texture.inputs[2].default_value = 5.5 #Detail wave_texture.inputs[3].default_value = 3.5 #Detail Scale wave_texture.inputs[4].default_value = 3.0 #Detail Roughness wave_texture.inputs[5].default_value = 0.5 #Phase Offset wave_texture.inputs[6].default_value = 0.0 #node Mapping mapping = material_001.nodes.new("ShaderNodeMapping") mapping.name = "Mapping" mapping.vector_type = 'POINT' #Location mapping.inputs[1].default_value = (0.0, 0.0, 0.0) #Rotation mapping.inputs[2].default_value = (0.0, 0.0, 0.0) #Scale mapping.inputs[3].default_value = (1.0, 1.0, 1.0) #node Texture Coordinate texture_coordinate = material_001.nodes.new("ShaderNodeTexCoord") texture_coordinate.name = "Texture Coordinate" texture_coordinate.from_instancer = False #node Noise Texture noise_texture = material_001.nodes.new("ShaderNodeTexNoise") noise_texture.name = "Noise Texture" noise_texture.noise_dimensions = '3D' noise_texture.noise_type = 'FBM' noise_texture.normalize = True #Scale noise_texture.inputs[2].default_value = 6.5 #Detail noise_texture.inputs[3].default_value = 0.0 #Roughness noise_texture.inputs[4].default_value = 0.5 #Lacunarity noise_texture.inputs[5].default_value = 2.0 #Distortion noise_texture.inputs[8].default_value = 1.5 #node Mapping.001 mapping_001 = material_001.nodes.new("ShaderNodeMapping") mapping_001.name = "Mapping.001" mapping_001.vector_type = 'POINT' #Location mapping_001.inputs[1].default_value = (0.0, 0.0, 0.0) #Rotation mapping_001.inputs[2].default_value = (0.0, 0.0, 0.0) #Scale mapping_001.inputs[3].default_value = (1.0, 1.5, 0.699999988079071) #node Texture Coordinate.001 texture_coordinate_001 = material_001.nodes.new("ShaderNodeTexCoord") texture_coordinate_001.name = "Texture Coordinate.001" texture_coordinate_001.from_instancer = False #node Voronoi Texture voronoi_texture = material_001.nodes.new("ShaderNodeTexVoronoi") voronoi_texture.name = "Voronoi Texture" voronoi_texture.distance = 'CHEBYCHEV' voronoi_texture.feature = 'DISTANCE_TO_EDGE' voronoi_texture.normalize = False voronoi_texture.voronoi_dimensions = '3D' #Scale voronoi_texture.inputs[2].default_value = 6.599999904632568 #Detail voronoi_texture.inputs[3].default_value = 0.0 #Roughness voronoi_texture.inputs[4].default_value = 0.5 #Lacunarity voronoi_texture.inputs[5].default_value = 2.0 #Randomness voronoi_texture.inputs[8].default_value = 1.0 #node Mapping.002 mapping_002 = material_001.nodes.new("ShaderNodeMapping") mapping_002.name = "Mapping.002" mapping_002.vector_type = 'POINT' #Location mapping_002.inputs[1].default_value = (0.0, 0.0, 0.0) #Rotation mapping_002.inputs[2].default_value = (0.0, 0.0, 0.0) #Scale mapping_002.inputs[3].default_value = (1.0, 1.7999999523162842, 0.30000001192092896) #node Texture Coordinate.002 texture_coordinate_002 = material_001.nodes.new("ShaderNodeTexCoord") texture_coordinate_002.name = "Texture Coordinate.002" texture_coordinate_002.from_instancer = False #node Mix mix = material_001.nodes.new("ShaderNodeMix") mix.name = "Mix" mix.blend_type = 'MIX' mix.clamp_factor = True mix.clamp_result = False mix.data_type = 'RGBA' mix.factor_mode = 'UNIFORM' #Factor_Float mix.inputs[0].default_value = 0.550000011920929 #node Mix.001 mix_001 = material_001.nodes.new("ShaderNodeMix") mix_001.name = "Mix.001" mix_001.blend_type = 'MIX' mix_001.clamp_factor = True mix_001.clamp_result = False mix_001.data_type = 'RGBA' mix_001.factor_mode = 'UNIFORM' #Factor_Float mix_001.inputs[0].default_value = 0.4000000059604645 #node Color Ramp color_ramp = material_001.nodes.new("ShaderNodeValToRGB") color_ramp.name = "Color Ramp" color_ramp.color_ramp.color_mode = 'RGB' color_ramp.color_ramp.hue_interpolation = 'NEAR' color_ramp.color_ramp.interpolation = 'LINEAR' #initialize color ramp elements color_ramp.color_ramp.elements.remove(color_ramp.color_ramp.elements[0]) color_ramp_cre_0 = color_ramp.color_ramp.elements[0] color_ramp_cre_0.position = 0.0 color_ramp_cre_0.alpha = 1.0 color_ramp_cre_0.color = (0.006995370611548424, 0.0030352717731148005, 0.0024282168596982956, 1.0) color_ramp_cre_1 = color_ramp.color_ramp.elements.new(0.06818180531263351) color_ramp_cre_1.alpha = 1.0 color_ramp_cre_1.color = (0.039545994251966476, 0.029556870460510254, 0.021219024434685707, 1.0) color_ramp_cre_2 = color_ramp.color_ramp.elements.new(0.29090914130210876) color_ramp_cre_2.alpha = 1.0 color_ramp_cre_2.color = (0.09084115922451019, 0.06662603467702866, 0.04231143742799759, 1.0) color_ramp_cre_3 = color_ramp.color_ramp.elements.new(0.4681817591190338) color_ramp_cre_3.alpha = 1.0 color_ramp_cre_3.color = (0.038204118609428406, 0.05448034405708313, 0.01680739037692547, 1.0) color_ramp_cre_4 = color_ramp.color_ramp.elements.new(0.5500004291534424) color_ramp_cre_4.alpha = 1.0 color_ramp_cre_4.color = (0.10224109143018723, 0.08437631279230118, 0.042311444878578186, 1.0) #node Map Range map_range = material_001.nodes.new("ShaderNodeMapRange") map_range.name = "Map Range" map_range.clamp = True map_range.data_type = 'FLOAT' map_range.interpolation_type = 'LINEAR' #From Min map_range.inputs[1].default_value = 0.0 #From Max map_range.inputs[2].default_value = 1.0 #To Min map_range.inputs[3].default_value = 3.5 #To Max map_range.inputs[4].default_value = 0.6000000238418579 #node Bump bump = material_001.nodes.new("ShaderNodeBump") bump.name = "Bump" bump.invert = False #Strength bump.inputs[0].default_value = 1.0 #Distance bump.inputs[1].default_value = 0.20000000298023224 #Normal bump.inputs[3].default_value = (0.0, 0.0, 0.0) #node Displacement displacement = material_001.nodes.new("ShaderNodeDisplacement") displacement.name = "Displacement" displacement.space = 'OBJECT' #Midlevel displacement.inputs[1].default_value = 0.5 #Scale displacement.inputs[2].default_value = 0.20000000298023224 #Normal displacement.inputs[3].default_value = (0.0, 0.0, 0.0) #Set locations principled_bsdf.location = (800.0, 80.0) material_output.location = (1100.0, 60.0) wave_texture.location = (-356.5416564941406, 189.82418823242188) mapping.location = (-618.9093017578125, 173.35743713378906) texture_coordinate.location = (-867.946044921875, 187.06515502929688) noise_texture.location = (-333.8583068847656, -183.65272521972656) mapping_001.location = (-685.2884521484375, -320.2581787109375) texture_coordinate_001.location = (-934.3251953125, -306.5504455566406) voronoi_texture.location = (40.0, -280.0) mapping_002.location = (-200.0, -560.0) texture_coordinate_002.location = (-420.0, -560.0) mix.location = (-120.0, 120.0) mix_001.location = (120.0, 180.0) color_ramp.location = (480.0, 220.0) map_range.location = (560.0, -20.0) bump.location = (520.0, -300.0) displacement.location = (620.0, -480.0) #Set dimensions principled_bsdf.width, principled_bsdf.height = 240.0, 100.0 material_output.width, material_output.height = 140.0, 100.0 wave_texture.width, wave_texture.height = 150.0, 100.0 mapping.width, mapping.height = 140.0, 100.0 texture_coordinate.width, texture_coordinate.height = 140.0, 100.0 noise_texture.width, noise_texture.height = 140.0, 100.0 mapping_001.width, mapping_001.height = 140.0, 100.0 texture_coordinate_001.width, texture_coordinate_001.height = 140.0, 100.0 voronoi_texture.width, voronoi_texture.height = 140.0, 100.0 mapping_002.width, mapping_002.height = 140.0, 100.0 texture_coordinate_002.width, texture_coordinate_002.height = 140.0, 100.0 mix.width, mix.height = 140.0, 100.0 mix_001.width, mix_001.height = 140.0, 100.0 color_ramp.width, color_ramp.height = 240.0, 100.0 map_range.width, map_range.height = 140.0, 100.0 bump.width, bump.height = 140.0, 100.0 displacement.width, displacement.height = 140.0, 100.0 #initialize material_001 links #texture_coordinate.Object -> mapping.Vector material_001.links.new(texture_coordinate.outputs[3], mapping.inputs[0]) #mapping.Vector -> wave_texture.Vector material_001.links.new(mapping.outputs[0], wave_texture.inputs[0]) #texture_coordinate_001.Object -> mapping_001.Vector material_001.links.new(texture_coordinate_001.outputs[3], mapping_001.inputs[0]) #mapping_001.Vector -> noise_texture.Vector material_001.links.new(mapping_001.outputs[0], noise_texture.inputs[0]) #mapping_002.Vector -> voronoi_texture.Vector material_001.links.new(mapping_002.outputs[0], voronoi_texture.inputs[0]) #texture_coordinate_002.Object -> mapping_002.Vector material_001.links.new(texture_coordinate_002.outputs[3], mapping_002.inputs[0]) #wave_texture.Color -> mix.A material_001.links.new(wave_texture.outputs[0], mix.inputs[6]) #mix.Result -> mix_001.A material_001.links.new(mix.outputs[2], mix_001.inputs[6]) #voronoi_texture.Distance -> mix_001.B material_001.links.new(voronoi_texture.outputs[0], mix_001.inputs[7]) #noise_texture.Fac -> mix.B material_001.links.new(noise_texture.outputs[0], mix.inputs[7]) #mix_001.Result -> color_ramp.Fac material_001.links.new(mix_001.outputs[2], color_ramp.inputs[0]) #color_ramp.Color -> principled_bsdf.Base Color material_001.links.new(color_ramp.outputs[0], principled_bsdf.inputs[0]) #principled_bsdf.BSDF -> material_output.Surface material_001.links.new(principled_bsdf.outputs[0], material_output.inputs[0]) #mix_001.Result -> map_range.Value material_001.links.new(mix_001.outputs[2], map_range.inputs[0]) #map_range.Result -> principled_bsdf.Roughness material_001.links.new(map_range.outputs[0], principled_bsdf.inputs[2]) #mix_001.Result -> bump.Height material_001.links.new(mix_001.outputs[2], bump.inputs[2]) #bump.Normal -> principled_bsdf.Normal material_001.links.new(bump.outputs[0], principled_bsdf.inputs[5]) #mix_001.Result -> displacement.Height material_001.links.new(mix_001.outputs[2], displacement.inputs[0]) #displacement.Displacement -> material_output.Displacement material_001.links.new(displacement.outputs[0], material_output.inputs[2]) return material_001 material_001 = material_001_node_group()