0
$\begingroup$

A material will have some properties as "Color":

enter image description here

It can be changed with the python code (rgba):

bpy.data.worlds["World"].node_tree.nodes["Background"].inputs[0].default_value = (1, 0.5, 0.2, 1)

Can I update the alpha value only somehow? And not provide the color value as well. Say we want to change the alpha value to 0.5, I would have to pass the information (1, 0.5, 0.2, 0.5).

I would love your help

$\endgroup$

1 Answer 1

3
$\begingroup$

You can just use an index:

bpy.data.worlds["World"].node_tree.nodes["Background"].inputs[0].default_value[3] = 0.5
$\endgroup$

You must log in to answer this question.

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