Ported the actions buttons for mdr ed's ui.

This commit is contained in:
Relintai 2022-04-13 20:39:17 +02:00
parent 496b1b7f34
commit 34607ff21e
6 changed files with 216 additions and 801 deletions

View File

@ -31,7 +31,7 @@ if 'TOOLS_ENABLED' in env["CPPDEFINES"]:
module_env.add_source_files(env.modules_sources,"editor/utilities/mdr_ed_mesh_outline.cpp") module_env.add_source_files(env.modules_sources,"editor/utilities/mdr_ed_mesh_outline.cpp")
module_env.add_source_files(env.modules_sources,"editor/utilities/mdr_ed_mesh_utils.cpp") module_env.add_source_files(env.modules_sources,"editor/utilities/mdr_ed_mesh_utils.cpp")
module_env.add_source_files(env.modules_sources,"editor/uv_editor/mdi_ed_uv_previewer.cpp") module_env.add_source_files(env.modules_sources,"editor/uv_editor/mdr_ed_uv_previewer.cpp")
module_env.add_source_files(env.modules_sources,"editor/uv_editor/mdr_uv_rect_editor.cpp") module_env.add_source_files(env.modules_sources,"editor/uv_editor/mdr_uv_rect_editor.cpp")
module_env.add_source_files(env.modules_sources,"editor/uv_editor/mdr_uv_rect_view_node.cpp") module_env.add_source_files(env.modules_sources,"editor/uv_editor/mdr_uv_rect_view_node.cpp")
module_env.add_source_files(env.modules_sources,"editor/uv_editor/mdr_uv_rect_editor_popup.cpp") module_env.add_source_files(env.modules_sources,"editor/uv_editor/mdr_uv_rect_editor_popup.cpp")

View File

