42
42
pair = l.from_node, l.from_socket, l.to_node, l.to_socket
45
#print("NEW-CONNECTION", pair)
45
46
new_connections.append(l)
47
48
clinks = {(l.from_node, l.from_socket, l.to_node, l.to_socket) for l in self.links}
48
49
for l in hcanvas._links:
49
50
pair = l.from_node, l.from_socket, l.to_node, l.to_socket
50
51
if pair not in clinks:
52
#print("REMOVED-CONNECTION", pair)
51
53
removed_connections.append(l)
60
62
changed_nodes.append(l.to_node)
62
64
for l in removed_connections:
63
if l.from_node.label in deletions: continue
64
if l.to_node.label in deletions: continue
65
if l.from_node.identifier in deletions: continue
66
if l.to_node.identifier in deletions: continue
65
67
ok = hcanvas.gui_removes_connection(l)
67
69
logging.debug("removal of connection was disapproved, what to do?")
182
184
bl_label = 'Hive system workermap'
183
185
# Icon identifier
184
186
bl_icon = 'FORCE_MAGNETIC'
187
def poll(cls, context):
188
#TODO: only show these in "advanced" mode
188
def poll(cls, context):
189
return level.active_workergui(context)
192
192
class SpydermapNodeTree(bpy.types.NodeTree, HiveNodeTree):
193
193
# Description string
198
198
bl_label = 'Hive system spydermap'
199
199
# Icon identifier
200
200
bl_icon = 'FORCE_LENNARDJONES'
203
def poll(cls, context):
204
#TODO: only show these in "advanced" mode
202
def poll(cls, context):
203
return level.active_spydergui(context)
208
205
def draw_use_hive(self, context):
209
206
if context.space_data.tree_type == "Hivemap":
210
207
self.layout.prop(context.screen, "use_hive")
209
def draw_hive_level(self, context):
210
if BlendManager.use_hive_get(context):
211
self.layout.prop(context.screen, "hive_level")
212
213
def draw_spyderhive(self, context):
213
214
from .BlendManager import blendmanager
214
215
if context.space_data.tree_type == "Spydermap" and context.space_data.edit_tree is not None:
224
225
get = BlendManager.use_hive_get,
225
226
set = BlendManager.use_hive_set,
227
bpy.types.NODE_HT_header.append(draw_use_hive)
228
bpy.types.Screen.hive_level = bpy.props.EnumProperty(
230
description = "Hive logic level, unlocks more advanced hive features",
232
("1", "1: SPARTA", "Level 1: Only use standard SPARTA nodes", 1),
233
("2", "2: Advanced SPARTA", "Level 2: Use all SPARTA nodes and parameters", 2),
234
("3", "3: Dragonfly", "Level 3: Also use Dragonfly nodes", 3),
235
("4", "4: Custom workers", "Level 4: Enable custom worker GUI", 4),
236
("5", "5: Spyder hives", "Level 5: Enable Spyder hive GUI for custom configuration", 5),
237
("6", "6: Advanced", "Level 6: Enable blocks, wasps and other advanced hive features", 6),
239
update = BlendManager.change_hive_level
241
bpy.types.NODE_HT_header.append(draw_hive_level)
242
bpy.types.NODE_HT_header.append(draw_use_hive)
228
243
bpy.types.NODE_HT_header.append(draw_spyderhive)
232
247
bpy.utils.unregister_class(HivemapNodeTree)
233
248
bpy.utils.unregister_class(WorkermapNodeTree)
234
249
bpy.utils.unregister_class(SpydermapNodeTree)
235
bpy.types.NODE_HT_header.remove(draw_use_hive)
250
bpy.types.NODE_HT_header.remove(draw_hive_level)
251
bpy.types.NODE_HT_header.remove(draw_use_hive)
236
252
bpy.types.NODE_HT_header.remove(draw_spyderhive)
b'\\ No newline at end of file'