Skip to content
Snippets Groups Projects
Commit 67e43f90 authored by Pablo Vazquez's avatar Pablo Vazquez
Browse files

Amaranth: Support Image preview on Geometry Nodes

Limited to unconnected sockets though, it's a bit tricky to get the linked
socket's image since they are evaluated on runtime.

Thanks Dalai for the help.
parent 5bc28b4e
Branches
Tags
No related merge requests found
......@@ -74,7 +74,7 @@ from amaranth.misc import (
bl_info = {
"name": "Amaranth Toolset",
"author": "Pablo Vazquez, Bassam Kurdali, Sergey Sharybin, Lukas Tönne, Cesar Saez, CansecoGPC",
"version": (1, 0, 9),
"version": (1, 0, 10),
"blender": (3, 2, 0),
"location": "Everywhere!",
"description": "A collection of tools and settings to improve productivity",
......
......@@ -20,7 +20,8 @@ image_nodes = ("CompositorNodeRLayers",
"CompositorNodeViewer",
"CompositorNodeComposite",
"ShaderNodeTexImage",
"ShaderNodeTexEnvironment")
"ShaderNodeTexEnvironment",
"GeometryNodeImageTexture")
class AMTH_NODE_OT_show_active_node_image(bpy.types.Operator):
......@@ -70,8 +71,17 @@ class AMTH_NODE_OT_show_active_node_image(bpy.types.Operator):
elif active_node.bl_idname in ["CompositorNodeComposite", "CompositorNodeRLayers"]:
space.image = bpy.data.images[
"Render Result"]
elif active_node.bl_idname == "GeometryNodeImageTexture":
if active_node.inputs['Image'].is_linked:
self.report({'INFO'}, "Previewing linked sockets is not supported yet")
break
if active_node.inputs['Image'].default_value:
space.image = active_node.inputs['Image'].default_value
elif active_node.image:
space.image = active_node.image
else:
self.report({'INFO'}, "No image detected")
break
break
else:
return {'CANCELLED'}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment