fix merge function for blender4
parent
74d94e2cdb
commit
a6e8da6973
29
fn.py
29
fn.py
|
@ -447,15 +447,28 @@ def remove_nodes_by_viewlayer(viewlayer_list, scene=None):
|
||||||
# remove input and output from group
|
# remove input and output from group
|
||||||
# grp.inputs.remove(sockin) # do not clear inside !!
|
# grp.inputs.remove(sockin) # do not clear inside !!
|
||||||
# grp.outputs.remove(sockout) # do not clear inside !!
|
# grp.outputs.remove(sockout) # do not clear inside !!
|
||||||
|
|
||||||
ngroup = grp.node_tree
|
ngroup = grp.node_tree
|
||||||
for i in range(len(grp.inputs))[::-1]:
|
if bpy.app.version < (4,0,0):
|
||||||
if grp.inputs[i].name == sockin.name:
|
for i in range(len(grp.inputs))[::-1]:
|
||||||
ngroup.inputs.remove(ngroup.inputs[i])
|
if grp.inputs[i].name == sockin.name:
|
||||||
break
|
ngroup.inputs.remove(ngroup.inputs[i])
|
||||||
for i in range(len(grp.outputs))[::-1]:
|
break
|
||||||
if grp.outputs[i].name == sockout.name:
|
for i in range(len(grp.outputs))[::-1]:
|
||||||
ngroup.outputs.remove(ngroup.outputs[i])
|
if grp.outputs[i].name == sockout.name:
|
||||||
break
|
ngroup.outputs.remove(ngroup.outputs[i])
|
||||||
|
break
|
||||||
|
else:
|
||||||
|
g_inputs = [s for s in ngroup.interface.items_tree if s.in_out == 'INPUT']
|
||||||
|
g_outputs = [s for s in ngroup.interface.items_tree if s.in_out == 'OUTPUT']
|
||||||
|
for i in range(len(grp.inputs))[::-1]:
|
||||||
|
if grp.inputs[i].name == sockin.name:
|
||||||
|
ngroup.interface.remove(g_inputs[i])
|
||||||
|
break
|
||||||
|
for i in range(len(grp.outputs))[::-1]:
|
||||||
|
if grp.outputs[i].name == sockout.name:
|
||||||
|
ngroup.interface.remove(g_outputs[i])
|
||||||
|
break
|
||||||
|
|
||||||
# Remove render_layer node
|
# Remove render_layer node
|
||||||
scene.node_tree.nodes.remove(n)
|
scene.node_tree.nodes.remove(n)
|
||||||
|
|
Loading…
Reference in New Issue