bpy.ops.node.tree_socket_add(in_out=‘IN’)Add an input or output socket to the current node tree
[TABLE=“class: docutils field-list”]
[TR=“class: field-odd field”]
[TH=“class: field-name, bgcolor: #EEDDEE, align: left”]Parameters:[/TH]
in_out (enum in [‘IN’, ‘OUT’], (optional)) – Socket Type
[/TR]
[/TABLE]
How must this command look like if i want to specify a Socket Type?
There is this (optional) which should do what i want, but i can’t figure out how this command has to look like.
it must be something like:
bpy.ops.node.tree_socket_add(in_out=‘IN’, ‘VECTOR’)
Here’s what i got:
import bpy
class LayoutDemoPanel(bpy.types.Panel):
"""Creates a Panel in the scene context of the properties editor"""
bl_label = "Layout Demo"
bl_idname = "SCENE_PT_layout"
bl_space_type = 'NODE_EDITOR'
bl_region_type = 'UI'
bl_context = "UI"
def draw(self, context):
self.layout.operator("node.function")
return{'finished'}
class SCENE_PT_layout(bpy.types.Operator):
bl_idname = "node.function"
bl_label = "Make Mesh"
def execute(self, context):
bpy.ops.node.tree_socket_add(in_out='IN', 'VECTOR')
def register():
bpy.utils.register_class(LayoutDemoPanel)
def unregister():
bpy.utils.unregister_class(LayoutDemoPanel)
if __name__ == "__main__":
register()
