Added more buttons to the mesh data editor's sidebar.

This commit is contained in:
Relintai 2022-01-03 14:45:40 +01:00
parent e2a43ac587
commit 847fbd35dd
4 changed files with 62 additions and 0 deletions

View File

@ -132,3 +132,10 @@ func _on_AddBox_pressed():
func _on_UnwrapButton_pressed():
plugin.uv_unwrap()
func _on_add_triangle_pressed():
plugin.add_triangle()
func _on_add_quad_pressed():
plugin.add_quad()

View File

@ -218,6 +218,30 @@ margin_right = 349.0
margin_bottom = 20.0
text = "Gen Tangents"
[node name="RemDoubles" type="Button" parent="VBoxContainer/Operations/Operations"]
margin_left = 353.0
margin_right = 451.0
margin_bottom = 20.0
text = "Rem Doubles"
[node name="Merge" type="Button" parent="VBoxContainer/Operations/Operations"]
margin_left = 455.0
margin_right = 507.0
margin_bottom = 20.0
text = "Merge"
[node name="Split" type="Button" parent="VBoxContainer/Operations/Operations"]
margin_left = 511.0
margin_right = 551.0
margin_bottom = 20.0
text = "Split"
[node name="SplitOffset" type="Button" parent="VBoxContainer/Operations/Operations"]
margin_left = 555.0
margin_right = 638.0
margin_bottom = 20.0
text = "Split Offset"
[node name="HSeparator3" type="HSeparator" parent="VBoxContainer"]
margin_top = 140.0
margin_right = 1010.0
@ -246,6 +270,18 @@ margin_right = 36.0
margin_bottom = 20.0
text = "Box"
[node name="AddTriangle" type="Button" parent="VBoxContainer/Add/Add"]
margin_left = 40.0
margin_right = 102.0
margin_bottom = 20.0
text = "Triangle"
[node name="AdQuad" type="Button" parent="VBoxContainer/Add/Add"]
margin_left = 106.0
margin_right = 152.0
margin_bottom = 20.0
text = "Quad"
[node name="HSeparator2" type="HSeparator" parent="VBoxContainer"]
margin_top = 190.0
margin_right = 1010.0
@ -293,3 +329,5 @@ script = ExtResource( 3 )
[connection signal="pressed" from="VBoxContainer/Operations/Operations/Extrude" to="." method="_on_Extrude_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"]

View File

@ -373,3 +373,12 @@ func on_mdr_changed() -> void:
recalculate_handle_points()
redraw()
func add_triangle() -> void:
if !_mdr:
return
func add_quad() -> void:
pass

View File

@ -173,3 +173,11 @@ func add_box() -> void:
if mdr:
MeshAddUtils.add_box(mdr)
func add_triangle() -> void:
for g in active_gizmos:
g.add_triangle()
func add_quad() -> void:
for g in active_gizmos:
g.add_quad()