-
Notifications
You must be signed in to change notification settings - Fork 15
/
consts.py
167 lines (158 loc) · 6.36 KB
/
consts.py
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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
# Nodes that are deprecated and are replaced with hardcoded nodes but we still load the nodes
# from the JSON as we want the to work for backwards compatibility but we don't want them to show in
# the categories
from .components import networked_animation, networked_behavior
from io_hubs_addon.components.definitions import text, video, audio, media_frame, visible, rigid_body, physics_shape, networked_transform
DEPRECATED_NODES = [
"BGNode_hubs_material_set",
"BGNode_hubs_material_getColor",
"BGNode_hubs_material_setColor",
"BGNode_hubs_material_getMap",
"BGNode_hubs_material_setMap",
"BGNode_hubs_material_getTransparent",
"BGNode_hubs_material_setTransparent",
"BGNode_hubs_material_getOpacity",
"BGNode_hubs_material_setOpacity",
"BGNode_hubs_material_getAlphaMap",
"BGNode_hubs_material_setAlphaMap",
"BGNode_hubs_material_getToneMapped",
"BGNode_hubs_material_setToneMapped",
"BGNode_hubs_material_getEmissive",
"BGNode_hubs_material_setEmissive",
"BGNode_hubs_material_getEmissiveMap",
"BGNode_hubs_material_setEmissiveMap",
"BGNode_hubs_material_getEmissiveIntensity",
"BGNode_hubs_material_setEmissiveIntensity",
"BGNode_hubs_material_getRoughness",
"BGNode_hubs_material_setRoughness",
"BGNode_hubs_material_getRoughnessMap",
"BGNode_hubs_material_setRoughnessMap",
"BGNode_hubs_material_getMetalness",
"BGNode_hubs_material_setMetalness",
"BGNode_hubs_material_getMetalnessMap",
"BGNode_hubs_material_setMetalnessMap",
"BGNode_hubs_material_getLightMap",
"BGNode_hubs_material_setLightMap",
"BGNode_hubs_material_getLightMapIntensity",
"BGNode_hubs_material_setLightMapIntensity",
"BGNode_hubs_material_getAOMap",
"BGNode_hubs_material_setAOMap",
"BGNode_hubs_material_getAOMapIntensity",
"BGNode_hubs_material_setAOMapIntensity",
"BGNode_hubs_material_getNormalMap",
"BGNode_hubs_material_setNormalMap",
"BGNode_hubs_material_getWireframe",
"BGNode_hubs_material_setWireframe",
"BGNode_hubs_material_getFlatShading",
"BGNode_hubs_material_setFlatShading",
"BGNode_hubs_material_getFog",
"BGNode_hubs_material_setFog",
"BGNode_hubs_material_getDepthWrite",
"BGNode_hubs_material_setDepthWrite",
"BGNode_hubs_material_getalphaTest",
"BGNode_hubs_material_setalphaTest"
]
# Nodes we want to be loaded from the JSON spec but we just want to change their categories
CUSTOM_CATEGORY_NODES = ["BGNode_hubs_onPlayerJoined",
"BGNode_hubs_onPlayerLeft",
"BGNode_lifecycle_onStart",
"BGNode_lifecycle_onEnd",
"BGNode_lifecycle_onTick",
"BGNode_hubs_entity_components_custom_tags_removeTag",
"BGNode_hubs_entity_components_custom_tags_addTag",
"BGNode_hubs_entity_components_custom_tags_hasTag",
"BGNode_hubs_components_text_setText"]
# Categories that we don't want to load from the JSON because we are replacing them by hardcoded categories
FILTERED_CATEGORIES = ["Media", "Text", "String Math",
"Bool Math", "Int Math", "Float Math", "Vec3 Math", "Euler Math", "Physics", "Media Frame"]
MATERIAL_PROPERTIES_ENUM = [
("color", "Color", "Color"),
("map", "Map", "Map"),
("transparent", "Transparent", "Transparent"),
("opacity", "Opacity", "Opacity"),
("alphaMap", "AlphaMap", "AlphaMap"),
("toneMapped", "ToneMapped", "ToneMapped"),
("emissive", "Emissive", "Emissive"),
("emissiveMap", "EmissiveMap", "EmissiveMap"),
("emissiveIntensity", "EmissiveIntensity", "EmissiveIntensity"),
("roughness", "Roughness", "Roughness"),
("roughnessMap", "RoughnessMap", "RoughnessMap"),
("metalness", "Metalness", "Metalness"),
("metalnessMap", "MetalnessMap", "MetalnessMap"),
("lightMap", "LightMap", "LightMap"),
("lightMapIntensity", "LightMapIntensity", "LightMapIntensity"),
("aoMap", "AOMap", "AOMap"),
("aoMapIntensity", "AOMapIntensity", "AOMapIntensity"),
("normalMap", "NormalMap", "NormalMap"),
("wireframe", "Wireframe", "Wireframe"),
("flatShading", "FlatShading", "FlatShading"),
("fog", "Fog", "Fog"),
("depthWrite", "DepthWrite", "DepthWrite"),
("alphaTest", "AlphaTest", "AlphaTest")
]
MATERIAL_PROPERTIES_TO_TYPES = {
"color": "color",
"map": "texture",
"transparent": "boolean",
"opacity": "float",
"alphaMap": "texture",
"toneMapped": "boolean",
"emissive": "color",
"emissiveMap": "texture",
"emissiveIntensity": "float",
"roughness": "float",
"roughnessMap": "texture",
"metalness": "float",
"metalnessMap": "texture",
"lightMap": "texture",
"lightMapIntensity": "float",
"aoMap": "texture",
"aoMapIntensity": "float",
"normalMap": "texture",
"wireframe": "boolean",
"flatShading": "boolean",
"fog": "boolean",
"depthWrite": "boolean",
"alphaTest": "float"
}
CATEGORY_COLORS = {
"Event": (0.6, 0.2, 0.2),
"Flow": (0.2, 0.2, 0.2),
"Time": (0.3, 0.3, 0.3),
"Action": (0.2, 0.2, 0.6),
"None": (0.6, 0.6, 0.2),
"Networking": (0.0, 0.7, 0.7)
}
# Components that Get Entity Component support. Support for these need to be available in the Hubs client
SUPPORTED_COMPONENTS = [
video.Video.get_name(),
audio.Audio.get_name(),
text.Text.get_name(),
networked_animation.NetworkedAnimation.get_name(),
rigid_body.RigidBody.get_name(),
physics_shape.PhysicsShape.get_name(),
networked_transform.NetworkedTransform.get_name(),
networked_behavior.NetworkedBehavior.get_name(),
media_frame.MediaFrame.get_name(),
visible.Visible.get_name()
]
# Components that Set Component property support. Support for these need to be available in the Hubs client
SUPPORTED_PROPERTY_COMPONENTS = [
video.Video.get_name(),
audio.Audio.get_name(),
text.Text.get_name(),
rigid_body.RigidBody.get_name(),
media_frame.MediaFrame.get_name(),
visible.Visible.get_name(),
]
VARIABLES_TYPES = [
("boolean", "Boolean", "Boolean"),
("float", "Float", "Float"),
("integer", "Integer", "Integer"),
("string", "String", "String"),
("vec3", "Vector3", "Vector3"),
("animationAction", "Action", "Action"),
("entity", "Entity", "Entity"),
("color", "Color", "Color"),
("material", "Material", "Material")
]