Python: How to set Specular as surface in material

by Invariant   Last Updated August 14, 2019 00:15 AM

I would like to set Specular as Surface in the material, but I haven't figured out how to do that.

Here is my last try, mat is the Blender material:

        try:
            speccy = mat.node_tree.nodes["Specular"]
        except:
            speccy = mat.node_tree.nodes.new( type = 'ShaderNodeEeveeSpecular' )#create new specular
        mat.node_tree.links.new( speccy.outputs[0], mat.node_tree.nodes.new( type = 'ShaderNodeOutputMaterial' ).inputs['Surface'] )#set that mat as current

Any help appreciated.



Related Questions




python bpy.ops.screen.screenshot of 3D view with alpha

Updated January 04, 2019 02:15 AM

Live MIDI input for EEVEE

Updated August 21, 2019 04:15 AM