From 9820f273c2e1ca9df0d761b46fce3804f73001f3 Mon Sep 17 00:00:00 2001 From: pullusb Date: Thu, 22 Feb 2024 11:56:18 +0100 Subject: [PATCH] fix preview output in blender 4 1.6.1 - fixed: preview output for Blender 4.0+ --- CHANGELOG.md | 4 ++++ __init__.py | 2 +- fn.py | 10 ++++++++-- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9f4d1b9..170dca4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,10 @@ Activate / deactivate layer opacity according to prefix Activate / deactivate all masks using MA layers --> +1.6.1 + +- fixed: preview output for Blender 4.0+ + 1.6.0 - added: Connect selection to new or existing fileout diff --git a/__init__.py b/__init__.py index 03cc72a..5711654 100644 --- a/__init__.py +++ b/__init__.py @@ -2,7 +2,7 @@ bl_info = { "name": "GP Render", "description": "Organise export of gp layers through compositor output", "author": "Samuel Bernou", - "version": (1, 6, 0), + "version": (1, 6, 1), "blender": (3, 0, 0), "location": "View3D", "warning": "", diff --git a/fn.py b/fn.py index 8bb602f..9131848 100644 --- a/fn.py +++ b/fn.py @@ -864,8 +864,14 @@ def nodegroup_merge_inputs(ngroup, aa=True): y += offset_y prev = ao - # create one input and link - out = ngroup.outputs.new('NodeSocketColor', ngroup.inputs[0].name) + # Create one output and link + out_name = 'preview' + if bpy.app.version < (4,0,0): + # out_name = ngroup.inputs[0].name # name like first inputout_name + out = ngroup.outputs.new('NodeSocketColor', out_name) + else: + # out_name = next((s for s in ngroup.interface.items_tree if s.in_out == 'INPUT')).name # name like first input + out = ngroup.interface.new_socket(out_name, in_out='OUTPUT', socket_type='NodeSocketColor') ## create a merged name as output ?? if aa: