Page MenuHome

Input and output sockets of ShaderNodeMath and ShaderNodeVectorMath have same names
Closed, ArchivedPublic

Description

Unlike other node types, the two vector input sockets and the vector output socket of ShaderNodeVectorMath all have the same name ("Vector") instead of "Vector1", "Vector2", etc. The same is true for ShaderNodeMath and its three value sockets.

This makes it hard to differentiate between the three sockets during export.

Blender 2.74, Windows, 64bit

To reproduce, download this .blend and execute the following script:

for node in material.node_tree.nodes:

	print("name: {0}".format(node.name))
	print("type: {0}".format(node.type))

	for input in node.inputs:
		print("  name: {0}".format(input.name))

	for output in node.outputs:
		print("  name: {0}".format(output.name))

Details

Type
To Do

Related Objects

Event Timeline

Matthias (vexator) added a project: BF Blender.
Matthias (vexator) set Type to Bug.
Matthias (vexator) created this task.
Matthias (vexator) raised the priority of this task from to Needs Triage by Developer.

Correction, I forgot the first line:

for material in bpy.data.materials:

	for node in material.node_tree.nodes:

		print("name: {0}".format(node.name))
		print("type: {0}".format(node.type))

		for input in node.inputs:
			print("  name: {0}".format(input.name))

		for output in node.outputs:
			print("  name: {0}".format(output.name))

This can be easily fixed by editing lines 38-39 and 44 in node_shader_math.c and lines 36-37 and 42 in node_shader_vectMath.c.

This isn't really a bug, just a small UI inconsistency. @Lukas Toenne (lukastoenne) mind looking into it, seems to be a quick thing?

Changing to todo but leaving open for now

Julian Eisel (Severin) changed Type from Bug to To Do.
Julian Eisel (Severin) triaged this task as Confirmed, Low priority.
Matthias (vexator) added a comment.EditedApr 24 2015, 4:35 PM

Thank you.

I'm writing an exporter for a game engine and I create shaders from a material's node tree. I need a way to tell the different node sockets apart and I can only do that by their names.

Alternatively, can you tell me how Blender tells the sockets apart internally?

Can I assign this to myself?

Brecht Van Lommel (brecht) closed this task as Archived.

I'd rather not change these at all at this point, see D4171: Fix T44508. It is still possible to use the node socket index to distinguish inputs.