mirror of
https://github.com/Relintai/broken_seals.git
synced 2025-01-22 02:17:18 +01:00
Added a flip face action to mdr ed.
This commit is contained in:
parent
bcebec81d4
commit
7e05bda987
@ -250,3 +250,6 @@ func onhandle_selection_type_all_toggled(on : bool):
|
|||||||
|
|
||||||
func _on_clean_mesh_pressed():
|
func _on_clean_mesh_pressed():
|
||||||
_plugin.clean_mesh()
|
_plugin.clean_mesh()
|
||||||
|
|
||||||
|
func _on_flip_face_pressed():
|
||||||
|
_plugin.flip_selected_faces()
|
||||||
|
@ -540,6 +540,11 @@ margin_right = 1010.0
|
|||||||
margin_bottom = 20.0
|
margin_bottom = 20.0
|
||||||
text = "Delete"
|
text = "Delete"
|
||||||
|
|
||||||
|
[node name="Flip" type="Button" parent="VBoxContainer/ScrollContainer/VBoxContainer2/FaceOps/Operations"]
|
||||||
|
margin_right = 1010.0
|
||||||
|
margin_bottom = 20.0
|
||||||
|
text = "Flip"
|
||||||
|
|
||||||
[node name="HSeparator4" type="HSeparator" parent="VBoxContainer/ScrollContainer/VBoxContainer2"]
|
[node name="HSeparator4" type="HSeparator" parent="VBoxContainer/ScrollContainer/VBoxContainer2"]
|
||||||
margin_top = 196.0
|
margin_top = 196.0
|
||||||
margin_right = 998.0
|
margin_right = 998.0
|
||||||
@ -750,6 +755,7 @@ size_flags_vertical = 3
|
|||||||
[connection signal="pressed" from="VBoxContainer/ScrollContainer/VBoxContainer2/EdgeOps/Operations/HBoxContainer/Mark" to="." method="_on_mark_seam_pressed"]
|
[connection signal="pressed" from="VBoxContainer/ScrollContainer/VBoxContainer2/EdgeOps/Operations/HBoxContainer/Mark" to="." method="_on_mark_seam_pressed"]
|
||||||
[connection signal="pressed" from="VBoxContainer/ScrollContainer/VBoxContainer2/EdgeOps/Operations/HBoxContainer/Unmark" to="." method="_on_unmark_seam_pressed"]
|
[connection signal="pressed" from="VBoxContainer/ScrollContainer/VBoxContainer2/EdgeOps/Operations/HBoxContainer/Unmark" to="." method="_on_unmark_seam_pressed"]
|
||||||
[connection signal="pressed" from="VBoxContainer/ScrollContainer/VBoxContainer2/FaceOps/Operations/Delete" to="." method="_on_delete_pressed"]
|
[connection signal="pressed" from="VBoxContainer/ScrollContainer/VBoxContainer2/FaceOps/Operations/Delete" to="." method="_on_delete_pressed"]
|
||||||
|
[connection signal="pressed" from="VBoxContainer/ScrollContainer/VBoxContainer2/FaceOps/Operations/Flip" to="." method="_on_flip_face_pressed"]
|
||||||
[connection signal="pressed" from="VBoxContainer/ScrollContainer/VBoxContainer2/Operations/Operations/GenNormals" to="." method="_on_GenNormals_pressed"]
|
[connection signal="pressed" from="VBoxContainer/ScrollContainer/VBoxContainer2/Operations/Operations/GenNormals" to="." method="_on_GenNormals_pressed"]
|
||||||
[connection signal="pressed" from="VBoxContainer/ScrollContainer/VBoxContainer2/Operations/Operations/GenTangents" to="." method="_on_GenTangents_pressed"]
|
[connection signal="pressed" from="VBoxContainer/ScrollContainer/VBoxContainer2/Operations/Operations/GenTangents" to="." method="_on_GenTangents_pressed"]
|
||||||
[connection signal="pressed" from="VBoxContainer/ScrollContainer/VBoxContainer2/Operations/Operations/RemDoubles" to="." method="_on_RemDoubles_pressed"]
|
[connection signal="pressed" from="VBoxContainer/ScrollContainer/VBoxContainer2/Operations/Operations/RemDoubles" to="." method="_on_RemDoubles_pressed"]
|
||||||
|
@ -1637,6 +1637,31 @@ func uv_unwrap() -> void:
|
|||||||
add_mesh_change_undo_redo(orig_arr, mdr_arr, "uv_unwrap")
|
add_mesh_change_undo_redo(orig_arr, mdr_arr, "uv_unwrap")
|
||||||
enable_change_event()
|
enable_change_event()
|
||||||
|
|
||||||
|
func flip_selected_faces() -> void:
|
||||||
|
if !_mdr:
|
||||||
|
return
|
||||||
|
|
||||||
|
if _selected_points.size() == 0:
|
||||||
|
return
|
||||||
|
|
||||||
|
if selection_mode == SelectionMode.SELECTION_MODE_VERTEX:
|
||||||
|
pass
|
||||||
|
elif selection_mode == SelectionMode.SELECTION_MODE_EDGE:
|
||||||
|
pass
|
||||||
|
elif selection_mode == SelectionMode.SELECTION_MODE_FACE:
|
||||||
|
disable_change_event()
|
||||||
|
|
||||||
|
var orig_arr = copy_arrays(_mdr.array)
|
||||||
|
|
||||||
|
for sp in _selected_points:
|
||||||
|
var triangle_index : int = find_first_triangle_index_for_face(sp)
|
||||||
|
|
||||||
|
MDRMeshUtils.flip_triangle_ti(_mdr, triangle_index)
|
||||||
|
|
||||||
|
add_mesh_change_undo_redo(orig_arr, _mdr.array, "Flip Faces")
|
||||||
|
|
||||||
|
enable_change_event()
|
||||||
|
|
||||||
func add_mesh_change_undo_redo(orig_arr : Array, new_arr : Array, action_name : String) -> void:
|
func add_mesh_change_undo_redo(orig_arr : Array, new_arr : Array, action_name : String) -> void:
|
||||||
_undo_redo.create_action(action_name)
|
_undo_redo.create_action(action_name)
|
||||||
var nac : Array = copy_arrays(new_arr)
|
var nac : Array = copy_arrays(new_arr)
|
||||||
|
@ -280,3 +280,7 @@ func extrude():
|
|||||||
func clean_mesh():
|
func clean_mesh():
|
||||||
if current_mesh_data_instance && current_mesh_data_instance.gizmo:
|
if current_mesh_data_instance && current_mesh_data_instance.gizmo:
|
||||||
current_mesh_data_instance.gizmo.clean_mesh()
|
current_mesh_data_instance.gizmo.clean_mesh()
|
||||||
|
|
||||||
|
func flip_selected_faces():
|
||||||
|
if current_mesh_data_instance && current_mesh_data_instance.gizmo:
|
||||||
|
current_mesh_data_instance.gizmo.flip_selected_faces()
|
||||||
|
Loading…
Reference in New Issue
Block a user