- ⭾ Tab Enter inside the node to which you want to add a socket.
- Select any node (this solution needs
active_node
in context).
- Press ⬆ ShiftF4 to switch to Python Console.
- Paste one of the codez below, depending on your needs:
⚫ Scalar angle$°$
C.area.type = 'NODE_EDITOR'; C.active_node.id_data.inputs.new('NodeSocketFloatAngle', 'Angle')
⚫ Scalar distance (unit depends on settings, e.g. $m$)
C.area.type = 'NODE_EDITOR'; C.active_node.id_data.inputs.new('NodeSocketFloatDistance', 'Distance')
⚫ Scalar percentage $\%$
C.area.type = 'NODE_EDITOR'; C.active_node.id_data.inputs.new('NodeSocketFloatPercentage', 'Percentage')
⚫ Scalar time (unit depends on settings)
C.area.type = 'NODE_EDITOR'; C.active_node.id_data.inputs.new('NodeSocketFloatTimeAbsolute', 'Time')
⚫ Scalar factor ("slider")
C.area.type = 'NODE_EDITOR'; C.active_node.id_data.inputs.new('NodeSocketFloatFactor', 'Factor')
🟢 Integer (If you want to limit a custom shader/compositing group input to whole numbers)
C.area.type = 'NODE_EDITOR'; C.active_node.id_data.inputs.new('NodeSocketInt', 'Integer')
🟢 Integer factor (filling the field from left to right)
C.area.type = 'NODE_EDITOR'; C.active_node.id_data.inputs.new('NodeSocketIntFactor', 'Factor')
🟢 Integer percentage $\%$
C.area.type = 'NODE_EDITOR'; C.active_node.id_data.inputs.new('NodeSocketIntPercentage', 'Percentage')
🟣 Vector translation (unit depends on settings, e.g. $m$)
C.area.type = 'NODE_EDITOR'; C.active_node.id_data.inputs.new('NodeSocketVectorTranslation', 'Translation')
🟣 Vector velocity (unit depends on settings, e.g. $m/s$)
C.area.type = 'NODE_EDITOR'; C.active_node.id_data.inputs.new('NodeSocketVectorVelocity', 'Velocity')
🟣 Vector acceleration (unit depends on settings, e.g. $m/s²$)
C.area.type = 'NODE_EDITOR'; C.active_node.id_data.inputs.new('NodeSocketVectorAcceleration', 'Acceleration')
🟣 Vector Euler rotation$°$
C.area.type = 'NODE_EDITOR'; C.active_node.id_data.inputs.new('NodeSocketVectorEuler', 'Rotation')
❗🟣 Vector direction (
C.area.type = 'NODE_EDITOR'; C.active_node.id_data.inputs.new('NodeSocketVectorDirection', 'Direction')
❗ seems buggy and shows a black circle but that's because the default value is $(0, 0, 0)$ - set the default to to $(0, 0, 1)$, then delete the node and create a new one from the ⬆ ShiftA menu.
🟣 Vector XYZ (components have X/Y/Z labels)
C.area.type = 'NODE_EDITOR'; C.active_node.id_data.inputs.new('NodeSocketVectorXYZ', 'Vector')
❗👻 Virtual (⚠ CRASHES BLENDER IN GEONODES ⚠ gray color like geonodes last input/output socket)
C.area.type = 'NODE_EDITOR'; C.active_node.id_data.inputs.new('NodeSocketVirtual', 'Fancy Socket')
I decided to not litter this list with: NodeSocketObject
- outside of geonodes it behaves just like float but has an orange color. Some people might consider it nice to have an unusual color in their setups, but it can be misleading so I don't want to promote that; same goes for NodeSocketCollection
, NodeSocketGeometry
, NodeSocketImage
, NodeSocketMaterial
, NodeSocketShader
, NodeSocketString
, NodeSocketTexture
.
I also removed the Boolean node (NodeSocketBool
) - it would be useful if it worked like a float socket, but allowed only 2 values when no link is connected to the socket. At least the integer socket type works.
NodeSocketFloatTime
seems to not add any units, so I omitted it, as well as NodeSocketFloatUnsigned
and NodeSocketIntUnsigned
, as I don't know what they're supposed to do, they do display and pass negative values…