1
$\begingroup$

I created a lot of node group in file template.blend as template.
Then, I created C1.blend, C2.blend, etc, using node group from template.

To use the node group in template, I simply copied & paste an object that has material reference to the node groups.

It worked very well.

enter image description here

Today, I find that some of the node group are wrong, so I update them in template.

Below is an example that my node group was wrong. It is sometimes also related to node missing (e.g. must add 1 before the next operation). enter image description here

How to update all copied node groups of C1.blend to match the change in template?

Similar question : How to remove duplicated node groups? , but this old one aimed to use the oldest version, not the most updated one.

$\endgroup$
2
  • $\begingroup$ What exactly is wrong? Please provide more details about the group itself and ideally a before/after comparison. In general: once the groups are appended there is no direct link back to the node group in your template file so what would have to do is replacing the data-block of the old one by the new one which can be done manually or using python. $\endgroup$
    – brockmann
    Apr 3, 2021 at 7:18
  • $\begingroup$ @brockmann :: Thanks. I add an example of 'wrong'. I will try to use python. ^^ $\endgroup$ Apr 3, 2021 at 8:30

1 Answer 1

2
$\begingroup$

AFAIK There is no direct link back to the node group in your template file once the group is appended so what you would have to do is appending the new group and replace the data-block of the old one:

enter image description here

You might want to use python to automate this process for all materials within the blend file:

import bpy

D = bpy.data

for mat in D.materials:
    if hasattr(mat.node_tree, "nodes"):
        for node in mat.node_tree.nodes:
            if node.type == 'GROUP':
                if node.node_tree.name == "Template v1":
                    node.node_tree = D.node_groups['Template v2']
$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .