Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender-addons.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPablo Vazquez <pablo@blender.org>2022-05-06 18:59:12 +0300
committerPablo Vazquez <pablo@blender.org>2022-05-06 18:59:12 +0300
commit67e43f9083b79b33f5aa6ac4d1630946804d9534 (patch)
treebe3b3b55fdb41554777c3e36339757368c7af313 /amaranth
parent5bc28b4eb46b427c818f3493a290954431dee38f (diff)
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.
Diffstat (limited to 'amaranth')
-rw-r--r--amaranth/__init__.py2
-rw-r--r--amaranth/node_editor/display_image.py12
2 files changed, 12 insertions, 2 deletions
diff --git a/amaranth/__init__.py b/amaranth/__init__.py
index 998c71e7..06a42c8e 100644
--- a/amaranth/__init__.py
+++ b/amaranth/__init__.py
@@ -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",
diff --git a/amaranth/node_editor/display_image.py b/amaranth/node_editor/display_image.py
index 77b081b2..e0d68190 100644
--- a/amaranth/node_editor/display_image.py
+++ b/amaranth/node_editor/display_image.py
@@ -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'}