[Bf-extensions-cvs] [b87642c5] blender-v3.2-release: Fix T93334: Amaranth fails to preview Image nodes

Pablo Vazquez noreply at git.blender.org
Fri May 6 17:58:22 CEST 2022


Commit: b87642c5dcbfe5d2779e070984ce0914b8f64f78
Author: Pablo Vazquez
Date:   Fri May 6 17:53:47 2022 +0200
Branches: blender-v3.2-release
https://developer.blender.org/rBAb87642c5dcbfe5d2779e070984ce0914b8f64f78

Fix T93334: Amaranth fails to preview Image nodes

The operator assumed an active node. Simply add a poll to check for it.

Also increase the Blender version, 2.81 didn't even have Geometry Nodes.

===================================================================

M	amaranth/__init__.py
M	amaranth/node_editor/display_image.py

===================================================================

diff --git a/amaranth/__init__.py b/amaranth/__init__.py
index 41530937..998c71e7 100644
--- a/amaranth/__init__.py
+++ b/amaranth/__init__.py
@@ -74,8 +74,8 @@ 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, 8),
-    "blender": (2, 81, 0),
+    "version": (1, 0, 9),
+    "blender": (3, 2, 0),
     "location": "Everywhere!",
     "description": "A collection of tools and settings to improve productivity",
     "warning": "",
diff --git a/amaranth/node_editor/display_image.py b/amaranth/node_editor/display_image.py
index 380166a9..77b081b2 100644
--- a/amaranth/node_editor/display_image.py
+++ b/amaranth/node_editor/display_image.py
@@ -26,9 +26,13 @@ image_nodes = ("CompositorNodeRLayers",
 class AMTH_NODE_OT_show_active_node_image(bpy.types.Operator):
     """Show active image node image in the image editor"""
     bl_idname = "node.show_active_node_image"
-    bl_label = "Show Active Node Node"
+    bl_label = "Preview Image from Node"
     bl_options = {"UNDO"}
 
+    @classmethod
+    def poll(cls, context):
+        return context.active_node is not None
+
     def execute(self, context):
         return {'FINISHED'}



More information about the Bf-extensions-cvs mailing list