0
$\begingroup$

I have a blend file in which all the materials alpha value is 0. There are too many materials for me to change the alpha value manually to 1. Is there a way I can change alpha valuec of all materials in a single go??

$\endgroup$

2 Answers 2

2
$\begingroup$

Try running this script

import bpy
for mat in bpy.data.materials:
    if not mat.use_nodes: continue
    for n in mat.node_tree.nodes:
        if n.type == 'BSDF_PRINCIPLED':
            n.inputs["Alpha"].default_value = 1
$\endgroup$
1
  • $\begingroup$ thanks you saved my lot of time $\endgroup$ Commented Jan 17, 2021 at 18:49
0
$\begingroup$

Based on top suggestion i made this script:

import bpy
for mat in bpy.data.materials:
    if not mat.use_nodes: continue
    if mat.blend_method == "BLEND":
        mat.blend_method = "HASHED"

it works on blender 3.1

$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .