Input and output sockets of ShaderNodeMath and ShaderNodeVectorMath have same names #44508

Closed
opened 2015-04-24 14:55:24 +02:00 by Matthias · 12 comments

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))
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](https://dl.dropboxusercontent.com/u/29334382/bug.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)) ```
Author

Changed status to: 'Open'

Changed status to: 'Open'
Author

Added subscriber: @vexator

Added subscriber: @vexator
Author

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))

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)) ```
Author

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 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.
Member

Added subscribers: @LukasTonne, @JulianEisel

Added subscribers: @LukasTonne, @JulianEisel
Member

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

Changing to todo but leaving open for now

This isn't really a bug, just a small UI inconsistency. @LukasTonne mind looking into it, seems to be a quick thing? Changing to todo but leaving open for now
Lukas Tönne was assigned by Julian Eisel 2015-04-24 15:47:38 +02:00
Author

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?

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?

Added subscriber: @padthai

Added subscriber: @padthai

Can I assign this to myself?

Can I assign this to myself?

Added subscriber: @brecht

Added subscriber: @brecht

Changed status from 'Open' to: 'Archived'

Changed status from 'Open' to: 'Archived'

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

I'd rather not change these at all at this point, see [D4171: Fix #44508](https://archive.blender.org/developer/D4171). It is still possible to use the node socket index to distinguish inputs.
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
4 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#44508
No description provided.