@ -22,8 +22,15 @@ SOFTWARE.
#include "mdi_ed.h" #include "mdi_ed.h"
#include "./uv_editor/mdr_ed_uv_previewer.h"
#include "./uv_editor/mdr_uv_rect_editor_popup.h"
#include "core/os/keyboard.h" #include "core/os/keyboard.h"
#include "mdi_ed_plugin.h" #include "mdi_ed_plugin.h"
#include "scene/gui/box_container.h"
#include "scene/gui/button.h"
#include "scene/gui/label.h"
#include "scene/gui/scroll_container.h"
#include "scene/gui/separator.h"
void MDIEd::_enter_tree() { void MDIEd::_enter_tree() {
/* /*
@ -310,10 +317,6 @@ void MDIEd::on_pivot_world_origin_toggled(bool on) {
if (on) { if (on) {
_plugin->set_pivot_world_origin(); _plugin->set_pivot_world_origin();
} }
/*
if on:
_plugin.set_pivot_world_origin()
*/
} }
void MDIEd::on_visual_indicator_outline_toggled(bool on) { void MDIEd::on_visual_indicator_outline_toggled(bool on) {
_plugin->visual_indicator_outline_set(on); _plugin->visual_indicator_outline_set(on);
@ -346,783 +349,195 @@ void MDIEd::_on_flip_face_pressed() {
} }
MDIEd::MDIEd() { MDIEd::MDIEd() {
/* uv_preview = nullptr;
[gd_scene load_steps=9 format=2]
//Main
[ext_resource path="res://addons/mesh_data_resource_editor/MDIEd.gd" type="Script" id=1] VBoxContainer *main_cont = memnew(VBoxContainer);
[ext_resource path="res://addons/mesh_data_resource_editor/button_groups/vertex_position_operation_bg.tres" type="ButtonGroup" id=2] add_child(main_cont);
[ext_resource path="res://addons/mesh_data_resource_editor/UVEditor.gd" type="Script" id=3]
[ext_resource path="res://addons/mesh_data_resource_editor/uv_editor/UVEditor.tscn" type="PackedScene" id=4] // -- Actions
[ext_resource path="res://addons/mesh_data_resource_editor/button_groups/edit_mode_button_group.tres" type="ButtonGroup" id=5] VBoxContainer *main_actions_container = memnew(VBoxContainer);
[ext_resource path="res://addons/mesh_data_resource_editor/uv_editor/UVEditorPopup.gd" type="Script" id=6] main_cont->add_child(main_actions_container);
[ext_resource path="res://addons/mesh_data_resource_editor/button_groups/pivot_button_group.tres" type="ButtonGroup" id=7]
[ext_resource path="res://addons/mesh_data_resource_editor/button_groups/handle_selection_typen_group.tres" type="ButtonGroup" id=8] HBoxContainer *actions_inner_container = memnew(HBoxContainer);
actions_inner_container->set_alignment(BoxContainer::ALIGN_CENTER);
[node name="MDIEd" type="PanelContainer"] main_actions_container->add_child(actions_inner_container);
anchor_right = 1.0
anchor_bottom = 1.0 VBoxContainer *left_actions_container = memnew(VBoxContainer);
script = ExtResource( 1 ) actions_inner_container->add_child(left_actions_container);
__meta__ = {
"_edit_use_anchors_": false VBoxContainer *right_actions_container = memnew(VBoxContainer);
} actions_inner_container->add_child(right_actions_container);
uv_preview_path = NodePath("VBoxContainer/ScrollContainer/VBoxContainer2/Operations/Operations/UVDisplay")
uv_editor_path = NodePath("Popups/UVEditorPopup/UVEditor") // -- Actions -- Edit Mode
Label *action_label = memnew(Label);
[node name="VBoxContainer" type="VBoxContainer" parent="."] action_label->set_text("E");
margin_left = 7.0 action_label->set_align(Label::ALIGN_CENTER);
margin_top = 7.0 action_label->set_valign(Label::VALIGN_CENTER);
margin_right = 1017.0 action_label->set_tooltip("Edit Mode");
margin_bottom = 593.0 action_label->set_mouse_filter(Control::MOUSE_FILTER_STOP);
__meta__ = { action_label->set_v_size_flags(SIZE_EXPAND_FILL | SIZE_SHRINK_CENTER);
"_edit_use_anchors_": false left_actions_container->add_child(action_label);
}
Ref<ButtonGroup> action_button_group;
[node name="Actions" type="VBoxContainer" parent="VBoxContainer"] action_button_group.instance();
margin_right = 1010.0
margin_bottom = 68.0 HBoxContainer *action_buttons_container = memnew(HBoxContainer);
right_actions_container->add_child(action_buttons_container);
[node name="Actions" type="HBoxContainer" parent="VBoxContainer/Actions"]
margin_right = 1010.0 Button *action_button = memnew(Button);
margin_bottom = 68.0 action_button->set_text("T");
alignment = 1 action_button->set_toggle_mode(true);
action_button->set_pressed(true);
[node name="VBoxContainer" type="VBoxContainer" parent="VBoxContainer/Actions/Actions"] action_button->set_button_group(action_button_group);
margin_left = 457.0 action_button->set_custom_minimum_size(Size2(25, 20));
margin_right = 466.0 action_button->set_tooltip("Translate");
margin_bottom = 68.0 action_button->set_h_size_flags(SIZE_EXPAND_FILL);
action_button->connect("toggled", this, "on_edit_mode_translate_toggled");
[node name="Label" type="Label" parent="VBoxContainer/Actions/Actions/VBoxContainer"] action_buttons_container->add_child(action_button);
margin_right = 9.0
margin_bottom = 20.0 action_button = memnew(Button);
hint_tooltip = "Edit Mode" action_button->set_text("R");
mouse_filter = 0 action_button->set_toggle_mode(true);
size_flags_vertical = 7 action_button->set_pressed(false);
text = "E" action_button->set_button_group(action_button_group);
align = 1 action_button->set_custom_minimum_size(Size2(25, 20));
valign = 1 action_button->set_tooltip("Rotate");
action_button->set_h_size_flags(SIZE_EXPAND_FILL);
[node name="Label2" type="Label" parent="VBoxContainer/Actions/Actions/VBoxContainer"] action_button->connect("toggled", this, "on_edit_mode_rotate_toggled");
margin_top = 24.0 action_buttons_container->add_child(action_button);
margin_right = 9.0
margin_bottom = 44.0 action_button = memnew(Button);
hint_tooltip = "Active Axis" action_button->set_text("S");
mouse_filter = 0 action_button->set_toggle_mode(true);
size_flags_vertical = 7 action_button->set_pressed(false);
text = "A" action_button->set_button_group(action_button_group);
align = 1 action_button->set_custom_minimum_size(Size2(25, 20));
valign = 1 action_button->set_tooltip("Scale");
action_button->set_h_size_flags(SIZE_EXPAND_FILL);
[node name="Label3" type="Label" parent="VBoxContainer/Actions/Actions/VBoxContainer"] action_button->connect("toggled", this, "on_edit_mode_scale_toggled");
margin_top = 48.0 action_buttons_container->add_child(action_button);
margin_right = 9.0
margin_bottom = 68.0 // -- Actions -- Active Axis
hint_tooltip = "Selection Mode" action_label = memnew(Label);
mouse_filter = 0 action_label->set_text("A");
size_flags_vertical = 7 action_label->set_align(Label::ALIGN_CENTER);
text = "S" action_label->set_valign(Label::VALIGN_CENTER);
align = 1 action_label->set_tooltip("Active Axis");
valign = 1 action_label->set_mouse_filter(Control::MOUSE_FILTER_STOP);
action_label->set_v_size_flags(SIZE_EXPAND_FILL | SIZE_SHRINK_CENTER);
[node name="VBoxContainer2" type="VBoxContainer" parent="VBoxContainer/Actions/Actions"] left_actions_container->add_child(action_label);
margin_left = 470.0
margin_right = 553.0 action_buttons_container = memnew(HBoxContainer);
margin_bottom = 68.0 right_actions_container->add_child(action_buttons_container);
[node name="HBoxContainer" type="HBoxContainer" parent="VBoxContainer/Actions/Actions/VBoxContainer2"] action_button = memnew(Button);
margin_right = 83.0 action_button->set_text("X");
margin_bottom = 20.0 action_button->set_toggle_mode(true);
action_button->set_pressed(true);
[node name="Translate" type="Button" parent="VBoxContainer/Actions/Actions/VBoxContainer2/HBoxContainer"] action_button->set_custom_minimum_size(Size2(25, 20));
margin_right = 25.0 action_button->set_h_size_flags(SIZE_EXPAND_FILL);
margin_bottom = 20.0 action_button->connect("toggled", this, "on_axis_x_toggled");
rect_min_size = Vector2( 25, 20 ) action_buttons_container->add_child(action_button);
hint_tooltip = "Translate"
size_flags_horizontal = 3 action_button = memnew(Button);
toggle_mode = true action_button->set_text("Y");
pressed = true action_button->set_toggle_mode(true);
group = ExtResource( 2 ) action_button->set_pressed(true);
text = "T" action_button->set_custom_minimum_size(Size2(25, 20));
action_button->set_h_size_flags(SIZE_EXPAND_FILL);
[node name="Rotate" type="Button" parent="VBoxContainer/Actions/Actions/VBoxContainer2/HBoxContainer"] action_button->connect("toggled", this, "on_axis_y_toggled");
margin_left = 29.0 action_buttons_container->add_child(action_button);
margin_right = 54.0
margin_bottom = 20.0 action_button = memnew(Button);
rect_min_size = Vector2( 25, 20 ) action_button->set_text("Z");
hint_tooltip = "Rotate" action_button->set_toggle_mode(true);
size_flags_horizontal = 3 action_button->set_pressed(true);
toggle_mode = true action_button->set_custom_minimum_size(Size2(25, 20));
group = ExtResource( 2 ) action_button->set_h_size_flags(SIZE_EXPAND_FILL);
text = "R" action_button->connect("toggled", this, "on_axis_z_toggled");
action_buttons_container->add_child(action_button);
[node name="Scale" type="Button" parent="VBoxContainer/Actions/Actions/VBoxContainer2/HBoxContainer"]
margin_left = 58.0 // -- Actions -- Selection Mode
margin_right = 83.0 action_label = memnew(Label);
margin_bottom = 20.0 action_label->set_text("S");
rect_min_size = Vector2( 25, 20 ) action_label->set_align(Label::ALIGN_CENTER);
hint_tooltip = "Scale" action_label->set_valign(Label::VALIGN_CENTER);
size_flags_horizontal = 3 action_label->set_tooltip("Selection Mode");
toggle_mode = true action_label->set_mouse_filter(Control::MOUSE_FILTER_STOP);
group = ExtResource( 2 ) action_label->set_v_size_flags(SIZE_EXPAND_FILL | SIZE_SHRINK_CENTER);
text = "S" left_actions_container->add_child(action_label);
[node name="HBoxContainer2" type="HBoxContainer" parent="VBoxContainer/Actions/Actions/VBoxContainer2"] action_button_group.instance();
margin_top = 24.0
margin_right = 83.0 action_buttons_container = memnew(HBoxContainer);
margin_bottom = 44.0 right_actions_container->add_child(action_buttons_container);
[node name="AxisX" type="Button" parent="VBoxContainer/Actions/Actions/VBoxContainer2/HBoxContainer2"] action_button = memnew(Button);
margin_right = 25.0 action_button->set_text("V");
margin_bottom = 20.0 action_button->set_toggle_mode(true);
rect_min_size = Vector2( 25, 20 ) action_button->set_pressed(true);
size_flags_horizontal = 3 action_button->set_button_group(action_button_group);
toggle_mode = true action_button->set_custom_minimum_size(Size2(25, 20));
pressed = true action_button->set_tooltip("Vertex");
text = "X" action_button->set_h_size_flags(SIZE_EXPAND_FILL);
action_button->connect("toggled", this, "on_selection_mode_vertex_toggled");
[node name="AxisY" type="Button" parent="VBoxContainer/Actions/Actions/VBoxContainer2/HBoxContainer2"] action_buttons_container->add_child(action_button);
margin_left = 29.0
margin_right = 54.0 action_button = memnew(Button);
margin_bottom = 20.0 action_button->set_text("E");
rect_min_size = Vector2( 25, 20 ) action_button->set_toggle_mode(true);
size_flags_horizontal = 3 action_button->set_pressed(false);
toggle_mode = true action_button->set_button_group(action_button_group);
pressed = true action_button->set_custom_minimum_size(Size2(25, 20));
text = "Y" action_button->set_tooltip("Edge");
action_button->set_h_size_flags(SIZE_EXPAND_FILL);
[node name="AxisZ" type="Button" parent="VBoxContainer/Actions/Actions/VBoxContainer2/HBoxContainer2"] action_button->connect("toggled", this, "on_selection_mode_edge_toggled");
margin_left = 58.0 action_buttons_container->add_child(action_button);
margin_right = 83.0
margin_bottom = 20.0 action_button = memnew(Button);
rect_min_size = Vector2( 25, 20 ) action_button->set_text("F");
size_flags_horizontal = 3 action_button->set_toggle_mode(true);
toggle_mode = true action_button->set_pressed(false);
pressed = true action_button->set_button_group(action_button_group);
text = "Z" action_button->set_custom_minimum_size(Size2(25, 20));
action_button->set_tooltip("Face");
[node name="HBoxContainer3" type="HBoxContainer" parent="VBoxContainer/Actions/Actions/VBoxContainer2"] action_button->set_h_size_flags(SIZE_EXPAND_FILL);
margin_top = 48.0 action_button->connect("toggled", this, "on_selection_mode_face_toggled");
margin_right = 83.0 action_buttons_container->add_child(action_button);
margin_bottom = 68.0
// -- Main separator
[node name="Vertex" type="Button" parent="VBoxContainer/Actions/Actions/VBoxContainer2/HBoxContainer3"] main_cont->add_child(memnew(HSeparator));
margin_right = 25.0
margin_bottom = 20.0 // -- Main ScrollContainer
rect_min_size = Vector2( 25, 20 ) ScrollContainer *main_scroll_container = memnew(ScrollContainer);
hint_tooltip = "Vertex" main_cont->add_child(main_scroll_container);
size_flags_horizontal = 3
toggle_mode = true //Popups
pressed = true Control *popups_node = memnew(Control);
group = ExtResource( 5 ) popups_node->set_mouse_filter(MOUSE_FILTER_IGNORE);
text = "V" add_child(popups_node);
[node name="Edge" type="Button" parent="VBoxContainer/Actions/Actions/VBoxContainer2/HBoxContainer3"] uv_editor = memnew(MDRUVRectEditorPopup);
margin_left = 29.0 uv_editor->set_title("UV Editor");
margin_right = 54.0 uv_editor->set_resizable(true);
margin_bottom = 20.0 uv_editor->hide();
rect_min_size = Vector2( 25, 20 ) popups_node->add_child(uv_editor);
hint_tooltip = "Edge"
size_flags_horizontal = 3
toggle_mode = true
group = ExtResource( 5 )
text = "E"
[node name="Face" type="Button" parent="VBoxContainer/Actions/Actions/VBoxContainer2/HBoxContainer3"]
margin_left = 58.0
margin_right = 83.0
margin_bottom = 20.0
rect_min_size = Vector2( 25, 20 )
hint_tooltip = "Face"
size_flags_horizontal = 3
toggle_mode = true
group = ExtResource( 5 )
text = "F"
[node name="HSeparator" type="HSeparator" parent="VBoxContainer"]
margin_top = 72.0
margin_right = 1010.0
margin_bottom = 76.0
[node name="ScrollContainer" type="ScrollContainer" parent="VBoxContainer"]
margin_top = 80.0
margin_right = 1010.0
margin_bottom = 586.0
size_flags_horizontal = 3
size_flags_vertical = 3
scroll_horizontal_enabled = false
[node name="VBoxContainer2" type="VBoxContainer" parent="VBoxContainer/ScrollContainer"]
margin_right = 998.0
margin_bottom = 674.0
size_flags_horizontal = 3
[node name="HBoxContainer6" type="HBoxContainer" parent="VBoxContainer/ScrollContainer/VBoxContainer2"]
margin_right = 998.0
margin_bottom = 20.0
[node name="Label4" type="Label" parent="VBoxContainer/ScrollContainer/VBoxContainer2/HBoxContainer6"]
margin_right = 10.0
margin_bottom = 20.0
hint_tooltip = "Handle Selection type."
mouse_filter = 0
size_flags_vertical = 7
text = "H"
align = 1
valign = 1
[node name="Front" type="Button" parent="VBoxContainer/ScrollContainer/VBoxContainer2/HBoxContainer6"]
margin_left = 14.0
margin_right = 339.0
margin_bottom = 20.0
rect_min_size = Vector2( 25, 20 )
hint_tooltip = "
"
size_flags_horizontal = 3
toggle_mode = true
pressed = true
group = ExtResource( 8 )
text = "F"
[node name="Back" type="Button" parent="VBoxContainer/ScrollContainer/VBoxContainer2/HBoxContainer6"]
margin_left = 343.0
margin_right = 668.0
margin_bottom = 20.0
rect_min_size = Vector2( 25, 20 )
hint_tooltip = "Only select handles that face away
the camera."
size_flags_horizontal = 3
toggle_mode = true
group = ExtResource( 8 )
text = "B"
[node name="All" type="Button" parent="VBoxContainer/ScrollContainer/VBoxContainer2/HBoxContainer6"]
margin_left = 672.0
margin_right = 998.0
margin_bottom = 20.0
rect_min_size = Vector2( 25, 20 )
hint_tooltip = "Ignore camera facing when selecting handles.
"
size_flags_horizontal = 3
toggle_mode = true
group = ExtResource( 8 )
text = "A"
[node name="HBoxContainer4" type="HBoxContainer" parent="VBoxContainer/ScrollContainer/VBoxContainer2"]
margin_top = 24.0
margin_right = 998.0
margin_bottom = 44.0
[node name="Label4" type="Label" parent="VBoxContainer/ScrollContainer/VBoxContainer2/HBoxContainer4"]
margin_right = 8.0
margin_bottom = 20.0
hint_tooltip = "Pivot"
mouse_filter = 0
size_flags_vertical = 7
text = "P"
align = 1
valign = 1
[node name="Average" type="Button" parent="VBoxContainer/ScrollContainer/VBoxContainer2/HBoxContainer4"]
margin_left = 12.0
margin_right = 338.0
margin_bottom = 20.0
rect_min_size = Vector2( 25, 20 )
hint_tooltip = "Average"
size_flags_horizontal = 3
toggle_mode = true
pressed = true
group = ExtResource( 7 )
text = "A"
[node name="MDIOrigin" type="Button" parent="VBoxContainer/ScrollContainer/VBoxContainer2/HBoxContainer4"]
margin_left = 342.0
margin_right = 668.0
margin_bottom = 20.0
rect_min_size = Vector2( 25, 20 )
hint_tooltip = "Mesh Data Instance Origin"
size_flags_horizontal = 3
toggle_mode = true
group = ExtResource( 7 )
text = "M"
[node name="WorldOrigin" type="Button" parent="VBoxContainer/ScrollContainer/VBoxContainer2/HBoxContainer4"]
margin_left = 672.0
margin_right = 998.0
margin_bottom = 20.0
rect_min_size = Vector2( 25, 20 )
hint_tooltip = "World Origin"
size_flags_horizontal = 3
toggle_mode = true
group = ExtResource( 7 )
text = "w"
[node name="HBoxContainer5" type="HBoxContainer" parent="VBoxContainer/ScrollContainer/VBoxContainer2"]
margin_top = 48.0
margin_right = 998.0
margin_bottom = 68.0
[node name="Label4" type="Label" parent="VBoxContainer/ScrollContainer/VBoxContainer2/HBoxContainer5"]
margin_right = 8.0
margin_bottom = 20.0
hint_tooltip = "Visual indicators"
mouse_filter = 0
size_flags_vertical = 7
text = "V"
align = 1
valign = 1
[node name="Outline" type="Button" parent="VBoxContainer/ScrollContainer/VBoxContainer2/HBoxContainer5"]
margin_left = 12.0
margin_right = 338.0
margin_bottom = 20.0
rect_min_size = Vector2( 25, 20 )
hint_tooltip = "Outline"
size_flags_horizontal = 3
toggle_mode = true
pressed = true
text = "O"
[node name="Seam" type="Button" parent="VBoxContainer/ScrollContainer/VBoxContainer2/HBoxContainer5"]
margin_left = 342.0
margin_right = 668.0
margin_bottom = 20.0
rect_min_size = Vector2( 25, 20 )
hint_tooltip = "Seam"
size_flags_horizontal = 3
toggle_mode = true
pressed = true
text = "S"
[node name="Handle" type="Button" parent="VBoxContainer/ScrollContainer/VBoxContainer2/HBoxContainer5"]
margin_left = 672.0
margin_right = 998.0
margin_bottom = 20.0
rect_min_size = Vector2( 25, 20 )
hint_tooltip = "Handle"
size_flags_horizontal = 3
toggle_mode = true
pressed = true
text = "H"
[node name="HSeparator" type="HSeparator" parent="VBoxContainer/ScrollContainer/VBoxContainer2"]
margin_top = 72.0
margin_right = 998.0
margin_bottom = 76.0
__meta__ = {
"_edit_use_anchors_": false
}
[node name="Select All" type="Button" parent="VBoxContainer/ScrollContainer/VBoxContainer2"]
margin_top = 80.0
margin_right = 998.0
margin_bottom = 100.0
text = "Select All"
[node name="HSeparator5" type="HSeparator" parent="VBoxContainer/ScrollContainer/VBoxContainer2"]
margin_top = 104.0
margin_right = 998.0
margin_bottom = 108.0
__meta__ = {
"_edit_use_anchors_": false
}
[node name="VertexOps" type="VBoxContainer" parent="VBoxContainer/ScrollContainer/VBoxContainer2"]
margin_top = 112.0
margin_right = 998.0
margin_bottom = 192.0
[node name="OperationsLabel" type="Label" parent="VBoxContainer/ScrollContainer/VBoxContainer2/VertexOps"]
margin_right = 998.0
margin_bottom = 14.0
text = "= Vertex ="
align = 1
valign = 1
[node name="Operations" type="VBoxContainer" parent="VBoxContainer/ScrollContainer/VBoxContainer2/VertexOps"]
margin_top = 18.0
margin_right = 998.0
margin_bottom = 80.0
[node name="AddFace" type="Button" parent="VBoxContainer/ScrollContainer/VBoxContainer2/VertexOps/Operations"]
margin_right = 998.0
margin_bottom = 20.0
text = "Create Face"
[node name="Split" type="Button" parent="VBoxContainer/ScrollContainer/VBoxContainer2/VertexOps/Operations"]
visible = false
margin_top = 24.0
margin_right = 998.0
margin_bottom = 44.0
text = "Split"
[node name="Label" type="Label" parent="VBoxContainer/ScrollContainer/VBoxContainer2/VertexOps/Operations"]
margin_top = 24.0
margin_right = 998.0
margin_bottom = 38.0
text = "Connect"
align = 1
valign = 1
[node name="HBoxContainer" type="HBoxContainer" parent="VBoxContainer/ScrollContainer/VBoxContainer2/VertexOps/Operations"]
margin_top = 42.0
margin_right = 998.0
margin_bottom = 62.0
size_flags_horizontal = 3
[node name="ConnectToFirst" type="Button" parent="VBoxContainer/ScrollContainer/VBoxContainer2/VertexOps/Operations/HBoxContainer"]
margin_right = 330.0
margin_bottom = 20.0
hint_tooltip = "Move all vertices to the first one that was selected."
size_flags_horizontal = 3
text = "x<"
[node name="ConnectMed" type="Button" parent="VBoxContainer/ScrollContainer/VBoxContainer2/VertexOps/Operations/HBoxContainer"]
margin_left = 334.0
margin_right = 664.0
margin_bottom = 20.0
hint_tooltip = "Move all selected vertices to their average."
size_flags_horizontal = 3
text = ">x<"
[node name="ConnectToLast" type="Button" parent="VBoxContainer/ScrollContainer/VBoxContainer2/VertexOps/Operations/HBoxContainer"]
margin_left = 668.0
margin_right = 998.0
margin_bottom = 20.0
hint_tooltip = "Move all selected vertices to the last that was selected."
size_flags_horizontal = 3
text = ">x"
[node name="EdgeOps" type="VBoxContainer" parent="VBoxContainer/ScrollContainer/VBoxContainer2"]
visible = false
margin_top = 108.0
margin_right = 998.0
margin_bottom = 206.0
[node name="OperationsLabel" type="Label" parent="VBoxContainer/ScrollContainer/VBoxContainer2/EdgeOps"]
margin_right = 998.0
margin_bottom = 14.0
text = "= Edge ="
align = 1
valign = 1
[node name="Operations" type="VBoxContainer" parent="VBoxContainer/ScrollContainer/VBoxContainer2/EdgeOps"]
margin_top = 18.0
margin_right = 998.0
margin_bottom = 98.0
[node name="Extrude" type="Button" parent="VBoxContainer/ScrollContainer/VBoxContainer2/EdgeOps/Operations"]
margin_right = 1010.0
margin_bottom = 20.0
text = "Extrude"
[node name="Label" type="Label" parent="VBoxContainer/ScrollContainer/VBoxContainer2/EdgeOps/Operations"]
margin_right = 998.0
margin_bottom = 14.0
text = "Append"
align = 1
valign = 1
[node name="HBoxContainer2" type="HBoxContainer" parent="VBoxContainer/ScrollContainer/VBoxContainer2/EdgeOps/Operations"]
margin_top = 18.0
margin_right = 998.0
margin_bottom = 38.0
[node name="TriAt" type="Button" parent="VBoxContainer/ScrollContainer/VBoxContainer2/EdgeOps/Operations/HBoxContainer2"]
margin_right = 497.0
margin_bottom = 20.0
size_flags_horizontal = 3
size_flags_vertical = 3
text = "Tri"
[node name="QuadAt" type="Button" parent="VBoxContainer/ScrollContainer/VBoxContainer2/EdgeOps/Operations/HBoxContainer2"]
margin_left = 501.0
margin_right = 998.0
margin_bottom = 20.0
size_flags_horizontal = 3
text = "Quad"
[node name="SeamLabel" type="Label" parent="VBoxContainer/ScrollContainer/VBoxContainer2/EdgeOps/Operations"]
margin_top = 42.0
margin_right = 998.0
margin_bottom = 56.0
text = "Seam"
align = 1
valign = 1
[node name="HBoxContainer" type="HBoxContainer" parent="VBoxContainer/ScrollContainer/VBoxContainer2/EdgeOps/Operations"]
margin_top = 60.0
margin_right = 998.0
margin_bottom = 80.0
size_flags_horizontal = 3
[node name="Mark" type="Button" parent="VBoxContainer/ScrollContainer/VBoxContainer2/EdgeOps/Operations/HBoxContainer"]
margin_right = 497.0
margin_bottom = 20.0
size_flags_horizontal = 3
text = "Mark"
[node name="Unmark" type="Button" parent="VBoxContainer/ScrollContainer/VBoxContainer2/EdgeOps/Operations/HBoxContainer"]
margin_left = 501.0
margin_right = 998.0
margin_bottom = 20.0
size_flags_horizontal = 3
text = "Unmark"
[node name="FaceOps" type="VBoxContainer" parent="VBoxContainer/ScrollContainer/VBoxContainer2"]
visible = false
margin_right = 55.0
margin_bottom = 38.0
[node name="OperationsLabel" type="Label" parent="VBoxContainer/ScrollContainer/VBoxContainer2/FaceOps"]
margin_right = 1010.0
margin_bottom = 14.0
text = "= Face ="
align = 1
valign = 1
[node name="Operations" type="VBoxContainer" parent="VBoxContainer/ScrollContainer/VBoxContainer2/FaceOps"]
margin_top = 18.0
margin_right = 1010.0
margin_bottom = 110.0
[node name="Delete" type="Button" parent="VBoxContainer/ScrollContainer/VBoxContainer2/FaceOps/Operations"]
margin_right = 1010.0
margin_bottom = 20.0
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"]
margin_top = 196.0
margin_right = 998.0
margin_bottom = 200.0
[node name="Operations" type="VBoxContainer" parent="VBoxContainer/ScrollContainer/VBoxContainer2"]
margin_top = 204.0
margin_right = 998.0
margin_bottom = 568.0
[node name="OperationsLabel" type="Label" parent="VBoxContainer/ScrollContainer/VBoxContainer2/Operations"]
margin_right = 998.0
margin_bottom = 14.0
text = "= Operations ="
align = 1
valign = 1
[node name="Operations" type="VBoxContainer" parent="VBoxContainer/ScrollContainer/VBoxContainer2/Operations"]
margin_top = 18.0
margin_right = 998.0
margin_bottom = 364.0
[node name="Label2" type="Label" parent="VBoxContainer/ScrollContainer/VBoxContainer2/Operations/Operations"]
margin_right = 998.0
margin_bottom = 14.0
text = "Generate"
align = 1
valign = 1
[node name="GenNormals" type="Button" parent="VBoxContainer/ScrollContainer/VBoxContainer2/Operations/Operations"]
margin_top = 18.0
margin_right = 998.0
margin_bottom = 38.0
text = "Normals"
[node name="GenTangents" type="Button" parent="VBoxContainer/ScrollContainer/VBoxContainer2/Operations/Operations"]
margin_top = 42.0
margin_right = 998.0
margin_bottom = 62.0
text = "Tangents"
[node name="Label" type="Label" parent="VBoxContainer/ScrollContainer/VBoxContainer2/Operations/Operations"]
margin_top = 66.0
margin_right = 998.0
margin_bottom = 80.0
text = "Optimizations"
align = 1
valign = 1
[node name="RemDoubles" type="Button" parent="VBoxContainer/ScrollContainer/VBoxContainer2/Operations/Operations"]
margin_top = 84.0
margin_right = 998.0
margin_bottom = 104.0
text = "Rem Doubles"
[node name="MergeOptimize" type="Button" parent="VBoxContainer/ScrollContainer/VBoxContainer2/Operations/Operations"]
margin_top = 108.0
margin_right = 998.0
margin_bottom = 128.0
text = "Full Merge"
[node name="Clean" type="Button" parent="VBoxContainer/ScrollContainer/VBoxContainer2/Operations/Operations"]
margin_top = 132.0
margin_right = 998.0
margin_bottom = 152.0
hint_tooltip = "Clean mesh for example for unused verts."
text = "Clean"
[node name="Label3" type="Label" parent="VBoxContainer/ScrollContainer/VBoxContainer2/Operations/Operations"]
margin_top = 156.0
margin_right = 998.0
margin_bottom = 170.0
text = "UV"
align = 1
valign = 1
[node name="UVDisplay" type="Control" parent="VBoxContainer/ScrollContainer/VBoxContainer2/Operations/Operations"]
margin_top = 174.0
margin_right = 998.0
margin_bottom = 274.0
rect_min_size = Vector2( 100, 100 )
script = ExtResource( 3 )
[node name="UVEditButton" type="Button" parent="VBoxContainer/ScrollContainer/VBoxContainer2/Operations/Operations"]
margin_top = 278.0
margin_right = 998.0
margin_bottom = 298.0
text = "Edit"
[node name="ApplySeams" type="Button" parent="VBoxContainer/ScrollContainer/VBoxContainer2/Operations/Operations"]
margin_top = 302.0
margin_right = 998.0
margin_bottom = 322.0
text = "Apply seams"
[node name="UnwrapButton2" type="Button" parent="VBoxContainer/ScrollContainer/VBoxContainer2/Operations/Operations"]
margin_top = 326.0
margin_right = 998.0
margin_bottom = 346.0
text = "Unwrap"
[node name="HSeparator3" type="HSeparator" parent="VBoxContainer/ScrollContainer/VBoxContainer2"]
margin_top = 572.0
margin_right = 998.0
margin_bottom = 576.0
[node name="Add" type="VBoxContainer" parent="VBoxContainer/ScrollContainer/VBoxContainer2"]
margin_top = 580.0
margin_right = 998.0
margin_bottom = 666.0
[node name="AddLabel" type="Label" parent="VBoxContainer/ScrollContainer/VBoxContainer2/Add"]
margin_right = 998.0
margin_bottom = 14.0
text = "= Add ="
align = 1
valign = 1
[node name="Add" type="VBoxContainer" parent="VBoxContainer/ScrollContainer/VBoxContainer2/Add"]
margin_top = 18.0
margin_right = 998.0
margin_bottom = 86.0
[node name="AddBox" type="Button" parent="VBoxContainer/ScrollContainer/VBoxContainer2/Add/Add"]
margin_right = 998.0
margin_bottom = 20.0
text = "Box"
[node name="AddTriangle" type="Button" parent="VBoxContainer/ScrollContainer/VBoxContainer2/Add/Add"]
margin_top = 24.0
margin_right = 998.0
margin_bottom = 44.0
size_flags_horizontal = 3
text = "Tri"
[node name="AddQuad" type="Button" parent="VBoxContainer/ScrollContainer/VBoxContainer2/Add/Add"]
margin_top = 48.0
margin_right = 998.0
margin_bottom = 68.0
size_flags_horizontal = 3
text = "Quad"
[node name="HSeparator2" type="HSeparator" parent="VBoxContainer/ScrollContainer/VBoxContainer2"]
margin_top = 670.0
margin_right = 998.0
margin_bottom = 674.0
[node name="Popups" type="Control" parent="."]
margin_left = 7.0
margin_top = 7.0
margin_right = 1017.0
margin_bottom = 593.0
mouse_filter = 2
__meta__ = {
"_edit_lock_": true
}
[node name="UVEditorPopup" type="ConfirmationDialog" parent="Popups"]
margin_left = 149.0
margin_top = 35.0
margin_right = 901.0
margin_bottom = 803.0
window_title = "UV Editor"
resizable = true
script = ExtResource( 6 )
__meta__ = {
"_edit_use_anchors_": false
}
[node name="UVEditor" parent="Popups/UVEditorPopup" instance=ExtResource( 4 )]
margin_left = 8.0
margin_top = 8.0
margin_right = -8.0
margin_bottom = -36.0
size_flags_horizontal = 3
size_flags_vertical = 3
[connection signal="toggled" from="VBoxContainer/Actions/Actions/VBoxContainer2/HBoxContainer/Translate" to="." method="on_edit_mode_translate_toggled"]
[connection signal="toggled" from="VBoxContainer/Actions/Actions/VBoxContainer2/HBoxContainer/Rotate" to="." method="on_edit_mode_rotate_toggled"]
[connection signal="toggled" from="VBoxContainer/Actions/Actions/VBoxContainer2/HBoxContainer/Scale" to="." method="on_edit_mode_scale_toggled"]
[connection signal="toggled" from="VBoxContainer/Actions/Actions/VBoxContainer2/HBoxContainer2/AxisX" to="." method="on_axis_x_toggled"]
[connection signal="toggled" from="VBoxContainer/Actions/Actions/VBoxContainer2/HBoxContainer2/AxisY" to="." method="on_axis_y_toggled"]
[connection signal="toggled" from="VBoxContainer/Actions/Actions/VBoxContainer2/HBoxContainer2/AxisZ" to="." method="on_axis_z_toggled"]
[connection signal="toggled" from="VBoxContainer/Actions/Actions/VBoxContainer2/HBoxContainer3/Vertex" to="." method="on_selection_mode_vertex_toggled"]
[connection signal="toggled" from="VBoxContainer/Actions/Actions/VBoxContainer2/HBoxContainer3/Vertex" to="VBoxContainer/ScrollContainer/VBoxContainer2/VertexOps" method="set_visible"]
[connection signal="toggled" from="VBoxContainer/Actions/Actions/VBoxContainer2/HBoxContainer3/Edge" to="." method="on_selection_mode_edge_toggled"]
[connection signal="toggled" from="VBoxContainer/Actions/Actions/VBoxContainer2/HBoxContainer3/Edge" to="VBoxContainer/ScrollContainer/VBoxContainer2/EdgeOps" method="set_visible"]
[connection signal="toggled" from="VBoxContainer/Actions/Actions/VBoxContainer2/HBoxContainer3/Face" to="." method="on_selection_mode_face_toggled"]
[connection signal="toggled" from="VBoxContainer/Actions/Actions/VBoxContainer2/HBoxContainer3/Face" to="VBoxContainer/ScrollContainer/VBoxContainer2/FaceOps" method="set_visible"]
[connection signal="toggled" from="VBoxContainer/ScrollContainer/VBoxContainer2/HBoxContainer6/Front" to="." method="onhandle_selection_type_front_toggled"]
[connection signal="toggled" from="VBoxContainer/ScrollContainer/VBoxContainer2/HBoxContainer6/Back" to="." method="onhandle_selection_type_back_toggled"]
[connection signal="toggled" from="VBoxContainer/ScrollContainer/VBoxContainer2/HBoxContainer6/All" to="." method="onhandle_selection_type_all_toggled"]
[connection signal="toggled" from="VBoxContainer/ScrollContainer/VBoxContainer2/HBoxContainer4/Average" to="." method="on_pivot_average_toggled"]
[connection signal="toggled" from="VBoxContainer/ScrollContainer/VBoxContainer2/HBoxContainer4/MDIOrigin" to="." method="on_pivot_mdi_origin_toggled"]
[connection signal="toggled" from="VBoxContainer/ScrollContainer/VBoxContainer2/HBoxContainer4/WorldOrigin" to="." method="on_pivot_world_origin_toggled"]
[connection signal="toggled" from="VBoxContainer/ScrollContainer/VBoxContainer2/HBoxContainer5/Outline" to="." method="on_visual_indicator_outline_toggled"]
[connection signal="toggled" from="VBoxContainer/ScrollContainer/VBoxContainer2/HBoxContainer5/Seam" to="." method="on_visual_indicator_seam_toggled"]
[connection signal="toggled" from="VBoxContainer/ScrollContainer/VBoxContainer2/HBoxContainer5/Handle" to="." method="on_visual_indicator_handle_toggled"]
[connection signal="pressed" from="VBoxContainer/ScrollContainer/VBoxContainer2/Select All" to="." method="_on_select_all_pressed"]
[connection signal="pressed" from="VBoxContainer/ScrollContainer/VBoxContainer2/VertexOps/Operations/AddFace" to="." method="_oncreate_face_pressed"]
[connection signal="pressed" from="VBoxContainer/ScrollContainer/VBoxContainer2/VertexOps/Operations/Split" to="." method="_on_split_pressed"]
[connection signal="pressed" from="VBoxContainer/ScrollContainer/VBoxContainer2/VertexOps/Operations/HBoxContainer/ConnectToFirst" to="." method="_on_connect_to_first_selected_pressed"]
[connection signal="pressed" from="VBoxContainer/ScrollContainer/VBoxContainer2/VertexOps/Operations/HBoxContainer/ConnectMed" to="." method="_on_connect_to_avg_pressed"]
[connection signal="pressed" from="VBoxContainer/ScrollContainer/VBoxContainer2/VertexOps/Operations/HBoxContainer/ConnectToLast" to="." method="_on_connect_to_last_selected_pressed"]
[connection signal="pressed" from="VBoxContainer/ScrollContainer/VBoxContainer2/EdgeOps/Operations/Extrude" to="." method="_on_Extrude_pressed"]
[connection signal="pressed" from="VBoxContainer/ScrollContainer/VBoxContainer2/EdgeOps/Operations/HBoxContainer2/TriAt" to="." method="_on_add_triangle_at_pressed"]
[connection signal="pressed" from="VBoxContainer/ScrollContainer/VBoxContainer2/EdgeOps/Operations/HBoxContainer2/QuadAt" to="." method="_on_add_auad_at_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/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/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/MergeOptimize" to="." method="_on_MergeOptimize_pressed"]
[connection signal="pressed" from="VBoxContainer/ScrollContainer/VBoxContainer2/Operations/Operations/Clean" to="." method="_on_clean_mesh_pressed"]
[connection signal="pressed" from="VBoxContainer/ScrollContainer/VBoxContainer2/Operations/Operations/UVEditButton" to="." method="_on_uv_edit_pressed"]
[connection signal="pressed" from="VBoxContainer/ScrollContainer/VBoxContainer2/Operations/Operations/ApplySeams" to="." method="_on_apply_seams_pressed"]
[connection signal="pressed" from="VBoxContainer/ScrollContainer/VBoxContainer2/Operations/Operations/UnwrapButton2" to="." method="_on_UnwrapButton_pressed"]
[connection signal="pressed" from="VBoxContainer/ScrollContainer/VBoxContainer2/Add/Add/AddBox" to="." method="_on_AddBox_pressed"]
[connection signal="pressed" from="VBoxContainer/ScrollContainer/VBoxContainer2/Add/Add/AddTriangle" to="." method="_on_add_triangle_pressed"]
[connection signal="pressed" from="VBoxContainer/ScrollContainer/VBoxContainer2/Add/Add/AddQuad" to="." method="_on_add_quad_pressed"]
*/
} }
MDIEd::~MDIEd() { MDIEd::~MDIEd() {
} }
void MDIEd::_bind_methods() { void MDIEd::_bind_methods() {
ClassDB::bind_method(D_METHOD("on_edit_mode_translate_toggled"), &MDIEd::on_edit_mode_translate_toggled);
ClassDB::bind_method(D_METHOD("on_edit_mode_rotate_toggled"), &MDIEd::on_edit_mode_rotate_toggled);
ClassDB::bind_method(D_METHOD("on_edit_mode_scale_toggled"), &MDIEd::on_edit_mode_scale_toggled);
ClassDB::bind_method(D_METHOD("on_axis_x_toggled"), &MDIEd::on_axis_x_toggled);
ClassDB::bind_method(D_METHOD("on_axis_y_toggled"), &MDIEd::on_axis_y_toggled);
ClassDB::bind_method(D_METHOD("on_axis_z_toggled"), &MDIEd::on_axis_z_toggled);
ClassDB::bind_method(D_METHOD("on_selection_mode_vertex_toggled"), &MDIEd::on_selection_mode_vertex_toggled);
ClassDB::bind_method(D_METHOD("on_selection_mode_edge_toggled"), &MDIEd::on_selection_mode_edge_toggled);
ClassDB::bind_method(D_METHOD("on_selection_mode_face_toggled"), &MDIEd::on_selection_mode_face_toggled);
} }

View File

@ -23,15 +23,17 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE. SOFTWARE.
*/ */
#include "scene/gui/control.h" #include "scene/gui/panel_container.h"
class EditorPlugin; class EditorPlugin;
class MeshDataResource; class MeshDataResource;
class MeshDataInstance; class MeshDataInstance;
class MDIEdPlugin; class MDIEdPlugin;
class MDREdUVPreviewer;
class MDRUVRectEditorPopup;
class MDIEd : public Control { class MDIEd : public PanelContainer {
GDCLASS(MDIEd, Control); GDCLASS(MDIEd, PanelContainer);
public: public:
void _enter_tree(); void _enter_tree();
@ -113,11 +115,8 @@ public:
MDIEdPlugin *_plugin; MDIEdPlugin *_plugin;
//export var uv_preview_path : NodePath MDREdUVPreviewer *uv_preview;
//export var uv_editor_path : NodePath MDRUVRectEditorPopup *uv_editor;
Node *uv_preview;
Node *uv_editor;
protected: protected:
static void _bind_methods(); static void _bind_methods();

View File

@ -20,13 +20,13 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE. SOFTWARE.
*/ */
#include "mdi_ed_uv_previewer.h" #include "mdr_ed_uv_previewer.h"
#include "../../mesh_data_resource.h" #include "../../mesh_data_resource.h"
#include "../../nodes/mesh_data_instance.h" #include "../../nodes/mesh_data_instance.h"
#include "scene/resources/texture.h" #include "scene/resources/texture.h"
void MDIEdUVPreviewer::set_mesh_data_resource(Ref<MeshDataResource> a) { void MDREdUVPreviewer::set_mesh_data_resource(Ref<MeshDataResource> a) {
if (mesh_data_resource.is_valid()) { if (mesh_data_resource.is_valid()) {
mesh_data_resource->disconnect("changed", this, "on_mdr_changed"); mesh_data_resource->disconnect("changed", this, "on_mdr_changed");
} }
@ -40,7 +40,7 @@ void MDIEdUVPreviewer::set_mesh_data_resource(Ref<MeshDataResource> a) {
update(); update();
} }
void MDIEdUVPreviewer::set_mesh_data_instance(MeshDataInstance *a) { void MDREdUVPreviewer::set_mesh_data_instance(MeshDataInstance *a) {
if (!a) { if (!a) {
background_texture.unref(); background_texture.unref();
return; return;
@ -49,11 +49,11 @@ void MDIEdUVPreviewer::set_mesh_data_instance(MeshDataInstance *a) {
background_texture = a->get_texture(); background_texture = a->get_texture();
} }
void MDIEdUVPreviewer::on_mdr_changed() { void MDREdUVPreviewer::on_mdr_changed() {
update(); update();
} }
void MDIEdUVPreviewer::_draw() { void MDREdUVPreviewer::_draw() {
if (background_texture.is_valid()) { if (background_texture.is_valid()) {
draw_texture_rect_region(background_texture, Rect2(Vector2(), get_size()), Rect2(Vector2(), background_texture->get_size())); draw_texture_rect_region(background_texture, Rect2(Vector2(), get_size()), Rect2(Vector2(), background_texture->get_size()));
} }
@ -102,11 +102,11 @@ void MDIEdUVPreviewer::_draw() {
} }
} }
MDIEdUVPreviewer::MDIEdUVPreviewer() { MDREdUVPreviewer::MDREdUVPreviewer() {
} }
MDIEdUVPreviewer::~MDIEdUVPreviewer() { MDREdUVPreviewer::~MDREdUVPreviewer() {
} }
void MDIEdUVPreviewer::_bind_methods() { void MDREdUVPreviewer::_bind_methods() {
} }

View File

@ -1,5 +1,5 @@
#ifndef MDI_ED_UV_PREVIEWER_H #ifndef MDR_ED_UV_PREVIEWER_H
#define MDI_ED_UV_PREVIEWER_H #define MDR_ED_UV_PREVIEWER_H
/* /*
Copyright (c) 2019-2022 Péter Magyar Copyright (c) 2019-2022 Péter Magyar
@ -31,8 +31,8 @@ class MeshDataResource;
class MeshDataInstance; class MeshDataInstance;
class Texture; class Texture;
class MDIEdUVPreviewer : public Control { class MDREdUVPreviewer : public Control {
GDCLASS(MDIEdUVPreviewer, Control); GDCLASS(MDREdUVPreviewer, Control);
public: public:
void set_mesh_data_resource(Ref<MeshDataResource> a); void set_mesh_data_resource(Ref<MeshDataResource> a);
@ -40,8 +40,8 @@ public:
void on_mdr_changed(); void on_mdr_changed();
void _draw(); void _draw();
MDIEdUVPreviewer(); MDREdUVPreviewer();
~MDIEdUVPreviewer(); ~MDREdUVPreviewer();
protected: protected:
static void _bind_methods(); static void _bind_methods();

View File

@ -34,7 +34,8 @@ void MDRUVRectEditorPopup::on_cancel_pressed() {
MDRUVRectEditorPopup::MDRUVRectEditorPopup() { MDRUVRectEditorPopup::MDRUVRectEditorPopup() {
_editor = memnew(MDRUVRectEditor); _editor = memnew(MDRUVRectEditor);
_editor->set_h_size_flags(SIZE_EXPAND_FILL);
_editor->set_v_size_flags(SIZE_EXPAND_FILL);
add_child(_editor); add_child(_editor);
connect("confirmed", this, "on_ok_pressed"); connect("confirmed", this, "on_ok_pressed");