Extracting output of a Node in Shader Editor as 2d Texture

Hello, can I extract output as texture of a node in shader editor using bpy and gpu libraries on Blender 4.2.x?

I can access node output for instance <bpy_struct, NodeSocketFloat("Fac") it has attributes of

['__doc__', '__module__', '__slots__', 'bl_idname', 'bl_label', 'bl_rna', 'bl_subtype_label', 'default_value', 'description', 'display_shape', 'draw', 'draw_color', 'draw_color_simple', 'enabled', 'hide', 'hide_value', 'identifier', 'is_linked', 'is_multi_input', 'is_output', 'is_unavailable', 'label', 'link_limit', 'name', 'node', 'rna_type', 'show_expanded', 'type']

However none of these functions or attributes seem to help me on baking or extracting the output as texture. Thanks in advance.

1 Like

No, but you can bake from a Python script. To get a specific node just plug that node into material output

1 Like

You have this script : Baker node
“name”: “Baker Node”,
“description”: “Adds a node to the shader editor that bakes its input with a single click”,
“author”: “Avelgest”,
“version”: (0, 7, 0),
“blender”: (3, 0, 0),
“category”: “Node”,
“location”: “Shader Editor > Add > Output > Baker”,
“warning”: “Beta version”,
“doc_url”: “https://github.com/avelgest/baker-node/wiki”

or this : BakeLab
“name” : “BakeLab”,
“author” : “Shahzod Boyxonov ([email protected])”,
“description” : “Bake textures easily”,
“blender” : (2, 81, 0),
“version” : (2, 0, 0),
“location” : “View3D > Properties > BakeLab”,
“category” : “Baking”


But if you want a coding answer, take a look in the pay addon: “Node preview”
“name”: “Node Preview”,
“author”: “Simon Wendsche (B.Y.O.B.)”,
“version”: (1, 14),
“blender”: (2, 83, 0),
“category”: “Node”,
“location”: “Shader Node Editor”,
“description”: “Displays rendered thumbnails above shader nodes”,
“warning”: “”,
“wiki_url”: “”,
“tracker_url”: “”,

Thank you for the suggestions. Maybe I can do something by inspecting the addon code.

Hello, to be perfectly clear there is no way to inspect the value of the output of a node at runtime, unless it is using its default value. The shaders are run as a monolith and you only have access to the material output and even then only if you bake the result to a texture.

I think if you use OSL it’s different, but I don’t know much about it so won’t venture into this territory.

I appreciate your answer and time. I have noticed that it is not possible to retrieve outcome texture from API easily. Although that I did not found a solution yet, there are some addons overcoming this problem. I think that baking a small preview texture on node connection changes should solve the problem, I will work on it.