please apologize if this is a weird question, but im stuck here. I am working on a script, that is creating and connecting some geometry nodes. This minimum example is creating a node of type ‘Mesh to Curve’. Furthermore this new node is connected to the ‘Group Input’:
import bpy # get object obj = bpy.data.objects['Cube'] # create group modifier_nodes = obj.modifiers.new(name='test', type='NODES') bpy.ops.node.new_geometry_node_group_assign() node_group = obj.modifiers['test'].node_group # add new node node_group.nodes.new(type="GeometryNodeMeshToCurve") # link the new node to the group input input = node_group.nodes['Mesh to Curve'].inputs['Mesh'] output = node_group.nodes['Group Input'].outputs['Geometry'] node_group.links.new(input, output)
This is working fine, if the default language is set to english. When the user is changing the default language, an error message is dropped:
KeyError: ‘bpy_prop_collection[key]: key “Mesh to Curve” not found’
I guess the problem here is, that the geometry node ‘Group Input’ is called differently in every language. When switching to german for example, it is called ‘Gruppeneingabe’, in spain it is called ‘Entradas del grupo’.
I can avoid this issue for every new node by assigning a specific name to it. But how can i access the ‘Group Input’ in every language? (and later on the output)
I have tried to acces:
But this is not necessarily the ‘Group Input’ in all languages.
Thank you in advance!