Closed BrendanParmer closed 2 years ago
Blender's input socket collections for some reason don't use unique keys for certain nodes, using input.name instead of input.identifier. For example, the Accumulate Field node input sockets look like
input.name
input.identifier
{ "Value" : (1.0, 1.0, 1.0), "Value" : 1.0, "Value" : 1, "Group Index" : 0 }
when it should be
{ "Value Vector" : (1.0, 1.0, 1.0), "Value Float" : 1.0, "Value Int" : 1, "Group Index" : 0, }
In this case, we can get around it by accessing values using indices rather than the keys themselves, since we're just copying the original node.
#old node.inputs["key"] = value #new node.inputs[key_index] = value
But this approach makes it more difficult to tell what value is actually being set here, at least without a comment saying the name.
I'll probably submit a bug report to Blender and see if it wouldn't be too bad to fix this issue.
Blender's input socket collections for some reason don't use unique keys for certain nodes, using
input.name
instead ofinput.identifier
. For example, the Accumulate Field node input sockets look likewhen it should be
In this case, we can get around it by accessing values using indices rather than the keys themselves, since we're just copying the original node.
But this approach makes it more difficult to tell what value is actually being set here, at least without a comment saying the name.
I'll probably submit a bug report to Blender and see if it wouldn't be too bad to fix this issue.