ShaderNodeScript(ShaderNode)

base classes — bpy_struct, Node, ShaderNode

class bpy.types.ShaderNodeScript(ShaderNode)
bytecode

Compile bytecode for shader script node

Type :string, default “”, (never None)
bytecode_hash

Hash of compile bytecode, for quick equality checking

Type :string, default “”, (never None)
filepath

Shader script path

Type :string, default “”, (never None)
mode
  • INTERNAL Internal, Use internal text datablock.
  • EXTERNAL External, Use external .osl or .oso file.
Type :enum in [‘INTERNAL’, ‘EXTERNAL’], default ‘INTERNAL’
script

Internal shader script to define the shader

Type :Text
use_auto_update

Automatically update the shader when the .osl file changes (external scripts only)

Type :boolean, default False
classmethod get_node_type()

Get the identifier of the node type

Returns:Result
Return type:string, (never None)
find_socket(name, is_output=False)

Find a socket by name

Parameters:
  • name (string, (never None)) – Socket name
  • is_output (boolean, (optional)) – Output, Whether the socket is an output
Return type:

NodeSocket

add_socket(name, type, is_output=False)

Add a socket socket

Parameters:
  • name (string, (never None)) – Name
  • type (enum in [‘VALUE’, ‘VECTOR’, ‘RGBA’, ‘SHADER’, ‘BOOLEAN’, ‘MESH’, ‘INT’, ‘STRING’]) – Type
  • is_output (boolean, (optional)) – Output, Whether the socket is an output
Return type:

NodeSocket

remove_socket(sock)

Remove a socket socket

Parameters:sock (NodeSocket, (never None)) – Socket

Inherited Properties

Inherited Functions

Previous topic

ShaderNodeRGBToBW(ShaderNode)

Next topic

ShaderNodeSeparateRGB(ShaderNode)