-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathnode_socket.py
More file actions
98 lines (64 loc) · 2.1 KB
/
node_socket.py
File metadata and controls
98 lines (64 loc) · 2.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
import bmesh
import time
import bpy
from .node_system import *
# TODO 规范化socket和tree_values数据类型
color_dark = 0.39, 0.39, 0.39
color_gray = 0.63, 0.63, 0.63
color_blue = 0.39, 0.39, 0.78
color_green = 0.39, 0.78, 0.39
color_magenta = 0.78, 0.16, 0.78
color_red = 0.78, 0.39, 0.39
color_yellow = 0.78, 0.78, 0.16
color_cyan = 0.16, 0.78, 0.78
class NodeSocket_Int(PearlNodeSocket):
bl_idname = 'NodeSocket_Int'
bl_label = 'NodeSocket_Int'
socket_color = (0.45, 0.45, 0.45, 1.0)
socket_value : bpy.props.StringProperty()
class NodeSocket_Float(PearlNodeSocket):
bl_idname = 'NodeSocket_Float'
bl_label = 'NodeSocket_Float'
socket_color = (0.3, 1.0, 0.8, 1.0)
socket_value : bpy.props.StringProperty()
class NodeSocket_Vector(PearlNodeSocket):
bl_idname = 'NodeSocket_Vector'
bl_label = 'NodeSocket_Vector'
socket_color = (1.0, 0.4, 0.2, 1.0)
socket_value : bpy.props.StringProperty()
class NodeSocket_String(PearlNodeSocket):
bl_idname = 'NodeSocket_String'
bl_label = 'NodeSocket_String'
socket_color = (0.2, 0.7, 1.0, 1)
socket_value : bpy.props.StringProperty(default='')
class NodeSocket_Verts(PearlNodeSocket):
bl_idname = 'NodeSocket_Verts'
bl_label = 'NodeSocket_Verts'
socket_color = (0.2, 0.7, 1.0, 1)
socket_value : bpy.props.StringProperty(default='')
class NodeSocket_Edges(PearlNodeSocket):
bl_idname = 'NodeSocket_Edges'
bl_label = 'NodeSocket_Edges'
socket_color = (0.2, 0.7, 1.0, 1)
socket_value : bpy.props.StringProperty(default='')
class NodeSocket_Faces(PearlNodeSocket):
bl_idname = 'NodeSocket_Faces'
bl_label = 'NodeSocket_Faces'
socket_color = (0.2, 0.7, 1.0, 1)
socket_value : bpy.props.StringProperty(default='')
classes = [
NodeSocket_Int,
NodeSocket_Float,
NodeSocket_Vector,
NodeSocket_String,
NodeSocket_Verts,
NodeSocket_Edges,
NodeSocket_Faces
]
# register -------
def register():
for c in classes:
bpy.utils.register_class(c)
def unregister():
for c in reversed(classes):
bpy.utils.unregister_class(c)