Function
create_socket
(
inputs_or_outputs: Union[bpy.types.NodeInputs, bpy.types.NodeOutputs],
name: str,
*,
description: str = "",
data_type: str = "",
prop_name: str = "",
socket_type: type[T_socket] = sverchok.core.sockets.SvStringsSocket,
)
Source from the content-addressed store, hash-verified
| 118 | |
| 119 | |
| 120 | def create_socket( |
| 121 | inputs_or_outputs: Union[bpy.types.NodeInputs, bpy.types.NodeOutputs], |
| 122 | name: str, |
| 123 | *, |
| 124 | description: str = "", |
| 125 | data_type: str = "", |
| 126 | prop_name: str = "", |
| 127 | socket_type: type[T_socket] = sverchok.core.sockets.SvStringsSocket, |
| 128 | ) -> T_socket: |
| 129 | socket = inputs_or_outputs.new(socket_type.bl_idname, name) |
| 130 | assert isinstance(socket, socket_type) |
| 131 | |
| 132 | if data_type: |
| 133 | data_type = f"Type: `{data_type}`." |
| 134 | description = "\n\n".join(filter(None, [description, data_type])) |
| 135 | socket.description = description |
| 136 | |
| 137 | if prop_name: |
| 138 | socket.prop_name = prop_name |
| 139 | return socket |
| 140 | |
| 141 | |
| 142 | def get_file() -> ifcopenshell.file: |
Callers
nothing calls this directly
Tested by
no test coverage detected