Amaranth: Fix poll for operators

* AMTH_NODE_OT_show_active_node_image in Node Editor
* AMTH_VIEW3D_OT_render_border_camera in 3D Viewport
This commit is contained in:
Pablo Vazquez 2022-09-19 23:34:40 +02:00
parent 3570274fe7
commit 0dd7b96286
Notes: blender-bot 2023-02-14 18:10:38 +01:00
Referenced by issue #103474, Amaranth Toolset addon: "Active Image Node in Editor" feature not working anymore
3 changed files with 3 additions and 3 deletions

View File

@ -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, 14),
"version": (1, 0, 15),
"blender": (3, 2, 0),
"location": "Everywhere!",
"description": "A collection of tools and settings to improve productivity",

View File

@ -32,7 +32,7 @@ class AMTH_NODE_OT_show_active_node_image(bpy.types.Operator):
@classmethod
def poll(cls, context):
return context.active_node is not None
return context.space_data == 'NODE_EDITOR' and context.active_node is not None
def execute(self, context):
return {'FINISHED'}

View File

@ -18,7 +18,7 @@ class AMTH_VIEW3D_OT_render_border_camera(bpy.types.Operator):
@classmethod
def poll(cls, context):
return context.space_data.region_3d.view_perspective == "CAMERA"
return context.space_data == 'VIEW_3D' and context.space_data.region_3d.view_perspective == "CAMERA"
def execute(self, context):
render = context.scene.render