Added add quad at and add triangle at options to mdr's gui, adn set up call paths for them.

This commit is contained in:
Relintai 2022-01-14 15:24:59 +01:00
parent 7b0d382f57
commit 8e546e113f
4 changed files with 51 additions and 5 deletions

View File

@ -150,3 +150,9 @@ func _on_connect_pressed():
func _on_disconnect_pressed():
plugin.disconnect_action()
func _on_add_triangle_at_pressed():
plugin.add_triangle_at()
func _on_add_auad_at_pressed():
plugin.add_quad_at()

View File

@ -373,18 +373,42 @@ margin_right = 1010.0
margin_bottom = 20.0
text = "Box"
[node name="AddTriangle" type="Button" parent="VBoxContainer/Add/Add"]
[node name="Tri" type="HBoxContainer" parent="VBoxContainer/Add/Add"]
margin_top = 24.0
margin_right = 1010.0
margin_bottom = 44.0
text = "Triangle"
size_flags_horizontal = 3
[node name="AdQuad" type="Button" parent="VBoxContainer/Add/Add"]
[node name="AddTriangle" type="Button" parent="VBoxContainer/Add/Add/Tri"]
margin_right = 980.0
margin_bottom = 20.0
size_flags_horizontal = 3
text = "Tri"
[node name="At" type="Button" parent="VBoxContainer/Add/Add/Tri"]
margin_left = 984.0
margin_right = 1010.0
margin_bottom = 20.0
text = "At"
[node name="Quad" type="HBoxContainer" parent="VBoxContainer/Add/Add"]
margin_top = 48.0
margin_right = 1010.0
margin_bottom = 68.0
size_flags_horizontal = 3
[node name="AddQuad" type="Button" parent="VBoxContainer/Add/Add/Quad"]
margin_right = 980.0
margin_bottom = 20.0
size_flags_horizontal = 3
text = "Quad"
[node name="At" type="Button" parent="VBoxContainer/Add/Add/Quad"]
margin_left = 984.0
margin_right = 1010.0
margin_bottom = 20.0
text = "At"
[node name="HSeparator2" type="HSeparator" parent="VBoxContainer"]
margin_top = 424.0
margin_right = 1010.0
@ -447,5 +471,7 @@ script = ExtResource( 3 )
[connection signal="pressed" from="VBoxContainer/FaceOps/Operations/Disconnect" to="." method="_on_disconnect_pressed"]
[connection signal="pressed" from="VBoxContainer/Operations/Operations/UnwrapButton" to="." method="_on_UnwrapButton_pressed"]
[connection signal="pressed" from="VBoxContainer/Add/Add/AddBox" to="." method="_on_AddBox_pressed"]
[connection signal="pressed" from="VBoxContainer/Add/Add/AddTriangle" to="." method="_on_add_triangle_pressed"]
[connection signal="pressed" from="VBoxContainer/Add/Add/AdQuad" to="." method="_on_add_quad_pressed"]
[connection signal="pressed" from="VBoxContainer/Add/Add/Tri/AddTriangle" to="." method="_on_add_triangle_pressed"]
[connection signal="pressed" from="VBoxContainer/Add/Add/Tri/At" to="." method="_on_add_triangle_at_pressed"]
[connection signal="pressed" from="VBoxContainer/Add/Add/Quad/AddQuad" to="." method="_on_add_quad_pressed"]
[connection signal="pressed" from="VBoxContainer/Add/Add/Quad/At" to="." method="_on_add_auad_at_pressed"]

View File

@ -383,6 +383,12 @@ func add_quad() -> void:
if _mdr:
MDRMeshUtils.add_quad(_mdr)
func add_triangle_at() -> void:
pass
func add_quad_at() -> void:
pass
func add_box() -> void:
if _mdr:
MDRMeshUtils.add_box(_mdr)

View File

@ -182,6 +182,14 @@ func add_quad() -> void:
for g in active_gizmos:
g.add_quad()
func add_triangle_at() -> void:
for g in active_gizmos:
g.add_triangle_at()
func add_quad_at() -> void:
for g in active_gizmos:
g.add_quad_at()
func merge():
for g in active_gizmos:
g.merge()