ShaderNodeScript(ShaderNode)

base classes — bpy_struct, Node, NodeInternal, ShaderNode

class bpy.types.ShaderNodeScript(ShaderNode)

Generate an OSL shader from a file or text data-block. Note: OSL shaders are not supported on all GPU backends

bytecode

Compile bytecode for shader script node (default “”, never None)

Type:

str

bytecode_hash

Hash of compile bytecode, for quick equality checking (default “”, never None)

Type:

str

filepath

Shader script path (default “”, never None, blend relative // prefix supported)

Type:

str

mode

(default 'INTERNAL')

  • INTERNAL Internal – Use internal text data-block.

  • EXTERNAL External – Use external .osl or .oso file.

Type:

Literal[‘INTERNAL’, ‘EXTERNAL’]

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) (default False)

Type:

bool

classmethod is_registered_node_type()

True if a registered node type

Returns:

Result

Return type:

bool

classmethod input_template(index)

Input socket template

Parameters:

index (int) – Index, (in [0, inf])

Returns:

result

Return type:

NodeInternalSocketTemplate

classmethod output_template(index)

Output socket template

Parameters:

index (int) – Index, (in [0, inf])

Returns:

result

Return type:

NodeInternalSocketTemplate

classmethod bl_rna_get_subclass(id, default=None, /)
Parameters:
  • id (str) – The RNA type identifier.

  • default (bpy.types.Struct | None) – The value to return when not found.

Returns:

The RNA type or default when not found.

Return type:

bpy.types.Struct

classmethod bl_rna_get_subclass_py(id, default=None, /)
Parameters:
  • id (str) – The RNA type identifier.

  • default (type | None) – The value to return when not found.

Returns:

The class or default when not found.

Return type:

type

Inherited Properties

Inherited Functions