The title is general: how can we use the API to edit Principled BSDF properties?
More specifically, I have a mesh that has vertex colors in it. The colors are fine, and I can use the mouse to have vertex colors as base color using the Shader Editor. Likewise, I can use the Material Properties and select "Vertex Colors | Color" for the base color of the material assigned to the mesh. This is all fine and both are equivalent ways.
However, how to accomplish that programmatically, via the API? I could do that in 2.7x but don't seem to be able to do the same in 2.81. Any idea?
EDIT: here a minimal example that works with 2.7x:
import bpy mat = "MyMaterial" bpy.ops.material.new() setattr(bpy.data.materials["Material"],"name",mat) setattr(bpy.data.materials[mat],"use_vertex_color_paint",True) Traceback (most recent call last): File "<blender_console>", line 1, in <module> AttributeError: 'Material' object has no attribute 'use_vertex_color_paint' ```