fix preview output in blender 4

1.6.1

- fixed: preview output for Blender 4.0+
This commit is contained in:
pullusb
2024-02-22 11:56:18 +01:00
parent c176f7ab6a
commit 9820f273c2
3 changed files with 13 additions and 3 deletions
+8 -2
View File
@@ -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: