Browse Source

updated json to include option to allow or disallow bypass on nodes and added logic in node generation for this

Jonathan Higgins 1 month ago
parent
commit
9330808053

+ 2 - 0
dev_tools/json_editor/json_editor.gd

@@ -88,6 +88,7 @@ func edit_node(key: String):
 		$HBoxContainer/VBoxContainer2/HBoxContainer8/outputisstereo.button_pressed = bool(info.get("outputisstereo"))
 		$HBoxContainer/VBoxContainer2/HBoxContainer8/outputisstereo.button_pressed = bool(info.get("outputisstereo"))
 		$HBoxContainer/VBoxContainer2/HBoxContainer9/inputtype.text = str(info.get("inputtype", ""))
 		$HBoxContainer/VBoxContainer2/HBoxContainer9/inputtype.text = str(info.get("inputtype", ""))
 		$HBoxContainer/VBoxContainer2/HBoxContainer11/outputtype.text = str(info.get("outputtype", ""))
 		$HBoxContainer/VBoxContainer2/HBoxContainer11/outputtype.text = str(info.get("outputtype", ""))
+		$HBoxContainer/VBoxContainer2/HBoxContainer10/allowbypass.button_pressed = bool(info.get("allowbypass"))
 		
 		
 		for child in parameter_container.get_children():
 		for child in parameter_container.get_children():
 			child.queue_free()
 			child.queue_free()
@@ -208,6 +209,7 @@ func save_node(is_new: bool) -> void:
 		"outputisstereo": $HBoxContainer/VBoxContainer2/HBoxContainer8/outputisstereo.button_pressed,
 		"outputisstereo": $HBoxContainer/VBoxContainer2/HBoxContainer8/outputisstereo.button_pressed,
 		"inputtype": $HBoxContainer/VBoxContainer2/HBoxContainer9/inputtype.text,
 		"inputtype": $HBoxContainer/VBoxContainer2/HBoxContainer9/inputtype.text,
 		"outputtype": $HBoxContainer/VBoxContainer2/HBoxContainer11/outputtype.text,
 		"outputtype": $HBoxContainer/VBoxContainer2/HBoxContainer11/outputtype.text,
+		"allowbypass": $HBoxContainer/VBoxContainer2/HBoxContainer10/allowbypass.button_pressed,
 		"parameters": {}
 		"parameters": {}
 	}
 	}
 
 

+ 11 - 0
dev_tools/json_editor/json_editor.tscn

@@ -215,6 +215,17 @@ text = "Output Type (array):"
 layout_mode = 2
 layout_mode = 2
 size_flags_horizontal = 3
 size_flags_horizontal = 3
 
 
+[node name="HBoxContainer10" type="HBoxContainer" parent="HBoxContainer/VBoxContainer2"]
+layout_mode = 2
+
+[node name="Label" type="Label" parent="HBoxContainer/VBoxContainer2/HBoxContainer10"]
+custom_minimum_size = Vector2(250, 0)
+layout_mode = 2
+text = "Allow bypass:"
+
+[node name="allowbypass" type="CheckBox" parent="HBoxContainer/VBoxContainer2/HBoxContainer10"]
+layout_mode = 2
+
 [node name="ScrollContainer" type="ScrollContainer" parent="HBoxContainer/VBoxContainer2"]
 [node name="ScrollContainer" type="ScrollContainer" parent="HBoxContainer/VBoxContainer2"]
 custom_minimum_size = Vector2(0, 10)
 custom_minimum_size = Vector2(0, 10)
 layout_mode = 2
 layout_mode = 2

+ 7 - 6
scenes/Nodes/node_logic.gd

@@ -33,12 +33,13 @@ func _ready() -> void:
 	btn.connect("pressed", Callable(self, "_open_help")) #pass key (process name) when button is pressed
 	btn.connect("pressed", Callable(self, "_open_help")) #pass key (process name) when button is pressed
 	titlebar.add_child(btn)
 	titlebar.add_child(btn)
 	
 	
-	#add bypass
-	var bypass_btn = Button.new()
-	bypass_btn.text = "⏻"
-	bypass_btn.tooltip_text = "Bypass node from thread processing"
-	bypass_btn.pressed.connect(_bypass_node)
-	titlebar.add_child(bypass_btn)
+	if has_meta("allow_bypass") and get_meta("allow_bypass"):
+		#add bypass
+		var bypass_btn = Button.new()
+		bypass_btn.text = "⏻"
+		bypass_btn.tooltip_text = "Bypass node from thread processing"
+		bypass_btn.pressed.connect(_bypass_node)
+		titlebar.add_child(bypass_btn)
 	
 	
 	await get_tree().process_frame
 	await get_tree().process_frame
 	#reset_size()
 	#reset_size()

File diff suppressed because it is too large
+ 126 - 1
scenes/main/process_help.json


+ 3 - 0
scenes/main/scripts/graph_edit.gd

@@ -54,6 +54,7 @@ func _make_node(command: String, skip_undo_redo := false) -> GraphNode:
 			#var effect: GraphNode = Nodes.get_node(NodePath(command)).duplicate()
 			#var effect: GraphNode = Nodes.get_node(NodePath(command)).duplicate()
 			var effect = Utilities.nodes[command].instantiate()
 			var effect = Utilities.nodes[command].instantiate()
 			effect.name = command
 			effect.name = command
+			effect.set_meta("allow_bypass", false) #set a meta to block any bypass attempts on utils
 			#add node and register it for undo redo
 			#add node and register it for undo redo
 			control_script.undo_redo.create_action("Add Node")
 			control_script.undo_redo.create_action("Add Node")
 			control_script.undo_redo.add_do_method(add_child.bind(effect, true))
 			control_script.undo_redo.add_do_method(add_child.bind(effect, true))
@@ -88,6 +89,7 @@ func _make_node(command: String, skip_undo_redo := false) -> GraphNode:
 			#get node properties
 			#get node properties
 			var stereo = node_info.get("stereo", false)
 			var stereo = node_info.get("stereo", false)
 			var outputisstereo = node_info.get("outputisstereo", false) #used to identify the few processes that always output in stereo making the thread need to be stereo
 			var outputisstereo = node_info.get("outputisstereo", false) #used to identify the few processes that always output in stereo making the thread need to be stereo
+			var allowbypass = node_info.get("allowbypass", false)
 			var inputs = JSON.parse_string(node_info.get("inputtype", ""))
 			var inputs = JSON.parse_string(node_info.get("inputtype", ""))
 			var outputs = JSON.parse_string(node_info.get("outputtype", ""))
 			var outputs = JSON.parse_string(node_info.get("outputtype", ""))
 			var portcount = max(inputs.size(), outputs.size())
 			var portcount = max(inputs.size(), outputs.size())
@@ -99,6 +101,7 @@ func _make_node(command: String, skip_undo_redo := false) -> GraphNode:
 			graphnode.set_meta("command", command)
 			graphnode.set_meta("command", command)
 			graphnode.set_meta("stereo_input", stereo)
 			graphnode.set_meta("stereo_input", stereo)
 			graphnode.set_meta("output_is_stereo", outputisstereo)
 			graphnode.set_meta("output_is_stereo", outputisstereo)
+			graphnode.set_meta("allow_bypass", allowbypass)
 			if inputs.size() == 0 and outputs.size() > 0:
 			if inputs.size() == 0 and outputs.size() > 0:
 				graphnode.set_meta("input", true)
 				graphnode.set_meta("input", true)
 			else:
 			else:

Some files were not shown because too many files changed in this diff