summaryrefslogtreecommitdiff
path: root/editor
diff options
context:
space:
mode:
Diffstat (limited to 'editor')
-rw-r--r--editor/collada/collada.cpp4
-rw-r--r--editor/dependency_editor.cpp63
-rw-r--r--editor/dependency_editor.h3
-rw-r--r--editor/editor_data.cpp2
-rw-r--r--editor/editor_export.cpp10
-rw-r--r--editor/editor_export.h2
-rw-r--r--editor/editor_file_dialog.cpp1
-rw-r--r--editor/editor_node.cpp18
-rw-r--r--editor/editor_settings.cpp4
-rw-r--r--editor/find_in_files.cpp11
-rw-r--r--editor/groups_editor.cpp437
-rw-r--r--editor/groups_editor.h66
-rw-r--r--editor/icons/icon_add_split.svg78
-rw-r--r--editor/icons/icon_asset_lib.svg2
-rw-r--r--editor/icons/icon_audio_bus_layout.svg4
-rw-r--r--editor/icons/icon_audio_stream_player.svg4
-rw-r--r--editor/icons/icon_audio_stream_player_2_d.svg4
-rw-r--r--editor/icons/icon_audio_stream_player_3_d.svg4
-rw-r--r--editor/icons/icon_audio_stream_sample.svg4
-rw-r--r--editor/icons/icon_bus_vu_db.svg4
-rw-r--r--editor/icons/icon_bus_vu_empty.svg4
-rw-r--r--editor/icons/icon_bus_vu_full.svg4
-rw-r--r--editor/icons/icon_c_s_g_box.svg6
-rw-r--r--editor/icons/icon_c_s_g_capsule.svg6
-rw-r--r--editor/icons/icon_c_s_g_combiner.svg8
-rw-r--r--editor/icons/icon_c_s_g_cylinder.svg6
-rw-r--r--editor/icons/icon_c_s_g_mesh.svg6
-rw-r--r--editor/icons/icon_c_s_g_polygon.svg6
-rw-r--r--editor/icons/icon_c_s_g_sphere.svg6
-rw-r--r--editor/icons/icon_c_s_g_torus.svg6
-rw-r--r--editor/icons/icon_color_rect.svg5
-rw-r--r--editor/icons/icon_editor_position.svg71
-rw-r--r--editor/icons/icon_editor_position_previous.svg63
-rw-r--r--editor/icons/icon_editor_position_unselected.svg68
-rw-r--r--editor/icons/icon_insert_after.svg7
-rw-r--r--editor/icons/icon_insert_before.svg7
-rw-r--r--editor/icons/icon_key_hover.svg5
-rw-r--r--editor/icons/icon_key_selected.svg5
-rw-r--r--editor/icons/icon_move_down.svg4
-rw-r--r--editor/icons/icon_move_left.svg3
-rw-r--r--editor/icons/icon_move_right.svg3
-rw-r--r--editor/icons/icon_move_up.svg4
-rw-r--r--editor/icons/icon_paint_vertex.svg58
-rw-r--r--editor/icons/icon_panel.svg4
-rw-r--r--editor/icons/icon_panel_container.svg4
-rw-r--r--editor/icons/icon_translation.svg2
-rw-r--r--editor/icons/icon_unpaint_vertex.svg58
-rw-r--r--editor/import/resource_importer_texture.cpp2
-rw-r--r--editor/plugins/animation_player_editor_plugin.cpp7
-rw-r--r--editor/plugins/asset_library_editor_plugin.cpp14
-rw-r--r--editor/plugins/asset_library_editor_plugin.h1
-rw-r--r--editor/plugins/canvas_item_editor_plugin.cpp213
-rw-r--r--editor/plugins/canvas_item_editor_plugin.h7
-rw-r--r--editor/plugins/navigation_mesh_generator.cpp34
-rw-r--r--editor/plugins/path_editor_plugin.cpp11
-rw-r--r--editor/plugins/polygon_2d_editor_plugin.cpp296
-rw-r--r--editor/plugins/polygon_2d_editor_plugin.h23
-rw-r--r--editor/plugins/sprite_frames_editor_plugin.cpp26
-rw-r--r--editor/plugins/tile_map_editor_plugin.cpp15
-rw-r--r--editor/plugins/tile_map_editor_plugin.h19
-rw-r--r--editor/plugins/tile_set_editor_plugin.cpp7
-rw-r--r--editor/project_export.cpp9
-rw-r--r--editor/project_export.h1
-rw-r--r--editor/script_editor_debugger.cpp23
-rw-r--r--editor/spatial_editor_gizmos.cpp4
65 files changed, 1336 insertions, 530 deletions
diff --git a/editor/collada/collada.cpp b/editor/collada/collada.cpp
index 4ce57d7f63..734229d014 100644
--- a/editor/collada/collada.cpp
+++ b/editor/collada/collada.cpp
@@ -2266,10 +2266,8 @@ void Collada::_merge_skeletons2(VisualScene *p_vscene) {
}
node = node->parent;
}
- ERR_CONTINUE(!sk);
- if (!sk)
- continue; //bleh
+ ERR_CONTINUE(!sk);
if (!skeleton) {
skeleton = sk;
diff --git a/editor/dependency_editor.cpp b/editor/dependency_editor.cpp
index 19fd297f69..953d787322 100644
--- a/editor/dependency_editor.cpp
+++ b/editor/dependency_editor.cpp
@@ -472,17 +472,18 @@ void DependencyRemoveDialog::_build_removed_dependency_tree(const Vector<Removed
void DependencyRemoveDialog::show(const Vector<String> &p_folders, const Vector<String> &p_files) {
all_remove_files.clear();
- to_delete.clear();
+ dirs_to_delete.clear();
+ files_to_delete.clear();
owners->clear();
for (int i = 0; i < p_folders.size(); ++i) {
String folder = p_folders[i].ends_with("/") ? p_folders[i] : (p_folders[i] + "/");
_find_files_in_removed_folder(EditorFileSystem::get_singleton()->get_filesystem_path(folder), folder);
- to_delete.push_back(folder);
+ dirs_to_delete.push_back(folder);
}
for (int i = 0; i < p_files.size(); ++i) {
all_remove_files[p_files[i]] = String();
- to_delete.push_back(p_files[i]);
+ files_to_delete.push_back(p_files[i]);
}
Vector<RemovedDependency> removed_deps;
@@ -502,29 +503,49 @@ void DependencyRemoveDialog::show(const Vector<String> &p_folders, const Vector<
}
void DependencyRemoveDialog::ok_pressed() {
- bool files_only = true;
- for (int i = 0; i < to_delete.size(); ++i) {
- if (to_delete[i].ends_with("/")) {
- files_only = false;
- } else if (ResourceCache::has(to_delete[i])) {
- Resource *res = ResourceCache::get(to_delete[i]);
- res->set_path(""); //clear reference to path
+
+ if (dirs_to_delete.size() == 0) {
+ //If we only deleted files we should only need to tell the file system about the files we touched.
+ for (int i = 0; i < files_to_delete.size(); ++i)
+ EditorFileSystem::get_singleton()->update_file(files_to_delete[i]);
+ } else {
+
+ for (int i = 0; i < files_to_delete.size(); ++i) {
+ if (ResourceCache::has(files_to_delete[i])) {
+ Resource *res = ResourceCache::get(files_to_delete[i]);
+ res->set_path("");
+ }
+ String path = OS::get_singleton()->get_resource_dir() + files_to_delete[i].replace_first("res://", "/");
+ print_line("Moving to trash: " + path);
+ Error err = OS::get_singleton()->move_to_trash(path);
+ if (err != OK) {
+ EditorNode::get_singleton()->add_io_error(TTR("Cannot remove:") + "\n" + files_to_delete[i] + "\n");
+ }
}
- String path = OS::get_singleton()->get_resource_dir() + to_delete[i].replace_first("res://", "/");
- print_line("Moving to trash: " + path);
- Error err = OS::get_singleton()->move_to_trash(path);
- if (err != OK) {
- EditorNode::get_singleton()->add_io_error(TTR("Cannot remove:") + "\n" + to_delete[i] + "\n");
+ for (int i = 0; i < dirs_to_delete.size(); ++i) {
+ String path = OS::get_singleton()->get_resource_dir() + dirs_to_delete[i].replace_first("res://", "/");
+ print_line("Moving to trash: " + path);
+ Error err = OS::get_singleton()->move_to_trash(path);
+ if (err != OK) {
+ EditorNode::get_singleton()->add_io_error(TTR("Cannot remove:") + "\n" + dirs_to_delete[i] + "\n");
+ }
}
- }
- if (files_only) {
- //If we only deleted files we should only need to tell the file system about the files we touched.
- for (int i = 0; i < to_delete.size(); ++i) {
- EditorFileSystem::get_singleton()->update_file(to_delete[i]);
+ // if some dirs would be deleted, favorite dirs need to be updated
+ Vector<String> previous_favorite_dirs = EditorSettings::get_singleton()->get_favorite_dirs();
+ Vector<String> new_favorite_dirs;
+
+ for (int i = 0; i < previous_favorite_dirs.size(); ++i) {
+ if (dirs_to_delete.find(previous_favorite_dirs[i] + "/") < 0) {
+ new_favorite_dirs.push_back(previous_favorite_dirs[i]);
+ }
}
- } else {
+
+ if (new_favorite_dirs.size() < previous_favorite_dirs.size()) {
+ EditorSettings::get_singleton()->set_favorite_dirs(new_favorite_dirs);
+ }
+
EditorFileSystem::get_singleton()->scan_changes();
}
}
diff --git a/editor/dependency_editor.h b/editor/dependency_editor.h
index 16135c352b..4f268de748 100644
--- a/editor/dependency_editor.h
+++ b/editor/dependency_editor.h
@@ -102,7 +102,8 @@ class DependencyRemoveDialog : public ConfirmationDialog {
Tree *owners;
Map<String, String> all_remove_files;
- Vector<String> to_delete;
+ Vector<String> dirs_to_delete;
+ Vector<String> files_to_delete;
struct RemovedDependency {
String file;
diff --git a/editor/editor_data.cpp b/editor/editor_data.cpp
index 660eaafe8e..37a35b6ebf 100644
--- a/editor/editor_data.cpp
+++ b/editor/editor_data.cpp
@@ -588,8 +588,6 @@ bool EditorData::check_and_update_scene(int p_idx) {
bool must_reload = _find_updated_instances(edited_scene[p_idx].root, edited_scene[p_idx].root, checked_scenes);
- print_line("MUST RELOAD? " + itos(must_reload));
-
if (must_reload) {
Ref<PackedScene> pscene;
pscene.instance();
diff --git a/editor/editor_export.cpp b/editor/editor_export.cpp
index 8e4d241a81..7739b08eff 100644
--- a/editor/editor_export.cpp
+++ b/editor/editor_export.cpp
@@ -911,6 +911,16 @@ Error EditorExportPlatform::save_zip(const Ref<EditorExportPreset> &p_preset, co
return OK;
}
+Error EditorExportPlatform::export_pack(const Ref<EditorExportPreset> &p_preset, bool p_debug, const String &p_path, int p_flags) {
+ ExportNotifier notifier(*this, p_preset, p_debug, p_path, p_flags);
+ return save_pack(p_preset, p_path);
+}
+
+Error EditorExportPlatform::export_zip(const Ref<EditorExportPreset> &p_preset, bool p_debug, const String &p_path, int p_flags) {
+ ExportNotifier notifier(*this, p_preset, p_debug, p_path, p_flags);
+ return save_zip(p_preset, p_path);
+}
+
void EditorExportPlatform::gen_export_flags(Vector<String> &r_flags, int p_flags) {
String host = EditorSettings::get_singleton()->get("network/debug/remote_host");
diff --git a/editor/editor_export.h b/editor/editor_export.h
index 6a9c3f7db2..1d0b89cf16 100644
--- a/editor/editor_export.h
+++ b/editor/editor_export.h
@@ -243,6 +243,8 @@ public:
virtual String get_binary_extension(const Ref<EditorExportPreset> &p_preset) const = 0;
virtual Error export_project(const Ref<EditorExportPreset> &p_preset, bool p_debug, const String &p_path, int p_flags = 0) = 0;
+ virtual Error export_pack(const Ref<EditorExportPreset> &p_preset, bool p_debug, const String &p_path, int p_flags = 0);
+ virtual Error export_zip(const Ref<EditorExportPreset> &p_preset, bool p_debug, const String &p_path, int p_flags = 0);
virtual void get_platform_features(List<String> *r_features) = 0;
EditorExportPlatform();
diff --git a/editor/editor_file_dialog.cpp b/editor/editor_file_dialog.cpp
index 4ae6e9a4f4..8a8a21543b 100644
--- a/editor/editor_file_dialog.cpp
+++ b/editor/editor_file_dialog.cpp
@@ -1027,6 +1027,7 @@ void EditorFileDialog::invalidate() {
if (is_visible_in_tree()) {
update_file_list();
+ _update_favorites();
invalidated = false;
} else {
invalidated = true;
diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp
index 870d0dc5d9..d8c85df83d 100644
--- a/editor/editor_node.cpp
+++ b/editor/editor_node.cpp
@@ -469,26 +469,26 @@ void EditorNode::_fs_changed() {
preset.unref();
}
if (preset.is_null()) {
- String err = "Unknown export preset: " + export_defer.preset;
- ERR_PRINTS(err);
+ String errstr = "Unknown export preset: " + export_defer.preset;
+ ERR_PRINTS(errstr);
} else {
Ref<EditorExportPlatform> platform = preset->get_platform();
if (platform.is_null()) {
- String err = "Preset \"" + export_defer.preset + "\" doesn't have a platform.";
- ERR_PRINTS(err);
+ String errstr = "Preset \"" + export_defer.preset + "\" doesn't have a platform.";
+ ERR_PRINTS(errstr);
} else {
// ensures export_project does not loop infinitely, because notifications may
// come during the export
export_defer.preset = "";
- Error err;
+ Error err = OK;
if (!preset->is_runnable() && (export_defer.path.ends_with(".pck") || export_defer.path.ends_with(".zip"))) {
if (export_defer.path.ends_with(".zip")) {
- err = platform->save_zip(preset, export_defer.path);
+ err = platform->export_zip(preset, export_defer.debug, export_defer.path);
} else if (export_defer.path.ends_with(".pck")) {
- err = platform->save_pack(preset, export_defer.path);
+ err = platform->export_pack(preset, export_defer.debug, export_defer.path);
}
} else {
- err = platform->export_project(preset, export_defer.debug, export_defer.path, /*p_flags*/ 0);
+ err = platform->export_project(preset, export_defer.debug, export_defer.path);
}
if (err != OK) {
ERR_PRINTS(vformat(TTR("Project export failed with error code %d."), (int)err));
@@ -4886,7 +4886,7 @@ EditorNode::EditorNode() {
if (!OS::get_singleton()->has_touchscreen_ui_hint() && Input::get_singleton()) {
//only if no touchscreen ui hint, set emulation
- id->set_emulate_touch(false); //just disable just in case
+ id->set_emulate_touch_from_mouse(false); //just disable just in case
}
id->set_custom_mouse_cursor(RES());
}
diff --git a/editor/editor_settings.cpp b/editor/editor_settings.cpp
index 85f6d99c67..15d3b28da8 100644
--- a/editor/editor_settings.cpp
+++ b/editor/editor_settings.cpp
@@ -371,7 +371,7 @@ void EditorSettings::_load_defaults(Ref<ConfigFile> p_extra_config) {
_initial_set("text_editor/line_numbers/code_folding", true);
_initial_set("text_editor/line_numbers/show_line_length_guideline", false);
_initial_set("text_editor/line_numbers/line_length_guideline_column", 80);
- hints["text_editor/line_numbers/line_length_guideline_column"] = PropertyInfo(Variant::INT, "text_editor/line_numbers/line_length_guideline_column", PROPERTY_HINT_RANGE, "20, 160, 10");
+ hints["text_editor/line_numbers/line_length_guideline_column"] = PropertyInfo(Variant::INT, "text_editor/line_numbers/line_length_guideline_column", PROPERTY_HINT_RANGE, "20, 160, 1");
_initial_set("text_editor/open_scripts/smooth_scrolling", true);
_initial_set("text_editor/open_scripts/v_scroll_speed", 80);
@@ -385,7 +385,7 @@ void EditorSettings::_load_defaults(Ref<ConfigFile> p_extra_config) {
_initial_set("text_editor/cursor/block_caret", false);
_initial_set("text_editor/cursor/caret_blink", true);
_initial_set("text_editor/cursor/caret_blink_speed", 0.65);
- hints["text_editor/cursor/caret_blink_speed"] = PropertyInfo(Variant::REAL, "text_editor/cursor/caret_blink_speed", PROPERTY_HINT_RANGE, "0.1, 10, 0.1");
+ hints["text_editor/cursor/caret_blink_speed"] = PropertyInfo(Variant::REAL, "text_editor/cursor/caret_blink_speed", PROPERTY_HINT_RANGE, "0.1, 10, 0.01");
_initial_set("text_editor/cursor/right_click_moves_caret", true);
_initial_set("text_editor/completion/auto_brace_complete", false);
diff --git a/editor/find_in_files.cpp b/editor/find_in_files.cpp
index 9442bbc0e8..74ea46838b 100644
--- a/editor/find_in_files.cpp
+++ b/editor/find_in_files.cpp
@@ -154,9 +154,7 @@ void FindInFiles::_iterate() {
PoolStringArray sub_dirs;
_scan_dir(_root_prefix + _current_dir, sub_dirs);
- if (sub_dirs.size() != 0) {
- _folders_stack.push_back(sub_dirs);
- }
+ _folders_stack.push_back(sub_dirs);
} else {
// Go back one level
@@ -176,7 +174,7 @@ void FindInFiles::_iterate() {
String fpath = _files_to_scan[_files_to_scan.size() - 1];
pop_back(_files_to_scan);
- _scan_file(_root_prefix + fpath);
+ _scan_file(fpath);
} else {
print_line("Search complete");
@@ -202,8 +200,6 @@ void FindInFiles::_scan_dir(String path, PoolStringArray &out_folders) {
return;
}
- //print_line(String("Scanning ") + path);
-
dir->list_dir_begin();
for (int i = 0; i < 1000; ++i) {
@@ -222,7 +218,7 @@ void FindInFiles::_scan_dir(String path, PoolStringArray &out_folders) {
else {
String file_ext = file.get_extension();
if (_extension_filter.has(file_ext)) {
- _files_to_scan.push_back(file);
+ _files_to_scan.push_back(path.plus_file(file));
}
}
}
@@ -232,7 +228,6 @@ void FindInFiles::_scan_file(String fpath) {
FileAccess *f = FileAccess::open(fpath, FileAccess::READ);
if (f == NULL) {
- f->close();
print_line(String("Cannot open file ") + fpath);
return;
}
diff --git a/editor/groups_editor.cpp b/editor/groups_editor.cpp
index bac18be4a9..8443311a54 100644
--- a/editor/groups_editor.cpp
+++ b/editor/groups_editor.cpp
@@ -29,12 +29,426 @@
/*************************************************************************/
#include "groups_editor.h"
-
+#include "editor/scene_tree_editor.h"
#include "editor_node.h"
#include "scene/gui/box_container.h"
#include "scene/gui/label.h"
#include "scene/resources/packed_scene.h"
+void GroupDialog::ok_pressed() {
+}
+
+void GroupDialog::_cancel_pressed() {
+}
+
+void GroupDialog::_group_selected() {
+ nodes_to_add->clear();
+ add_node_root = nodes_to_add->create_item();
+
+ nodes_to_remove->clear();
+ remove_node_root = nodes_to_remove->create_item();
+
+ if (!groups->is_anything_selected()) {
+ return;
+ }
+
+ selected_group = groups->get_selected()->get_text(0);
+ _load_nodes(scene_tree->get_edited_scene_root());
+}
+
+void GroupDialog::_load_nodes(Node *p_current) {
+ String item_name = p_current->get_name();
+ if (p_current != scene_tree->get_edited_scene_root()) {
+ item_name = String(p_current->get_parent()->get_name()) + "/" + String(item_name);
+ }
+
+ bool keep = true;
+ Node *root = scene_tree->get_edited_scene_root();
+ Node *owner = p_current->get_owner();
+ if (owner != root && p_current != root && !owner && !root->is_editable_instance(owner)) {
+ keep = false;
+ }
+
+ TreeItem *node;
+ NodePath path = scene_tree->get_edited_scene_root()->get_path_to(p_current);
+ if (keep && p_current->is_in_group(selected_group)) {
+ if (remove_filter->get_text().is_subsequence_ofi(String(p_current->get_name()))) {
+ node = nodes_to_remove->create_item(remove_node_root);
+ keep = true;
+ } else {
+ keep = false;
+ }
+ } else if (keep && add_filter->get_text().is_subsequence_ofi(String(p_current->get_name()))) {
+ node = nodes_to_add->create_item(add_node_root);
+ keep = true;
+ } else {
+ keep = false;
+ }
+
+ if (keep) {
+ node->set_text(0, item_name);
+ node->set_metadata(0, path);
+ node->set_tooltip(0, path);
+
+ Ref<Texture> icon;
+ if (p_current->has_meta("_editor_icon")) {
+ icon = p_current->get_meta("_editor_icon");
+ } else {
+ icon = get_icon((has_icon(p_current->get_class(), "EditorIcons") ? p_current->get_class() : String("Object")), "EditorIcons");
+ }
+ node->set_icon(0, icon);
+
+ if (!_can_edit(p_current, selected_group)) {
+ node->set_selectable(0, false);
+ node->set_custom_color(0, get_color("disabled_font_color", "Editor"));
+ }
+ }
+
+ for (int i = 0; i < p_current->get_child_count(); i++) {
+ _load_nodes(p_current->get_child(i));
+ }
+}
+
+bool GroupDialog::_can_edit(Node *p_node, String p_group) {
+ Node *n = p_node;
+ bool can_edit = true;
+ while (n) {
+ Ref<SceneState> ss = (n == EditorNode::get_singleton()->get_edited_scene()) ? n->get_scene_inherited_state() : n->get_scene_instance_state();
+ if (ss.is_valid()) {
+ int path = ss->find_node_by_path(n->get_path_to(p_node));
+ if (path != -1) {
+ if (ss->is_node_in_group(path, p_group)) {
+ can_edit = false;
+ }
+ }
+ }
+ n = n->get_owner();
+ }
+ return can_edit;
+}
+
+void GroupDialog::_add_pressed() {
+ TreeItem *selected = nodes_to_add->get_selected();
+
+ if (!selected) {
+ return;
+ }
+
+ while (selected) {
+ Node *node = scene_tree->get_edited_scene_root()->get_node(selected->get_metadata(0));
+ node->add_to_group(selected_group, true);
+
+ selected = nodes_to_add->get_next_selected(selected);
+ }
+
+ _group_selected();
+ EditorNode::get_singleton()->get_scene_tree_dock()->get_tree_editor()->update_tree();
+}
+
+void GroupDialog::_removed_pressed() {
+ TreeItem *selected = nodes_to_remove->get_selected();
+
+ if (!selected) {
+ return;
+ }
+
+ while (selected) {
+ Node *node = scene_tree->get_edited_scene_root()->get_node(selected->get_metadata(0));
+ node->remove_from_group(selected_group);
+
+ selected = nodes_to_add->get_next_selected(selected);
+ }
+
+ _group_selected();
+ EditorNode::get_singleton()->get_scene_tree_dock()->get_tree_editor()->update_tree();
+}
+
+void GroupDialog::_remove_filter_changed(const String &p_filter) {
+ _group_selected();
+}
+
+void GroupDialog::_add_filter_changed(const String &p_filter) {
+ _group_selected();
+}
+
+void GroupDialog::_add_group_pressed() {
+ _add_group(add_group_text->get_text());
+ add_group_text->clear();
+}
+
+void GroupDialog::_group_renamed() {
+ TreeItem *renamed_group = groups->get_edited();
+ if (!renamed_group) {
+ return;
+ }
+
+ String name = renamed_group->get_text(0).strip_edges();
+ for (TreeItem *E = groups_root->get_children(); E; E = E->get_next()) {
+ if (E != renamed_group && E->get_text(0) == name) {
+ renamed_group->set_text(0, selected_group);
+ error->set_text(TTR("Group name already exists."));
+ error->popup_centered();
+ return;
+ }
+ }
+
+ if (name == "") {
+ renamed_group->set_text(0, selected_group);
+ error->set_text(TTR("invalid Group name."));
+ error->popup_centered();
+ return;
+ }
+
+ List<Node *> nodes;
+ scene_tree->get_nodes_in_group(selected_group, &nodes);
+ bool removed_all = true;
+ for (List<Node *>::Element *E = nodes.front(); E; E = E->next()) {
+ Node *node = E->get();
+ if (_can_edit(node, selected_group)) {
+ node->remove_from_group(selected_group);
+ node->add_to_group(name, true);
+ } else {
+ removed_all = false;
+ }
+ }
+
+ if (!removed_all) {
+ _add_group(selected_group);
+ }
+
+ selected_group = renamed_group->get_text(0);
+ _group_selected();
+}
+
+void GroupDialog::_add_group(String p_name) {
+
+ String name = p_name.strip_edges();
+ if (name == "" || groups->search_item_text(name)) {
+ return;
+ }
+
+ TreeItem *new_group = groups->create_item(groups_root);
+ new_group->set_text(0, name);
+ new_group->add_button(0, get_icon("Remove", "EditorIcons"), 0);
+ new_group->set_editable(0, true);
+}
+
+void GroupDialog::_load_groups(Node *p_current) {
+ List<Node::GroupInfo> gi;
+ p_current->get_groups(&gi);
+
+ for (List<Node::GroupInfo>::Element *E = gi.front(); E; E = E->next()) {
+ if (!E->get().persistent) {
+ continue;
+ }
+ _add_group(E->get().name);
+ }
+
+ for (int i = 0; i < p_current->get_child_count(); i++) {
+ _load_groups(p_current->get_child(i));
+ }
+}
+
+void GroupDialog::_delete_group_pressed(Object *p_item, int p_column, int p_id) {
+ TreeItem *ti = Object::cast_to<TreeItem>(p_item);
+ if (!ti)
+ return;
+
+ String name = ti->get_text(0);
+
+ List<Node *> nodes;
+ scene_tree->get_nodes_in_group(name, &nodes);
+ bool removed_all = true;
+ for (List<Node *>::Element *E = nodes.front(); E; E = E->next()) {
+ if (_can_edit(E->get(), name)) {
+ E->get()->remove_from_group(name);
+ } else {
+ removed_all = false;
+ }
+ }
+
+ if (removed_all) {
+ if (selected_group == name) {
+ add_filter->clear();
+ remove_filter->clear();
+ nodes_to_remove->clear();
+ nodes_to_add->clear();
+ groups->deselect_all();
+ selected_group = "";
+ }
+ groups_root->remove_child(ti);
+ }
+ EditorNode::get_singleton()->get_scene_tree_dock()->get_tree_editor()->update_tree();
+}
+
+void GroupDialog::_notification(int p_what) {
+ switch (p_what) {
+ case NOTIFICATION_ENTER_TREE: {
+ add_button->set_icon(get_icon("Forward", "EditorIcons"));
+ remove_button->set_icon(get_icon("Back", "EditorIcons"));
+ } break;
+ }
+}
+
+void GroupDialog::edit() {
+
+ popup_centered(Size2(600, 400));
+
+ groups->clear();
+ groups_root = groups->create_item();
+
+ nodes_to_add->clear();
+ nodes_to_remove->clear();
+
+ add_group_text->clear();
+ add_filter->clear();
+ remove_filter->clear();
+
+ _load_groups(scene_tree->get_edited_scene_root());
+}
+
+void GroupDialog::_bind_methods() {
+ ClassDB::bind_method("_cancel", &GroupDialog::_cancel_pressed);
+
+ ClassDB::bind_method("_add_pressed", &GroupDialog::_add_pressed);
+ ClassDB::bind_method("_removed_pressed", &GroupDialog::_removed_pressed);
+ ClassDB::bind_method("_delete_group_pressed", &GroupDialog::_delete_group_pressed);
+
+ ClassDB::bind_method("_group_selected", &GroupDialog::_group_selected);
+ ClassDB::bind_method("_add_group_pressed", &GroupDialog::_add_group_pressed);
+
+ ClassDB::bind_method("_add_filter_changed", &GroupDialog::_add_filter_changed);
+ ClassDB::bind_method("_remove_filter_changed", &GroupDialog::_remove_filter_changed);
+
+ ClassDB::bind_method("_group_renamed", &GroupDialog::_group_renamed);
+}
+
+GroupDialog::GroupDialog() {
+
+ scene_tree = SceneTree::get_singleton();
+
+ VBoxContainer *vbc = memnew(VBoxContainer);
+ add_child(vbc);
+
+ HBoxContainer *hbc = memnew(HBoxContainer);
+ vbc->add_child(hbc);
+ hbc->set_v_size_flags(SIZE_EXPAND_FILL);
+
+ VBoxContainer *vbc_left = memnew(VBoxContainer);
+ hbc->add_child(vbc_left);
+ vbc_left->set_h_size_flags(SIZE_EXPAND_FILL);
+
+ Label *group_title = memnew(Label);
+ group_title->set_text(TTR("Groups"));
+ vbc_left->add_child(group_title);
+
+ groups = memnew(Tree);
+ vbc_left->add_child(groups);
+ groups->set_hide_root(true);
+ groups->set_v_size_flags(SIZE_EXPAND_FILL);
+ groups->set_select_mode(Tree::SELECT_SINGLE);
+ groups->set_allow_reselect(true);
+ groups->set_allow_rmb_select(true);
+ groups->connect("item_selected", this, "_group_selected");
+ groups->connect("button_pressed", this, "_delete_group_pressed");
+ groups->connect("item_edited", this, "_group_renamed");
+
+ HBoxContainer *chbc = memnew(HBoxContainer);
+ vbc_left->add_child(chbc);
+ chbc->set_h_size_flags(SIZE_EXPAND_FILL);
+
+ add_group_text = memnew(LineEdit);
+ chbc->add_child(add_group_text);
+ add_group_text->set_h_size_flags(SIZE_EXPAND_FILL);
+
+ Button *add_group_button = memnew(Button);
+ add_group_button->set_text("Add");
+ chbc->add_child(add_group_button);
+ add_group_button->connect("pressed", this, "_add_group_pressed");
+
+ VBoxContainer *vbc_add = memnew(VBoxContainer);
+ hbc->add_child(vbc_add);
+ vbc_add->set_h_size_flags(SIZE_EXPAND_FILL);
+
+ Label *out_of_group_title = memnew(Label);
+ out_of_group_title->set_text(TTR("Nodes not in Group"));
+ vbc_add->add_child(out_of_group_title);
+
+ nodes_to_add = memnew(Tree);
+ vbc_add->add_child(nodes_to_add);
+ nodes_to_add->set_hide_root(true);
+ nodes_to_add->set_hide_folding(true);
+ nodes_to_add->set_v_size_flags(SIZE_EXPAND_FILL);
+ nodes_to_add->set_select_mode(Tree::SELECT_MULTI);
+ nodes_to_add->connect("item_selected", this, "_nodes_to_add_selected");
+
+ HBoxContainer *add_filter_hbc = memnew(HBoxContainer);
+ add_filter_hbc->add_constant_override("separate", 0);
+ vbc_add->add_child(add_filter_hbc);
+
+ add_filter = memnew(LineEdit);
+ add_filter->set_h_size_flags(SIZE_EXPAND_FILL);
+ add_filter->set_placeholder(TTR("Filter nodes"));
+ add_filter_hbc->add_child(add_filter);
+ add_filter->connect("text_changed", this, "_add_filter_changed");
+
+ VBoxContainer *vbc_buttons = memnew(VBoxContainer);
+ hbc->add_child(vbc_buttons);
+ vbc_buttons->set_h_size_flags(SIZE_SHRINK_CENTER);
+ vbc_buttons->set_v_size_flags(SIZE_SHRINK_CENTER);
+
+ add_button = memnew(ToolButton);
+ add_button->set_text(TTR("Add"));
+ add_button->connect("pressed", this, "_add_pressed");
+
+ vbc_buttons->add_child(add_button);
+ vbc_buttons->add_spacer();
+ vbc_buttons->add_spacer();
+ vbc_buttons->add_spacer();
+
+ remove_button = memnew(ToolButton);
+ remove_button->set_text(TTR("Remove"));
+ remove_button->connect("pressed", this, "_removed_pressed");
+
+ vbc_buttons->add_child(remove_button);
+
+ VBoxContainer *vbc_remove = memnew(VBoxContainer);
+ hbc->add_child(vbc_remove);
+ vbc_remove->set_h_size_flags(SIZE_EXPAND_FILL);
+
+ Label *in_group_title = memnew(Label);
+ in_group_title->set_text(TTR("Nodes in Group"));
+ vbc_remove->add_child(in_group_title);
+
+ nodes_to_remove = memnew(Tree);
+ vbc_remove->add_child(nodes_to_remove);
+ nodes_to_remove->set_v_size_flags(SIZE_EXPAND_FILL);
+ nodes_to_remove->set_hide_root(true);
+ nodes_to_remove->set_hide_folding(true);
+ nodes_to_remove->set_select_mode(Tree::SELECT_MULTI);
+ nodes_to_remove->connect("item_selected", this, "_node_to_remove_selected");
+
+ HBoxContainer *remove_filter_hbc = memnew(HBoxContainer);
+ remove_filter_hbc->add_constant_override("separate", 0);
+ vbc_remove->add_child(remove_filter_hbc);
+
+ remove_filter = memnew(LineEdit);
+ remove_filter->set_h_size_flags(SIZE_EXPAND_FILL);
+ remove_filter->set_placeholder(TTR("Filter nodes"));
+ remove_filter_hbc->add_child(remove_filter);
+ remove_filter->connect("text_changed", this, "_remove_filter_changed");
+
+ set_title("Group Editor");
+ get_cancel()->hide();
+ set_as_toplevel(true);
+
+ error = memnew(ConfirmationDialog);
+ add_child(error);
+ error->get_ok()->set_text(TTR("Close"));
+}
+
+////////////////////////////////////////////////////////////////////////////////
+
void GroupsEditor::_add_group(const String &p_group) {
if (!node)
@@ -146,11 +560,22 @@ void GroupsEditor::set_current(Node *p_node) {
update_tree();
}
+void GroupsEditor::_show_group_dialog() {
+ group_dialog->edit();
+}
+
+void GroupsEditor::_group_dialog_closed() {
+ update_tree();
+}
+
void GroupsEditor::_bind_methods() {
ClassDB::bind_method("_add_group", &GroupsEditor::_add_group);
ClassDB::bind_method("_remove_group", &GroupsEditor::_remove_group);
ClassDB::bind_method("update_tree", &GroupsEditor::update_tree);
+
+ ClassDB::bind_method("_show_group_dialog", &GroupsEditor::_show_group_dialog);
+ ClassDB::bind_method("_group_dialog_closed", &GroupsEditor::_group_dialog_closed);
}
GroupsEditor::GroupsEditor() {
@@ -159,6 +584,16 @@ GroupsEditor::GroupsEditor() {
VBoxContainer *vbc = this;
+ group_dialog = memnew(GroupDialog);
+ group_dialog->set_as_toplevel(true);
+ add_child(group_dialog);
+ group_dialog->connect("popup_hide", this, "_group_dialog_closed");
+
+ Button *group_dialog_button = memnew(Button);
+ group_dialog_button->set_text(TTR("Manage Groups"));
+ vbc->add_child(group_dialog_button);
+ group_dialog_button->connect("pressed", this, "_show_group_dialog");
+
HBoxContainer *hbc = memnew(HBoxContainer);
vbc->add_child(hbc);
diff --git a/editor/groups_editor.h b/editor/groups_editor.h
index ad3d5cd14f..461cf0f8c2 100644
--- a/editor/groups_editor.h
+++ b/editor/groups_editor.h
@@ -31,9 +31,13 @@
#ifndef GROUPS_EDITOR_H
#define GROUPS_EDITOR_H
+#include "editor/scene_tree_editor.h"
#include "scene/gui/button.h"
#include "scene/gui/dialogs.h"
+#include "scene/gui/item_list.h"
#include "scene/gui/line_edit.h"
+#include "scene/gui/popup.h"
+#include "scene/gui/tool_button.h"
#include "scene/gui/tree.h"
#include "undo_redo.h"
@@ -41,12 +45,71 @@
@author Juan Linietsky <reduzio@gmail.com>
*/
+class GroupDialog : public ConfirmationDialog {
+
+ GDCLASS(GroupDialog, ConfirmationDialog);
+
+ ConfirmationDialog *error;
+
+ SceneTree *scene_tree;
+ TreeItem *groups_root;
+
+ LineEdit *add_group_text;
+
+ Tree *groups;
+
+ Tree *nodes_to_add;
+ TreeItem *add_node_root;
+ LineEdit *add_filter;
+
+ Tree *nodes_to_remove;
+ TreeItem *remove_node_root;
+ LineEdit *remove_filter;
+
+ ToolButton *add_button;
+ ToolButton *remove_button;
+
+ String selected_group;
+
+ void ok_pressed();
+ void _cancel_pressed();
+ void _group_selected();
+
+ void _remove_filter_changed(const String &p_filter);
+ void _add_filter_changed(const String &p_filter);
+
+ void _add_pressed();
+ void _removed_pressed();
+ void _add_group_pressed();
+
+ void _group_renamed();
+
+ void _add_group(String p_name);
+ void _delete_group_pressed(Object *p_item, int p_column, int p_id);
+
+ bool _can_edit(Node *p_node, String p_group);
+
+ void _load_groups(Node *p_current);
+ void _load_nodes(Node *p_current);
+
+protected:
+ void _notification(int p_what);
+ static void _bind_methods();
+
+public:
+ void edit();
+
+ GroupDialog();
+};
+
class GroupsEditor : public VBoxContainer {
GDCLASS(GroupsEditor, VBoxContainer);
Node *node;
+ GroupDialog *group_dialog;
+
LineEdit *group_name;
Button *add;
Tree *tree;
@@ -58,6 +121,9 @@ class GroupsEditor : public VBoxContainer {
void _remove_group(Object *p_item, int p_column, int p_id);
void _close();
+ void _show_group_dialog();
+ void _group_dialog_closed();
+
protected:
static void _bind_methods();
diff --git a/editor/icons/icon_add_split.svg b/editor/icons/icon_add_split.svg
index 6cfd419e7f..4555fceb7c 100644
--- a/editor/icons/icon_add_split.svg
+++ b/editor/icons/icon_add_split.svg
@@ -1,72 +1,8 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<svg
- xmlns:dc="http://purl.org/dc/elements/1.1/"
- xmlns:cc="http://creativecommons.org/ns#"
- xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
- xmlns:svg="http://www.w3.org/2000/svg"
- xmlns="http://www.w3.org/2000/svg"
- xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
- xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
- width="16"
- height="16"
- version="1.1"
- viewBox="0 0 16 16"
- id="svg4"
- sodipodi:docname="icon_add_split.svg"
- inkscape:version="0.92.2 (5c3e80d, 2017-08-06)">
- <metadata
- id="metadata10">
- <rdf:RDF>
- <cc:Work
- rdf:about="">
- <dc:format>image/svg+xml</dc:format>
- <dc:type
- rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
- <dc:title></dc:title>
- </cc:Work>
- </rdf:RDF>
- </metadata>
- <defs
- id="defs8" />
- <sodipodi:namedview
- pagecolor="#ffffff"
- bordercolor="#666666"
- borderopacity="1"
- objecttolerance="10"
- gridtolerance="10"
- guidetolerance="10"
- inkscape:pageopacity="0"
- inkscape:pageshadow="2"
- inkscape:window-width="3066"
- inkscape:window-height="1689"
- id="namedview6"
- showgrid="false"
- inkscape:zoom="41.7193"
- inkscape:cx="7.7924561"
- inkscape:cy="6.0148972"
- inkscape:window-x="134"
- inkscape:window-y="55"
- inkscape:window-maximized="1"
- inkscape:current-layer="svg4" />
- <rect
- style="fill:#800000"
- id="rect12"
- width="1.8456686"
- height="2.0853658"
- x="0.62321275"
- y="6.9394455" />
- <rect
- style="fill:#800000"
- id="rect14"
- width="1.6299411"
- height="1.9894869"
- x="12.488225"
- y="7.1791425" />
- <rect
- style="fill:#e9afaf"
- id="rect16"
- width="10.067283"
- height="0.69512194"
- x="2.492851"
- y="7.7304463" />
+<svg width="16" height="16" version="1.1" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg">
+<path d="m3 13 10-10" fill="none" stroke="#f5f5f5" stroke-opacity=".39216" stroke-width="2"/>
+<g transform="translate(0 -1036.4)">
+<path transform="translate(0 1036.4)" d="m11 9v2h-2v2h2v2h2v-2h2v-2h-2v-2z" fill="#84ffb1"/>
+</g>
+<circle cx="4" cy="12" r="2" fill="none"/>
+<path d="m13 1a2 2 0 0 0 -2 2 2 2 0 0 0 2 2 2 2 0 0 0 2 -2 2 2 0 0 0 -2 -2zm-10 10a2 2 0 0 0 -2 2 2 2 0 0 0 2 2 2 2 0 0 0 2 -2 2 2 0 0 0 -2 -2z" fill="#e0e0e0"/>
</svg>
diff --git a/editor/icons/icon_asset_lib.svg b/editor/icons/icon_asset_lib.svg
index 1348c491fc..967c5bf708 100644
--- a/editor/icons/icon_asset_lib.svg
+++ b/editor/icons/icon_asset_lib.svg
@@ -1,3 +1,3 @@
<svg width="16" height="16" version="1.1" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg">
-<path d="m8 1c-1.6569 0-3 1.3431-3 3v2h-4v7c0 1.108 0.89199 2 2 2h10c1.108 0 2-0.89199 2-2v-7h-4v-2c0-1.6569-1.3431-3-3-3zm0 2c0.55228 0 1 0.44772 1 1v2h-2v-2c0-0.55228 0.44772-1 1-1z" fill="#e0e0e0"/>
+<path d="m8 1c-1.6569 0-3 1.3431-3 3v2h-3c-0.66446 3.505e-4 -1.1438 0.6366-0.96094 1.2754l2 7c0.12287 0.42881 0.51487 0.7244 0.96094 0.72461h8c0.44606-2.09e-4 0.83806-0.2958 0.96094-0.72461l2-7c0.1829-0.63879-0.29648-1.275-0.96094-1.2754h-3v-2c0-1.6569-1.3431-3-3-3zm0 2c0.55228 0 1 0.44772 1 1v2h-2v-2c0-0.55228 0.44772-1 1-1z" fill="#e0e0e0"/>
</svg>
diff --git a/editor/icons/icon_audio_bus_layout.svg b/editor/icons/icon_audio_bus_layout.svg
index 9162722eb2..fa6b60bc3e 100644
--- a/editor/icons/icon_audio_bus_layout.svg
+++ b/editor/icons/icon_audio_bus_layout.svg
@@ -1,9 +1,9 @@
<svg width="16" height="16" version="1.1" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<defs>
<linearGradient id="a" x1="8" x2="8" y1="1" y2="15" gradientUnits="userSpaceOnUse">
-<stop stop-color="#ff8484" offset="0"/>
+<stop stop-color="#ff7a7a" offset="0"/>
<stop stop-color="#e1dc7a" offset=".5"/>
-<stop stop-color="#84ffb1" offset="1"/>
+<stop stop-color="#66ff9e" offset="1"/>
</linearGradient>
</defs>
<g transform="translate(0 -1036.4)">
diff --git a/editor/icons/icon_audio_stream_player.svg b/editor/icons/icon_audio_stream_player.svg
index 218fd995a0..754b72bc96 100644
--- a/editor/icons/icon_audio_stream_player.svg
+++ b/editor/icons/icon_audio_stream_player.svg
@@ -1,9 +1,9 @@
<svg width="16" height="16" version="1.1" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<defs>
<linearGradient id="a" x1="8" x2="8" y1="1" y2="15" gradientUnits="userSpaceOnUse">
-<stop stop-color="#ff8484" offset="0"/>
+<stop stop-color="#ff7a7a" offset="0"/>
<stop stop-color="#e1dc7a" offset=".5"/>
-<stop stop-color="#84ffb1" offset="1"/>
+<stop stop-color="#66ff9e" offset="1"/>
</linearGradient>
</defs>
<g transform="translate(0 -1036.4)" shape-rendering="auto">
diff --git a/editor/icons/icon_audio_stream_player_2_d.svg b/editor/icons/icon_audio_stream_player_2_d.svg
index a431b84a55..0e9c0ca5b1 100644
--- a/editor/icons/icon_audio_stream_player_2_d.svg
+++ b/editor/icons/icon_audio_stream_player_2_d.svg
@@ -1,9 +1,9 @@
<svg width="16" height="16" version="1.1" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<defs>
<linearGradient id="a" x1="8" x2="8" y1="1" y2="15" gradientUnits="userSpaceOnUse">
-<stop stop-color="#ff8484" offset="0"/>
+<stop stop-color="#ff7a7a" offset="0"/>
<stop stop-color="#e1dc7a" offset=".5"/>
-<stop stop-color="#84ffb1" offset="1"/>
+<stop stop-color="#66ff9e" offset="1"/>
</linearGradient>
</defs>
<g transform="translate(0 -1036.4)" shape-rendering="auto">
diff --git a/editor/icons/icon_audio_stream_player_3_d.svg b/editor/icons/icon_audio_stream_player_3_d.svg
index 4ce9d6da58..d947586f63 100644
--- a/editor/icons/icon_audio_stream_player_3_d.svg
+++ b/editor/icons/icon_audio_stream_player_3_d.svg
@@ -1,9 +1,9 @@
<svg width="16" height="16" version="1.1" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<defs>
<linearGradient id="a" x1="8" x2="8" y1="1" y2="15" gradientUnits="userSpaceOnUse">
-<stop stop-color="#ff8484" offset="0"/>
+<stop stop-color="#ff7a7a" offset="0"/>
<stop stop-color="#e1dc7a" offset=".5"/>
-<stop stop-color="#84ffb1" offset="1"/>
+<stop stop-color="#66ff9e" offset="1"/>
</linearGradient>
</defs>
<g transform="translate(0 -1036.4)" shape-rendering="auto">
diff --git a/editor/icons/icon_audio_stream_sample.svg b/editor/icons/icon_audio_stream_sample.svg
index f0be1dc303..a7c7232ee0 100644
--- a/editor/icons/icon_audio_stream_sample.svg
+++ b/editor/icons/icon_audio_stream_sample.svg
@@ -1,9 +1,9 @@
<svg width="16" height="16" version="1.1" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<defs>
<linearGradient id="a" x1="8" x2="8" y1="1" y2="15" gradientUnits="userSpaceOnUse">
-<stop stop-color="#ff8484" offset="0"/>
+<stop stop-color="#ff7a7a" offset="0"/>
<stop stop-color="#e1dc7a" offset=".5"/>
-<stop stop-color="#84ffb1" offset="1"/>
+<stop stop-color="#66ff9e" offset="1"/>
</linearGradient>
</defs>
<g transform="translate(0 -1036.4)">
diff --git a/editor/icons/icon_bus_vu_db.svg b/editor/icons/icon_bus_vu_db.svg
index 23bcd8841c..236e41e1f5 100644
--- a/editor/icons/icon_bus_vu_db.svg
+++ b/editor/icons/icon_bus_vu_db.svg
@@ -1,9 +1,9 @@
<svg width="32" height="128" version="1.1" viewBox="0 0 32 128" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<defs>
<linearGradient id="a" x1="16" x2="16" y2="128" gradientUnits="userSpaceOnUse">
-<stop stop-color="#ff8484" offset="0"/>
+<stop stop-color="#ff7a7a" offset="0"/>
<stop stop-color="#e1dc7a" offset=".5"/>
-<stop stop-color="#84ffb1" offset="1"/>
+<stop stop-color="#66ff9e" offset="1"/>
</linearGradient>
</defs>
<g transform="translate(0 -924.36)">
diff --git a/editor/icons/icon_bus_vu_empty.svg b/editor/icons/icon_bus_vu_empty.svg
index 52c86ac704..60fddc535f 100644
--- a/editor/icons/icon_bus_vu_empty.svg
+++ b/editor/icons/icon_bus_vu_empty.svg
@@ -1,9 +1,9 @@
<svg width="16" height="128" version="1.1" viewBox="0 0 16 128" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<defs>
<linearGradient id="a" x1="8" x2="8" y1="2" y2="126" gradientTransform="translate(0 924.36)" gradientUnits="userSpaceOnUse">
-<stop stop-color="#ff8484" offset="0"/>
+<stop stop-color="#ff7a7a" offset="0"/>
<stop stop-color="#e1dc7a" offset=".5"/>
-<stop stop-color="#84ffb1" offset="1"/>
+<stop stop-color="#66ff9e" offset="1"/>
</linearGradient>
</defs>
<g transform="translate(0 -924.36)">
diff --git a/editor/icons/icon_bus_vu_full.svg b/editor/icons/icon_bus_vu_full.svg
index a91b8a06c6..4f2ce5df11 100644
--- a/editor/icons/icon_bus_vu_full.svg
+++ b/editor/icons/icon_bus_vu_full.svg
@@ -1,9 +1,9 @@
<svg width="16" height="128" version="1.1" viewBox="0 0 16 128" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<defs>
<linearGradient id="a" x1="8" x2="8" y1="2" y2="126" gradientUnits="userSpaceOnUse">
-<stop stop-color="#ff8484" offset="0"/>
+<stop stop-color="#ff7a7a" offset="0"/>
<stop stop-color="#e1dc7a" offset=".5"/>
-<stop stop-color="#84ffb1" offset="1"/>
+<stop stop-color="#66ff9e" offset="1"/>
</linearGradient>
</defs>
<g transform="translate(0 -924.36)">
diff --git a/editor/icons/icon_c_s_g_box.svg b/editor/icons/icon_c_s_g_box.svg
new file mode 100644
index 0000000000..67e34df444
--- /dev/null
+++ b/editor/icons/icon_c_s_g_box.svg
@@ -0,0 +1,6 @@
+<svg width="16" height="16" version="1.1" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg">
+<g transform="translate(0 -1036.4)">
+<path transform="translate(0 1036.4)" d="m12 9c-0.55401 0-1 0.44599-1 1v1h2v2h1c0.55401 0 1-0.44599 1-1v-2c0-0.55401-0.44599-1-1-1h-2zm1 4h-2v-2h-1c-0.55401 0-1 0.44599-1 1v2c0 0.55401 0.44599 1 1 1h2c0.55401 0 1-0.44599 1-1v-1z" fill="#84c2ff"/>
+<path transform="translate(0 1036.4)" d="m8 0.94531-7 3.5v7.2227l7 3.5 0.29492-0.14844c-0.18282-0.30101-0.29492-0.64737-0.29492-1.0195v-2c0-0.72651 0.40824-1.3664 1-1.7168v-1.6699l4-2v1.3867h1c0.36419 0 0.70336 0.10754 1 0.2832v-3.8379zm0 2.1152 3.9395 1.9707-3.9395 1.9688-3.9395-1.9688zm-5 3.5527 4 2v3.9414l-4-2.002z" fill="#fc9c9c" stroke-width="1.0667"/>
+</g>
+</svg>
diff --git a/editor/icons/icon_c_s_g_capsule.svg b/editor/icons/icon_c_s_g_capsule.svg
new file mode 100644
index 0000000000..92a7b5a870
--- /dev/null
+++ b/editor/icons/icon_c_s_g_capsule.svg
@@ -0,0 +1,6 @@
+<svg width="16" height="16" version="1.1" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg">
+<g>
+<path d="m8 1c-2.7527 0-5 2.2418-5 4.9902v4.0176c0 2.7484 2.2473 4.9922 5 4.9922 0.092943 0 0.18367-0.008623 0.27539-0.013672-0.17055-0.29341-0.27539-0.62792-0.27539-0.98633v-2c0-0.72887 0.41095-1.3691 1.0059-1.7188v-0.28125c0.34771-0.034464 0.68259-0.10691 1.0156-0.19922 0.10394-0.99856 0.95603-1.8008 1.9785-1.8008h1v-2.0098c0-2.7484-2.2473-4.9902-5-4.9902zm-1.0059 2.127v4.8574c-0.66556-0.1047-1.2974-0.37231-1.9941-0.66211v-1.3223c0-1.3474 0.79841-2.4642 1.9941-2.873zm2.0117 0c1.1957 0.4088 1.9941 1.5256 1.9941 2.873v1.3457c-0.68406 0.3054-1.3142 0.57292-1.9941 0.66602v-4.8848zm-4.0059 6.334c0.67836 0.2231 1.3126 0.44599 1.9941 0.52539v2.8848c-1.1957-0.4092-1.9941-1.5237-1.9941-2.8711v-0.53906z" fill="#fc9c9c"/>
+<path d="m12 9c-0.55401 0-1 0.44599-1 1v1h2v2h1c0.55401 0 1-0.44599 1-1v-2c0-0.55401-0.44599-1-1-1zm1 4h-2v-2h-1c-0.55401 0-1 0.44599-1 1v2c0 0.55401 0.44599 1 1 1h2c0.55401 0 1-0.44599 1-1z" fill="#84c2ff"/>
+</g>
+</svg>
diff --git a/editor/icons/icon_c_s_g_combiner.svg b/editor/icons/icon_c_s_g_combiner.svg
new file mode 100644
index 0000000000..cce2902e24
--- /dev/null
+++ b/editor/icons/icon_c_s_g_combiner.svg
@@ -0,0 +1,8 @@
+<svg width="16" height="16" version="1.1" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg">
+<g transform="translate(0 -1036.4)">
+<path transform="translate(0 1036.4)" d="m12 9c-0.55401 0-1 0.44599-1 1v1h2v2h1c0.55401 0 1-0.44599 1-1v-2c0-0.55401-0.44599-1-1-1h-2zm1 4h-2v-2h-1c-0.55401 0-1 0.44599-1 1v2c0 0.55401 0.44599 1 1 1h2c0.55401 0 1-0.44599 1-1v-1z" fill="#84c2ff"/>
+<g fill="#fc9c9c">
+<path transform="translate(0 1036.4)" d="m3 1c-1.1046 0-2 0.89543-2 2h2zm2 0v2h2v-2zm4 0v2h2v-2zm4 0v2h2c0-1.1046-0.89543-2-2-2zm-12 4v2h2v-2zm12 0v2h2v-2zm-12 4v2h2v-2zm0 4c0 1.1046 0.89543 2 2 2v-2zm4 0v2h2v-2z" fill="#fc9c9c"/>
+</g>
+</g>
+</svg>
diff --git a/editor/icons/icon_c_s_g_cylinder.svg b/editor/icons/icon_c_s_g_cylinder.svg
new file mode 100644
index 0000000000..645a74c79b
--- /dev/null
+++ b/editor/icons/icon_c_s_g_cylinder.svg
@@ -0,0 +1,6 @@
+<svg width="16" height="16" version="1.1" viewBox="0 0 14.999999 14.999999" xmlns="http://www.w3.org/2000/svg">
+<g>
+<path transform="scale(.9375)" d="m8 1c-1.7469 0-3.328 0.22648-4.5586 0.63672-0.61528 0.20512-1.1471 0.45187-1.5898 0.80078-0.44272 0.34891-0.85156 0.88101-0.85156 1.5625v8c0 0.68149 0.40884 1.2155 0.85156 1.5645 0.44272 0.34891 0.97457 0.59577 1.5898 0.80078 1.2306 0.41024 2.8117 0.63477 4.5586 0.63477 0.095648 0 0.18467-0.008426 0.2793-0.009766-0.1722-0.29446-0.2793-0.62995-0.2793-0.99023v-1c-1.5668 0-2.9867-0.2195-3.9277-0.5332-0.46329-0.15435-0.90474-0.33752-1.0723-0.4668v-5.8125c0.1468 0.058667 0.2835 0.12515 0.44141 0.17773 1.2306 0.41024 2.8117 0.63477 4.5586 0.63477s3.328-0.22453 4.5586-0.63477c0.15791-0.052267 0.29461-0.11864 0.44141-0.17773v1.8125h1c0.36396 0 0.70348 0.10774 1 0.2832v-4.2832c0-0.68149-0.40884-1.2136-0.85156-1.5625-0.44272-0.34891-0.97457-0.59566-1.5898-0.80078-1.2306-0.41024-2.8117-0.63672-4.5586-0.63672zm0 2c1.5668 0 2.9867 0.22145 3.9277 0.53516 0.46368 0.15456 0.80138 0.33741 0.96875 0.4668-0.16752 0.12928-0.50546 0.3105-0.96875 0.46484-0.94102 0.31371-2.361 0.5332-3.9277 0.5332s-2.9867-0.2195-3.9277-0.5332c-0.46329-0.15435-0.80123-0.33556-0.96875-0.46484 0.16737-0.12939 0.50507-0.31224 0.96875-0.4668 0.94102-0.31371 2.361-0.53516 3.9277-0.53516z" fill="#fc9c9c" stroke-width="1.0667"/>
+<path d="m11.25 8.4375c-0.51938 0-0.9375 0.41812-0.9375 0.9375v0.9375h1.875v1.875h0.9375c0.51938 0 0.9375-0.41812 0.9375-0.9375v-1.875c0-0.51938-0.41812-0.9375-0.9375-0.9375zm0.9375 3.75h-1.875v-1.875h-0.9375c-0.51938 0-0.9375 0.41812-0.9375 0.9375v1.875c0 0.51938 0.41812 0.9375 0.9375 0.9375h1.875c0.51938 0 0.9375-0.41812 0.9375-0.9375z" fill="#84c2ff"/>
+</g>
+</svg>
diff --git a/editor/icons/icon_c_s_g_mesh.svg b/editor/icons/icon_c_s_g_mesh.svg
new file mode 100644
index 0000000000..6e940a4aa5
--- /dev/null
+++ b/editor/icons/icon_c_s_g_mesh.svg
@@ -0,0 +1,6 @@
+<svg width="16" height="16" version="1.1" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg">
+<g>
+<path d="m3 1c-1.1046 0-2 0.89543-2 2 5.649e-4 0.71397 0.38169 1.3735 1 1.7305v6.541c-0.61771 0.35663-0.99874 1.0152-1 1.7285 0 1.1046 0.89543 2 2 2 0.71397-5.65e-4 1.3735-0.38169 1.7305-1h3.2695v-2h-3.2715c-0.17478-0.30301-0.42598-0.55488-0.72852-0.73047v-5.8555l4.916 4.916c0.31428-0.20669 0.68609-0.33008 1.084-0.33008 0-0.3979 0.12338-0.76971 0.33008-1.084l-4.916-4.916h5.8574c0.17478 0.30301 0.42598 0.55488 0.72852 0.73047v3.2695h2v-3.2715c0.61771-0.35663 0.99874-1.0152 1-1.7285 0-1.1046-0.89543-2-2-2-0.71397 5.648e-4 -1.3735 0.38169-1.7305 1h-6.541c-0.35663-0.61771-1.0152-0.99874-1.7285-1z" fill="#fc9c9c"/>
+<path d="m12 9c-0.55401 0-1 0.44599-1 1v1h2v2h1c0.55401 0 1-0.44599 1-1v-2c0-0.55401-0.44599-1-1-1zm1 4h-2v-2h-1c-0.55401 0-1 0.44599-1 1v2c0 0.55401 0.44599 1 1 1h2c0.55401 0 1-0.44599 1-1z" fill="#84c2ff"/>
+</g>
+</svg>
diff --git a/editor/icons/icon_c_s_g_polygon.svg b/editor/icons/icon_c_s_g_polygon.svg
new file mode 100644
index 0000000000..71b03cb8e6
--- /dev/null
+++ b/editor/icons/icon_c_s_g_polygon.svg
@@ -0,0 +1,6 @@
+<svg width="16" height="16" version="1.1" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg">
+<g transform="translate(0 -1036.4)">
+<path transform="translate(0 1036.4)" d="m7.9629 1.002c-0.14254 0.00487-0.28238 0.04016-0.41016 0.10352l-6 3c-0.33878 0.16944-0.55276 0.51574-0.55273 0.89453v5.832c-0.105 0.61631 0.37487 1.1768 1 1.168h5v2c2.16e-5 0.67546 0.64487 1.1297 1.2617 0.95898-0.16118-0.28721-0.26172-0.61135-0.26172-0.95898v-2c0-0.72673 0.40794-1.3664 1-1.7168v-1.666l4-2v1.3828h1c0.36397 0 0.70348 0.10774 1 0.2832v-3.2773c6e-6 -0.00195 6e-6 -0.0039094 0-0.0058594 2.6e-5 -0.37879-0.21395-0.72509-0.55273-0.89453l-6-3c-0.15022-0.074574-0.31679-0.11017-0.48438-0.10352zm0.037109 2.1172l3.7637 1.8809-2.7637 1.3809v-1.3809c-5.52e-5 -0.55226-0.44774-0.99994-1-1h-1.7617l1.7617-0.88086zm-5 2.8809h4v4h-4v-4z" color="#000000" color-rendering="auto" dominant-baseline="auto" fill="#fc9c9c" image-rendering="auto" shape-rendering="auto" solid-color="#000000" style="font-feature-settings:normal;font-variant-alternates:normal;font-variant-caps:normal;font-variant-ligatures:normal;font-variant-numeric:normal;font-variant-position:normal;isolation:auto;mix-blend-mode:normal;shape-padding:0;text-decoration-color:#000000;text-decoration-line:none;text-decoration-style:solid;text-indent:0;text-orientation:mixed;text-transform:none;white-space:normal"/>
+<path transform="translate(0 1036.4)" d="m12 9c-0.55401 0-1 0.44599-1 1v1h2v2h1c0.55401 0 1-0.44599 1-1v-2c0-0.55401-0.44599-1-1-1h-2zm1 4h-2v-2h-1c-0.55401 0-1 0.44599-1 1v2c0 0.55401 0.44599 1 1 1h2c0.55401 0 1-0.44599 1-1v-1z" fill="#84c2ff"/>
+</g>
+</svg>
diff --git a/editor/icons/icon_c_s_g_sphere.svg b/editor/icons/icon_c_s_g_sphere.svg
new file mode 100644
index 0000000000..f81b566993
--- /dev/null
+++ b/editor/icons/icon_c_s_g_sphere.svg
@@ -0,0 +1,6 @@
+<svg width="16" height="16" version="1.1" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg">
+<g>
+<path d="m8 1c-3.8541 0-7 3.1459-7 7 0 3.8542 3.1459 7 7 7 0.093042 0 0.18321-0.01004 0.27539-0.013672-0.17055-0.29341-0.27539-0.62792-0.27539-0.98633v-2c0-0.72673 0.40794-1.3664 1-1.7168v-0.33398c0.34074-0.019259 0.67728-0.069097 1.0156-0.10547 0.083091-1.0187 0.94713-1.8438 1.9844-1.8438h2c0.35841 0 0.69292 0.10484 0.98633 0.27539 0.003633-0.092184 0.013672-0.18235 0.013672-0.27539 0-3.8541-3.1459-7-7-7zm-1 2.0977v4.8711c-1.2931-0.071342-2.6061-0.29819-3.9434-0.69141 0.30081-2.0978 1.8852-3.7665 3.9434-4.1797zm2 0c2.0549 0.41253 3.637 2.0767 3.9414 4.1699-1.3046 0.36677-2.6158 0.60259-3.9414 0.6875v-4.8574zm-5.7793 6.2988c1.2733 0.31892 2.5337 0.50215 3.7793 0.5625v2.9414c-1.8291-0.36719-3.266-1.7339-3.7793-3.5039z" fill="#fc9c9c"/>
+<path d="m12 9c-0.55401 0-1 0.44599-1 1v1h2v2h1c0.55401 0 1-0.44599 1-1v-2c0-0.55401-0.44599-1-1-1zm1 4h-2v-2h-1c-0.55401 0-1 0.44599-1 1v2c0 0.55401 0.44599 1 1 1h2c0.55401 0 1-0.44599 1-1z" fill="#84c2ff"/>
+</g>
+</svg>
diff --git a/editor/icons/icon_c_s_g_torus.svg b/editor/icons/icon_c_s_g_torus.svg
new file mode 100644
index 0000000000..3d30aa47b2
--- /dev/null
+++ b/editor/icons/icon_c_s_g_torus.svg
@@ -0,0 +1,6 @@
+<svg width="16" height="16" version="1.1" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg">
+<g transform="translate(0 -1036.4)">
+<path transform="translate(0 1036.4)" d="m8 3c-1.8145 0-3.4691 0.41721-4.7461 1.1621-1.277 0.745-2.2539 1.9082-2.2539 3.3379 0 1.4298 0.9769 2.5949 2.2539 3.3398 1.277 0.7449 2.9316 1.1602 4.7461 1.1602 0-1.0907 0.90931-2 2-2 0-0.080836 0.013744-0.15778 0.023438-0.23633-0.61769 0.14673-1.3008 0.23633-2.0234 0.23633-1.4992 0-2.8437-0.36687-3.7383-0.88867-0.89456-0.5219-1.2617-1.108-1.2617-1.6113 0-0.5032 0.36716-1.0876 1.2617-1.6094 0.89456-0.5219 2.2391-0.89062 3.7383-0.89062s2.8437 0.36872 3.7383 0.89062c0.89456 0.5218 1.2617 1.1062 1.2617 1.6094 0 0.15978-0.053679 0.32822-0.13281 0.5h1.1328c0.32481 0 0.62893 0.088408 0.90234 0.23047 0.057552-0.23582 0.097656-0.47718 0.097656-0.73047 0-1.4297-0.9769-2.5929-2.2539-3.3379-1.277-0.7449-2.9316-1.1621-4.7461-1.1621z" color="#000000" color-rendering="auto" dominant-baseline="auto" fill="#fc9c9c" image-rendering="auto" shape-rendering="auto" solid-color="#000000" style="font-feature-settings:normal;font-variant-alternates:normal;font-variant-caps:normal;font-variant-ligatures:normal;font-variant-numeric:normal;font-variant-position:normal;isolation:auto;mix-blend-mode:normal;shape-padding:0;text-decoration-color:#000000;text-decoration-line:none;text-decoration-style:solid;text-indent:0;text-orientation:mixed;text-transform:none;white-space:normal"/>
+<path transform="translate(0 1036.4)" d="m12 9c-0.55401 0-1 0.44599-1 1v1h2v2h1c0.55401 0 1-0.44599 1-1v-2c0-0.55401-0.44599-1-1-1h-2zm1 4h-2v-2h-1c-0.55401 0-1 0.44599-1 1v2c0 0.55401 0.44599 1 1 1h2c0.55401 0 1-0.44599 1-1v-1z" fill="#84c2ff"/>
+</g>
+</svg>
diff --git a/editor/icons/icon_color_rect.svg b/editor/icons/icon_color_rect.svg
index c0cd07061e..c2d4cf344d 100644
--- a/editor/icons/icon_color_rect.svg
+++ b/editor/icons/icon_color_rect.svg
@@ -1,9 +1,6 @@
<svg width="16" height="16" version="1.1" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg">
<g transform="translate(0 -1036.4)">
-<rect x="1" y="1037.4" width="2" height="14" fill="#a5efac"/>
-<rect x="1" y="1049.4" width="14" height="2" fill="#a5efac"/>
-<rect x="1" y="1037.4" width="14" height="2" fill="#a5efac"/>
-<rect x="13" y="1037.4" width="2" height="14" fill="#a5efac"/>
+<path transform="translate(0 1036.4)" d="m1 1v14h14v-14zm2 2h10v10h-10z" fill="#a5efac"/>
<path d="m12 1048.4h-4.8l4.8-4.8z" fill="#70bfff" fill-rule="evenodd"/>
<path d="m4 1040.4h4.8l-4.8 4.8z" fill="#ff7070" fill-rule="evenodd"/>
<path d="m4 1048.4v-3.2l4.8-4.8h3.2v3.2l-4.8 4.8z" fill="#7aff70" fill-rule="evenodd"/>
diff --git a/editor/icons/icon_editor_position.svg b/editor/icons/icon_editor_position.svg
index 7cbce07fab..7657eb5160 100644
--- a/editor/icons/icon_editor_position.svg
+++ b/editor/icons/icon_editor_position.svg
@@ -1,69 +1,4 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<svg
- xmlns:dc="http://purl.org/dc/elements/1.1/"
- xmlns:cc="http://creativecommons.org/ns#"
- xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
- xmlns:svg="http://www.w3.org/2000/svg"
- xmlns="http://www.w3.org/2000/svg"
- xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
- xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
- width="16"
- height="16"
- version="1.1"
- viewBox="0 0 16 16"
- id="svg919"
- sodipodi:docname="icon_editor_position.svg"
- inkscape:version="0.92.2 5c3e80d, 2017-08-06">
- <metadata
- id="metadata925">
- <rdf:RDF>
- <cc:Work
- rdf:about="">
- <dc:format>image/svg+xml</dc:format>
- <dc:type
- rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
- <dc:title></dc:title>
- </cc:Work>
- </rdf:RDF>
- </metadata>
- <defs
- id="defs923" />
- <sodipodi:namedview
- pagecolor="#ffffff"
- bordercolor="#666666"
- borderopacity="1"
- objecttolerance="10"
- gridtolerance="10"
- guidetolerance="10"
- inkscape:pageopacity="0"
- inkscape:pageshadow="2"
- inkscape:window-width="2550"
- inkscape:window-height="1414"
- id="namedview921"
- showgrid="false"
- inkscape:zoom="64"
- inkscape:cx="13.492036"
- inkscape:cy="5.8518769"
- inkscape:window-x="1370"
- inkscape:window-y="20"
- inkscape:window-maximized="0"
- inkscape:current-layer="svg919"
- inkscape:snap-page="true" />
- <g
- id="g6479">
- <path
- id="path913"
- d="M 6 0 L 6 4.4199219 A 4.2661548 4.0576186 0 0 0 4.2910156 6 L 0 6 L 0 10 L 4.2949219 10 A 4.2661548 4.0576186 0 0 0 6 11.582031 L 6 16 L 10 16 L 10 11.580078 A 4.2661548 4.0576186 0 0 0 11.708984 10 L 16 10 L 16 6 L 11.705078 6 A 4.2661548 4.0576186 0 0 0 10 4.4179688 L 10 0 L 6 0 z "
- style="fill:#ffffff;fill-opacity:0.70588237" />
- <path
- id="path915"
- d="M 7 1 L 7 4.0605469 A 4.2661548 4.0576186 0 0 1 8 3.9414062 A 4.2661548 4.0576186 0 0 1 9 4.0605469 L 9 1 L 7 1 z M 1 7 L 1 9 L 3.8691406 9 A 4.2661548 4.0576186 0 0 1 3.734375 8 A 4.2661548 4.0576186 0 0 1 3.8710938 7 L 1 7 z M 12.130859 7 A 4.2661548 4.0576186 0 0 1 12.265625 8 A 4.2661548 4.0576186 0 0 1 12.128906 9 L 15 9 L 15 7 L 12.130859 7 z M 7 11.939453 L 7 15 L 9 15 L 9 11.939453 A 4.2661548 4.0576186 0 0 1 8 12.058594 A 4.2661548 4.0576186 0 0 1 7 11.939453 z "
- style="fill:#ff8484;stroke:none;fill-opacity:1" />
- <circle
- id="circle1517"
- r="2.9201488"
- cy="8"
- cx="8"
- style="fill:#ff8484;fill-opacity:1;stroke-width:0.97338283" />
- </g>
+<svg width="16" height="16" version="1.1" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg">
+<path d="m6 0v4.4199a4.2662 4.0576 0 0 0 -1.709 1.5801h-4.291v4h4.2949a4.2662 4.0576 0 0 0 1.7051 1.582v4.418h4v-4.4199a4.2662 4.0576 0 0 0 1.709 -1.5801h4.291v-4h-4.2949a4.2662 4.0576 0 0 0 -1.7051 -1.582v-4.418z" fill="#fff" fill-opacity=".70588"/>
+<path d="m7 1v3.0605a4.2662 4.0576 0 0 1 1 -0.11914 4.2662 4.0576 0 0 1 1 0.11914v-3.0605h-2zm1 4.0801a2.9201 2.9201 0 0 0 -2.9199 2.9199 2.9201 2.9201 0 0 0 2.9199 2.9199 2.9201 2.9201 0 0 0 2.9199 -2.9199 2.9201 2.9201 0 0 0 -2.9199 -2.9199zm-7 1.9199v2h2.8691a4.2662 4.0576 0 0 1 -0.13477 -1 4.2662 4.0576 0 0 1 0.13672 -1h-2.8711zm11.131 0a4.2662 4.0576 0 0 1 0.13477 1 4.2662 4.0576 0 0 1 -0.13672 1h2.8711v-2h-2.8691zm-5.1309 4.9395v3.0605h2v-3.0605a4.2662 4.0576 0 0 1 -1 0.11914 4.2662 4.0576 0 0 1 -1 -0.11914z" fill="#ff8484"/>
</svg>
diff --git a/editor/icons/icon_editor_position_previous.svg b/editor/icons/icon_editor_position_previous.svg
index d9eb7d7ce2..180156e13a 100644
--- a/editor/icons/icon_editor_position_previous.svg
+++ b/editor/icons/icon_editor_position_previous.svg
@@ -1,62 +1,3 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<svg
- xmlns:dc="http://purl.org/dc/elements/1.1/"
- xmlns:cc="http://creativecommons.org/ns#"
- xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
- xmlns:svg="http://www.w3.org/2000/svg"
- xmlns="http://www.w3.org/2000/svg"
- xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
- xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
- width="16"
- height="16"
- version="1.1"
- viewBox="0 0 16 16"
- id="svg919"
- sodipodi:docname="icon_editor_position_previous.svg"
- inkscape:version="0.92.2 5c3e80d, 2017-08-06">
- <metadata
- id="metadata925">
- <rdf:RDF>
- <cc:Work
- rdf:about="">
- <dc:format>image/svg+xml</dc:format>
- <dc:type
- rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
- <dc:title />
- </cc:Work>
- </rdf:RDF>
- </metadata>
- <defs
- id="defs923" />
- <sodipodi:namedview
- pagecolor="#ffffff"
- bordercolor="#666666"
- borderopacity="1"
- objecttolerance="10"
- gridtolerance="10"
- guidetolerance="10"
- inkscape:pageopacity="0"
- inkscape:pageshadow="2"
- inkscape:window-width="1356"
- inkscape:window-height="742"
- id="namedview921"
- showgrid="false"
- inkscape:zoom="11.313709"
- inkscape:cx="14.523034"
- inkscape:cy="-5.7323703"
- inkscape:window-x="4"
- inkscape:window-y="20"
- inkscape:window-maximized="0"
- inkscape:current-layer="svg919"
- inkscape:snap-page="true" />
- <path
- style="fill:#6699ff;stroke:none;fill-opacity:0.69803923"
- d="M 7 1 L 7 4.0605469 A 4.2661548 4.0576186 0 0 1 8 3.9414062 A 4.2661548 4.0576186 0 0 1 9 4.0605469 L 9 1 L 7 1 z M 1 7 L 1 9 L 3.8691406 9 A 4.2661548 4.0576186 0 0 1 3.734375 8 A 4.2661548 4.0576186 0 0 1 3.8710938 7 L 1 7 z M 12.130859 7 A 4.2661548 4.0576186 0 0 1 12.265625 8 A 4.2661548 4.0576186 0 0 1 12.128906 9 L 15 9 L 15 7 L 12.130859 7 z M 7 11.939453 L 7 15 L 9 15 L 9 11.939453 A 4.2661548 4.0576186 0 0 1 8 12.058594 A 4.2661548 4.0576186 0 0 1 7 11.939453 z "
- id="path915" />
- <circle
- style="fill:#6699ff;fill-opacity:0.69803923;stroke-width:0.97338283"
- cx="8"
- cy="8"
- r="2.9201488"
- id="circle1517" />
+<svg width="16" height="16" version="1.1" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg">
+<path d="m7 1v3.0605a4.2662 4.0576 0 0 1 1 -0.11914 4.2662 4.0576 0 0 1 1 0.11914v-3.0605h-2zm1 4.0801a2.9201 2.9201 0 0 0 -2.9199 2.9199 2.9201 2.9201 0 0 0 2.9199 2.9199 2.9201 2.9201 0 0 0 2.9199 -2.9199 2.9201 2.9201 0 0 0 -2.9199 -2.9199zm-7 1.9199v2h2.8691a4.2662 4.0576 0 0 1 -0.13477 -1 4.2662 4.0576 0 0 1 0.13672 -1h-2.8711zm11.131 0a4.2662 4.0576 0 0 1 0.13477 1 4.2662 4.0576 0 0 1 -0.13672 1h2.8711v-2h-2.8691zm-5.1309 4.9395v3.0605h2v-3.0605a4.2662 4.0576 0 0 1 -1 0.11914 4.2662 4.0576 0 0 1 -1 -0.11914z" fill="#69f" fill-opacity=".69804"/>
</svg>
diff --git a/editor/icons/icon_editor_position_unselected.svg b/editor/icons/icon_editor_position_unselected.svg
index 8f32c89f16..3c7d479b88 100644
--- a/editor/icons/icon_editor_position_unselected.svg
+++ b/editor/icons/icon_editor_position_unselected.svg
@@ -1,66 +1,4 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<svg
- xmlns:dc="http://purl.org/dc/elements/1.1/"
- xmlns:cc="http://creativecommons.org/ns#"
- xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
- xmlns:svg="http://www.w3.org/2000/svg"
- xmlns="http://www.w3.org/2000/svg"
- xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
- xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
- width="16"
- height="16"
- version="1.1"
- viewBox="0 0 16 16"
- id="svg919"
- sodipodi:docname="icon_editor_position_unselected.svg"
- inkscape:version="0.92.2 5c3e80d, 2017-08-06">
- <metadata
- id="metadata925">
- <rdf:RDF>
- <cc:Work
- rdf:about="">
- <dc:format>image/svg+xml</dc:format>
- <dc:type
- rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
- <dc:title></dc:title>
- </cc:Work>
- </rdf:RDF>
- </metadata>
- <defs
- id="defs923" />
- <sodipodi:namedview
- pagecolor="#ffffff"
- bordercolor="#666666"
- borderopacity="1"
- objecttolerance="10"
- gridtolerance="10"
- guidetolerance="10"
- inkscape:pageopacity="0"
- inkscape:pageshadow="2"
- inkscape:window-width="2550"
- inkscape:window-height="1414"
- id="namedview921"
- showgrid="false"
- inkscape:zoom="64"
- inkscape:cx="13.492036"
- inkscape:cy="8.3518769"
- inkscape:window-x="1370"
- inkscape:window-y="20"
- inkscape:window-maximized="0"
- inkscape:current-layer="svg919"
- inkscape:snap-page="true" />
- <path
- style="fill:#000000;fill-opacity:0.41077441"
- d="M 6 0 L 6 4.4199219 A 4.2661548 4.0576186 0 0 0 4.2910156 6 L 0 6 L 0 10 L 4.2949219 10 A 4.2661548 4.0576186 0 0 0 6 11.582031 L 6 16 L 10 16 L 10 11.580078 A 4.2661548 4.0576186 0 0 0 11.708984 10 L 16 10 L 16 6 L 11.705078 6 A 4.2661548 4.0576186 0 0 0 10 4.4179688 L 10 0 L 6 0 z "
- id="path913" />
- <path
- style="fill:#d9d9d9;stroke:none;fill-opacity:1"
- d="M 7 1 L 7 4.0605469 A 4.2661548 4.0576186 0 0 1 8 3.9414062 A 4.2661548 4.0576186 0 0 1 9 4.0605469 L 9 1 L 7 1 z M 1 7 L 1 9 L 3.8691406 9 A 4.2661548 4.0576186 0 0 1 3.734375 8 A 4.2661548 4.0576186 0 0 1 3.8710938 7 L 1 7 z M 12.130859 7 A 4.2661548 4.0576186 0 0 1 12.265625 8 A 4.2661548 4.0576186 0 0 1 12.128906 9 L 15 9 L 15 7 L 12.130859 7 z M 7 11.939453 L 7 15 L 9 15 L 9 11.939453 A 4.2661548 4.0576186 0 0 1 8 12.058594 A 4.2661548 4.0576186 0 0 1 7 11.939453 z "
- id="path915" />
- <circle
- style="fill:#d9d9d9;fill-opacity:1;stroke-width:0.97338283"
- cx="8"
- cy="8"
- r="2.9201488"
- id="circle1517" />
+<svg width="16" height="16" version="1.1" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg">
+<path d="m6 0v4.4199a4.2662 4.0576 0 0 0 -1.709 1.5801h-4.291v4h4.2949a4.2662 4.0576 0 0 0 1.7051 1.582v4.418h4v-4.4199a4.2662 4.0576 0 0 0 1.709 -1.5801h4.291v-4h-4.2949a4.2662 4.0576 0 0 0 -1.7051 -1.582v-4.418h-4z" fill-opacity=".41077"/>
+<path d="m7 1v3.0605a4.2662 4.0576 0 0 1 1 -0.11914 4.2662 4.0576 0 0 1 1 0.11914v-3.0605h-2zm1 4.0801a2.9201 2.9201 0 0 0 -2.9199 2.9199 2.9201 2.9201 0 0 0 2.9199 2.9199 2.9201 2.9201 0 0 0 2.9199 -2.9199 2.9201 2.9201 0 0 0 -2.9199 -2.9199zm-7 1.9199v2h2.8691a4.2662 4.0576 0 0 1 -0.13477 -1 4.2662 4.0576 0 0 1 0.13672 -1h-2.8711zm11.131 0a4.2662 4.0576 0 0 1 0.13477 1 4.2662 4.0576 0 0 1 -0.13672 1h2.8711v-2h-2.8691zm-5.1309 4.9395v3.0605h2v-3.0605a4.2662 4.0576 0 0 1 -1 0.11914 4.2662 4.0576 0 0 1 -1 -0.11914z" fill="#d9d9d9"/>
</svg>
diff --git a/editor/icons/icon_insert_after.svg b/editor/icons/icon_insert_after.svg
new file mode 100644
index 0000000000..4696a2fc22
--- /dev/null
+++ b/editor/icons/icon_insert_after.svg
@@ -0,0 +1,7 @@
+<svg width="16" height="16" version="1.1" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg">
+<circle cx="4" cy="12" r="2" fill="none"/>
+<path d="m11.99 0.99023a1.0001 1.0001 0 0 0 -0.69726 1.7168l0.29297 0.29297h-2.5859v2h2.5859l-0.29297 0.29297a1.0001 1.0001 0 1 0 1.4141 1.4141l2-2a1.0001 1.0001 0 0 0 0 -1.4141l-2-2a1.0001 1.0001 0 0 0 -0.7168 -0.30273zm-8.9902 0.0097656c-1.108 0-2 0.892-2 2v2c0 1.108 0.892 2 2 2h2c1.108 0 2-0.892 2-2v-2c0-1.108-0.892-2-2-2h-2z" fill="#e0e0e0"/>
+<g transform="translate(0 -1036.4)">
+<path transform="translate(0 1036.4)" d="m11 9v2h-2v2h2v2h2v-2h2v-2h-2v-2z" fill="#84ffb1"/>
+</g>
+</svg>
diff --git a/editor/icons/icon_insert_before.svg b/editor/icons/icon_insert_before.svg
new file mode 100644
index 0000000000..eb85144214
--- /dev/null
+++ b/editor/icons/icon_insert_before.svg
@@ -0,0 +1,7 @@
+<svg width="16" height="16" version="1.1" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg">
+<circle cx="4" cy="12" r="2" fill="none"/>
+<path d="m4.0096 0.99023a1.0001 1.0001 0 0 1 0.69726 1.7168l-0.29297 0.29297h2.5859v2h-2.5859l0.29297 0.29297a1.0001 1.0001 0 1 1 -1.4141 1.4141l-2-2a1.0001 1.0001 0 0 1 0 -1.4141l2-2a1.0001 1.0001 0 0 1 0.7168 -0.30273zm8.9902 0.0097656c1.108 0 2 0.892 2 2v2c0 1.108-0.892 2-2 2h-2c-1.108 0-2-0.892-2-2v-2c0-1.108 0.892-2 2-2z" fill="#e0e0e0"/>
+<g transform="translate(0 -1036.4)">
+<path transform="translate(0 1036.4)" d="m11 9v2h-2v2h2v2h2v-2h2v-2h-2v-2z" fill="#84ffb1"/>
+</g>
+</svg>
diff --git a/editor/icons/icon_key_hover.svg b/editor/icons/icon_key_hover.svg
new file mode 100644
index 0000000000..4a3fab4754
--- /dev/null
+++ b/editor/icons/icon_key_hover.svg
@@ -0,0 +1,5 @@
+<svg width="8" height="8" version="1.1" viewBox="0 0 8 8" xmlns="http://www.w3.org/2000/svg">
+<g transform="translate(0 -1044.4)">
+<rect transform="rotate(-45)" x="-741.53" y="741.08" width="6.1027" height="6.1027" ry=".76286" fill="#fff"/>
+</g>
+</svg>
diff --git a/editor/icons/icon_key_selected.svg b/editor/icons/icon_key_selected.svg
new file mode 100644
index 0000000000..c73d31981d
--- /dev/null
+++ b/editor/icons/icon_key_selected.svg
@@ -0,0 +1,5 @@
+<svg width="8" height="8" version="1.1" viewBox="0 0 8 8" xmlns="http://www.w3.org/2000/svg">
+<g transform="translate(0 -1044.4)">
+<rect transform="rotate(-45)" x="-741.53" y="741.08" width="6.1027" height="6.1027" ry=".76286" fill="#84c2ff"/>
+</g>
+</svg>
diff --git a/editor/icons/icon_move_down.svg b/editor/icons/icon_move_down.svg
index 466fa10205..70c5abf9e8 100644
--- a/editor/icons/icon_move_down.svg
+++ b/editor/icons/icon_move_down.svg
@@ -1,5 +1,3 @@
<svg width="16" height="16" version="1.1" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg">
-<g transform="translate(0 -1036.4)">
-<path d="m7.9964 1051.4a1.0002 1.0001 0 0 1 -0.77738 -0.377l-4.0002-5a1.0001 1 0 0 1 0.15626 -1.4043 1.0001 1 0 0 1 1.4063 0.1563l2.2189 2.7734v-5.1484a1.0001 1 0 0 1 1.0001 -1 1.0001 1 0 0 1 1.0001 1v5.1484l2.2189-2.7734a1.0001 1 0 0 1 1.4063 -0.1563 1.0001 1 0 0 1 0.15626 1.4043l-4.0002 5a1.0002 1.0001 0 0 1 -0.7852 0.377zm0.00391-12a1.0001 1 0 0 1 -1.0001 -1 1.0001 1 0 0 1 1.0001 -1 1.0001 1 0 0 1 1.0001 1 1.0001 1 0 0 1 -1.0001 1z" color="#000000" color-rendering="auto" dominant-baseline="auto" fill="#e0e0e0" fill-opacity=".99608" image-rendering="auto" shape-rendering="auto" solid-color="#000000" style="font-feature-settings:normal;font-variant-alternates:normal;font-variant-caps:normal;font-variant-east-asian:normal;font-variant-ligatures:normal;font-variant-numeric:normal;font-variant-position:normal;isolation:auto;mix-blend-mode:normal;shape-padding:0;text-decoration-color:#000000;text-decoration-line:none;text-decoration-style:solid;text-indent:0;text-orientation:mixed;text-transform:none;white-space:normal"/>
-</g>
+<path d="m6 1a1.0001 1.0001 0 1 0 0 2h4a1.0001 1.0001 0 1 0 0 -2zm2 4c-0.55231 0-1 0.4477-1 1v5.1484l-2.2188-2.7734c-0.34504-0.4317-0.97482-0.50165-1.4062-0.15625-0.4305 0.3449-0.5004 0.9732-0.15625 1.4043l4 5c0.18868 0.2369 0.4745 0.37695 0.77734 0.37695 0.30559 9e-4 0.59477-0.13795 0.78516-0.37695l4-5c0.34415-0.4311 0.27424-1.0594-0.15625-1.4043-0.43143-0.3454-1.0612-0.27545-1.4062 0.15625l-2.2188 2.7734v-5.1484c0-0.5523-0.44769-1-1-1z" color="#000000" color-rendering="auto" dominant-baseline="auto" fill="#e0e0e0" fill-opacity=".99608" image-rendering="auto" shape-rendering="auto" solid-color="#000000" style="font-feature-settings:normal;font-variant-alternates:normal;font-variant-caps:normal;font-variant-ligatures:normal;font-variant-numeric:normal;font-variant-position:normal;isolation:auto;mix-blend-mode:normal;shape-padding:0;text-decoration-color:#000000;text-decoration-line:none;text-decoration-style:solid;text-indent:0;text-orientation:mixed;text-transform:none;white-space:normal"/>
</svg>
diff --git a/editor/icons/icon_move_left.svg b/editor/icons/icon_move_left.svg
new file mode 100644
index 0000000000..bab817bfdf
--- /dev/null
+++ b/editor/icons/icon_move_left.svg
@@ -0,0 +1,3 @@
+<svg width="16" height="16" version="1.1" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg">
+<path d="m15 10a1.0001 1.0001 0 1 1 -2 0v-4a1.0001 1.0001 0 1 1 2 0zm-4-2c0 0.55231-0.4477 1-1 1h-5.1484l2.7734 2.2188c0.4317 0.34504 0.50165 0.97482 0.15625 1.4062-0.3449 0.4305-0.9732 0.5004-1.4043 0.15625l-5-4c-0.2369-0.18868-0.37695-0.4745-0.37695-0.77734-9e-4 -0.30559 0.13795-0.59477 0.37695-0.78516l5-4c0.4311-0.34415 1.0594-0.27424 1.4043 0.15625 0.3454 0.43143 0.27545 1.0612-0.15625 1.4062l-2.7734 2.2188h5.1484c0.5523 0 1 0.44769 1 1z" color="#000000" color-rendering="auto" dominant-baseline="auto" fill="#e0e0e0" fill-opacity=".99608" image-rendering="auto" shape-rendering="auto" solid-color="#000000" style="font-feature-settings:normal;font-variant-alternates:normal;font-variant-caps:normal;font-variant-ligatures:normal;font-variant-numeric:normal;font-variant-position:normal;isolation:auto;mix-blend-mode:normal;shape-padding:0;text-decoration-color:#000000;text-decoration-line:none;text-decoration-style:solid;text-indent:0;text-orientation:mixed;text-transform:none;white-space:normal"/>
+</svg>
diff --git a/editor/icons/icon_move_right.svg b/editor/icons/icon_move_right.svg
new file mode 100644
index 0000000000..7721633de5
--- /dev/null
+++ b/editor/icons/icon_move_right.svg
@@ -0,0 +1,3 @@
+<svg width="16" height="16" version="1.1" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg">
+<path d="m1 10a1.0001 1.0001 0 1 0 2 0v-4a1.0001 1.0001 0 1 0 -2 0zm4-2c0 0.55231 0.4477 1 1 1h5.1484l-2.7734 2.2188c-0.4317 0.34504-0.50165 0.97482-0.15625 1.4062 0.3449 0.4305 0.9732 0.5004 1.4043 0.15625l5-4c0.2369-0.18868 0.37695-0.4745 0.37695-0.77734 9e-4 -0.30559-0.13795-0.59477-0.37695-0.78516l-5-4c-0.4311-0.34415-1.0594-0.27424-1.4043 0.15625-0.3454 0.43143-0.27545 1.0612 0.15625 1.4062l2.7734 2.2188h-5.1484c-0.5523 0-1 0.44769-1 1z" color="#000000" color-rendering="auto" dominant-baseline="auto" fill="#e0e0e0" fill-opacity=".99608" image-rendering="auto" shape-rendering="auto" solid-color="#000000" style="font-feature-settings:normal;font-variant-alternates:normal;font-variant-caps:normal;font-variant-ligatures:normal;font-variant-numeric:normal;font-variant-position:normal;isolation:auto;mix-blend-mode:normal;shape-padding:0;text-decoration-color:#000000;text-decoration-line:none;text-decoration-style:solid;text-indent:0;text-orientation:mixed;text-transform:none;white-space:normal"/>
+</svg>
diff --git a/editor/icons/icon_move_up.svg b/editor/icons/icon_move_up.svg
index 6e148216d2..06bb26fad3 100644
--- a/editor/icons/icon_move_up.svg
+++ b/editor/icons/icon_move_up.svg
@@ -1,5 +1,3 @@
<svg width="16" height="16" version="1.1" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg">
-<g transform="translate(0 -1036.4)">
-<path d="m7.9964 1037.4a1.0002 1.0001 0 0 0 -0.77739 0.377l-4.0002 5a1.0001 1 0 0 0 0.15626 1.4043 1.0001 1 0 0 0 1.4063 -0.1563l2.2189-2.7734v5.1484a1.0001 1 0 0 0 1.0001 1 1.0001 1 0 0 0 1.0001 -1v-5.1484l2.2189 2.7734a1.0001 1 0 0 0 1.4063 0.1563 1.0001 1 0 0 0 0.15626 -1.4043l-4.0002-5a1.0002 1.0001 0 0 0 -0.7852 -0.377zm0.00391 12a1.0001 1 0 0 0 -1.0001 1 1.0001 1 0 0 0 1.0001 1 1.0001 1 0 0 0 1.0001 -1 1.0001 1 0 0 0 -1.0001 -1z" color="#000000" color-rendering="auto" dominant-baseline="auto" fill="#e0e0e0" fill-opacity=".99608" image-rendering="auto" shape-rendering="auto" solid-color="#000000" style="font-feature-settings:normal;font-variant-alternates:normal;font-variant-caps:normal;font-variant-east-asian:normal;font-variant-ligatures:normal;font-variant-numeric:normal;font-variant-position:normal;isolation:auto;mix-blend-mode:normal;shape-padding:0;text-decoration-color:#000000;text-decoration-line:none;text-decoration-style:solid;text-indent:0;text-orientation:mixed;text-transform:none;white-space:normal"/>
-</g>
+<path d="m6 15a1.0001 1.0001 0 1 1 0 -2h4a1.0001 1.0001 0 1 1 0 2zm2-4c-0.55231 0-1-0.4477-1-1v-5.1484l-2.2188 2.7734c-0.34504 0.4317-0.97482 0.50165-1.4062 0.15625-0.4305-0.3449-0.5004-0.9732-0.15625-1.4043l4-5c0.18868-0.2369 0.4745-0.37695 0.77734-0.37695 0.30559-9e-4 0.59477 0.13795 0.78516 0.37695l4 5c0.34415 0.4311 0.27424 1.0594-0.15625 1.4043-0.43143 0.3454-1.0612 0.27545-1.4062-0.15625l-2.2188-2.7734v5.1484c0 0.5523-0.44769 1-1 1z" color="#000000" color-rendering="auto" dominant-baseline="auto" fill="#e0e0e0" fill-opacity=".99608" image-rendering="auto" shape-rendering="auto" solid-color="#000000" style="font-feature-settings:normal;font-variant-alternates:normal;font-variant-caps:normal;font-variant-ligatures:normal;font-variant-numeric:normal;font-variant-position:normal;isolation:auto;mix-blend-mode:normal;shape-padding:0;text-decoration-color:#000000;text-decoration-line:none;text-decoration-style:solid;text-indent:0;text-orientation:mixed;text-transform:none;white-space:normal"/>
</svg>
diff --git a/editor/icons/icon_paint_vertex.svg b/editor/icons/icon_paint_vertex.svg
new file mode 100644
index 0000000000..b53e005dae
--- /dev/null
+++ b/editor/icons/icon_paint_vertex.svg
@@ -0,0 +1,58 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ width="16"
+ height="16"
+ version="1.1"
+ viewBox="0 0 16 16"
+ id="svg4"
+ sodipodi:docname="icon_paint_vertex.svg"
+ inkscape:version="0.92.2 (5c3e80d, 2017-08-06)">
+ <metadata
+ id="metadata10">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ <dc:title></dc:title>
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <defs
+ id="defs8" />
+ <sodipodi:namedview
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1"
+ objecttolerance="10"
+ gridtolerance="10"
+ guidetolerance="10"
+ inkscape:pageopacity="0"
+ inkscape:pageshadow="2"
+ inkscape:window-width="3066"
+ inkscape:window-height="1689"
+ id="namedview6"
+ showgrid="false"
+ inkscape:zoom="14.75"
+ inkscape:cx="8"
+ inkscape:cy="8"
+ inkscape:window-x="134"
+ inkscape:window-y="55"
+ inkscape:window-maximized="1"
+ inkscape:current-layer="svg4" />
+ <ellipse
+ style="fill:#ffffff"
+ id="path12"
+ cx="8.3728809"
+ cy="8.1694918"
+ rx="6.6779661"
+ ry="6.0677967" />
+</svg>
diff --git a/editor/icons/icon_panel.svg b/editor/icons/icon_panel.svg
index aebf885e7c..7bd3db7c09 100644
--- a/editor/icons/icon_panel.svg
+++ b/editor/icons/icon_panel.svg
@@ -1,5 +1,3 @@
<svg width="16" height="16" version="1.1" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg">
-<g transform="translate(0 -1036.4)">
-<path transform="translate(0 1036.4)" d="m3 1c-1.1046 0-2 0.89543-2 2v10c0 1.1046 0.89543 2 2 2h10c1.1046 0 2-0.89543 2-2v-10c0-1.1046-0.89543-2-2-2z" fill="#a5efac"/>
-</g>
+<path d="m3 1c-1.1046 0-2 0.89543-2 2v10c0 1.1046 0.89543 2 2 2h10c1.1046 0 2-0.89543 2-2v-10c0-1.1046-0.89543-2-2-2z" fill="#a5efac"/>
</svg>
diff --git a/editor/icons/icon_panel_container.svg b/editor/icons/icon_panel_container.svg
index a52493b665..df8a2c0a0e 100644
--- a/editor/icons/icon_panel_container.svg
+++ b/editor/icons/icon_panel_container.svg
@@ -1,5 +1,3 @@
<svg width="16" height="16" version="1.1" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg">
-<g transform="translate(0 -1036.4)">
-<path transform="translate(0 1036.4)" d="m3 1c-1.1046 0-2 0.89543-2 2v10c0 1.1046 0.89543 2 2 2h10c1.1046 0 2-0.89543 2-2v-10c0-1.1046-0.89543-2-2-2zm0 2h10v10h-10z" fill="#a5efac"/>
-</g>
+<path d="m3 1c-1.1046 0-2 0.89543-2 2v10c0 1.1046 0.89543 2 2 2h10c1.1046 0 2-0.89543 2-2v-10c0-1.1046-0.89543-2-2-2zm0 2h10v10h-10z" fill="#a5efac"/>
</svg>
diff --git a/editor/icons/icon_translation.svg b/editor/icons/icon_translation.svg
index 81abe5070e..fa6d7e1ff2 100644
--- a/editor/icons/icon_translation.svg
+++ b/editor/icons/icon_translation.svg
@@ -1,5 +1,5 @@
<svg width="16" height="16" version="1.1" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg">
<g transform="translate(0 -1036.4)">
-<path transform="translate(0 1036.4)" d="m2 1v14h10a2 2 0 0 0 2 -2v-10a2 2 0 0 0 -2 -2v5 2l-2-2-2 2v-2-5h-6z" fill="#e0e0e0"/>
+<path transform="translate(0 1036.4)" d="m4 1c-1.645 0-3 1.355-3 3s1.355 3 3 3c0.46079 0 0.89328-0.11549 1.2852-0.30469 0.18147 0.1867 0.43274 0.30469 0.71484 0.30469 0.554 0 1-0.446 1-1v-2-2c0-0.554-0.446-1-1-1-0.28152 0-0.53345 0.11683-0.71484 0.30273-0.39187-0.1892-0.82436-0.30273-1.2852-0.30273zm0 2c0.56412 0 1 0.4359 1 1s-0.43588 1-1 1-1-0.4359-1-1 0.43588-1 1-1zm6.8867 3.5293l-1.7891 0.89453 0.28906 0.57617h-2.3867v2h0.82031c0.13264 0.9292 0.4994 1.8938 1.1992 2.7305-0.61509 0.163-1.3569 0.26523-2.2656 0.26953l0.0097657 2c1.6777-0.01 3.0414-0.31328 4.1113-0.83398 1.07 0.5208 2.4336 0.82608 4.1113 0.83398l0.009766-2c-0.90873 0-1.6505-0.10653-2.2656-0.26953 0.7-0.8367 1.068-1.8013 1.2012-2.7305h1.0684v-2h-3.3789l-0.73438-1.4707zm-1.0234 3.4707h2.0234c-0.12578 0.5801-0.37537 1.147-0.83594 1.623-0.05313 0.055-0.11651 0.10676-0.17578 0.16016-0.05927-0.053-0.12265-0.10516-0.17578-0.16016-0.46056-0.476-0.71015-1.0429-0.83594-1.623z" color="#000000" color-rendering="auto" dominant-baseline="auto" fill="#e0e0e0" image-rendering="auto" shape-rendering="auto" solid-color="#000000" style="font-feature-settings:normal;font-variant-alternates:normal;font-variant-caps:normal;font-variant-ligatures:normal;font-variant-numeric:normal;font-variant-position:normal;isolation:auto;mix-blend-mode:normal;shape-padding:0;text-decoration-color:#000000;text-decoration-line:none;text-decoration-style:solid;text-indent:0;text-orientation:mixed;text-transform:none;white-space:normal"/>
</g>
</svg>
diff --git a/editor/icons/icon_unpaint_vertex.svg b/editor/icons/icon_unpaint_vertex.svg
new file mode 100644
index 0000000000..a4633ee80b
--- /dev/null
+++ b/editor/icons/icon_unpaint_vertex.svg
@@ -0,0 +1,58 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ width="16"
+ height="16"
+ version="1.1"
+ viewBox="0 0 16 16"
+ id="svg4"
+ sodipodi:docname="icon_unpaint_vertex.svg"
+ inkscape:version="0.92.2 (5c3e80d, 2017-08-06)">
+ <metadata
+ id="metadata10">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ <dc:title></dc:title>
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <defs
+ id="defs8" />
+ <sodipodi:namedview
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1"
+ objecttolerance="10"
+ gridtolerance="10"
+ guidetolerance="10"
+ inkscape:pageopacity="0"
+ inkscape:pageshadow="2"
+ inkscape:window-width="3066"
+ inkscape:window-height="1689"
+ id="namedview6"
+ showgrid="false"
+ inkscape:zoom="14.75"
+ inkscape:cx="8"
+ inkscape:cy="8"
+ inkscape:window-x="134"
+ inkscape:window-y="55"
+ inkscape:window-maximized="1"
+ inkscape:current-layer="svg4" />
+ <ellipse
+ style="fill:#000000"
+ id="path12"
+ cx="8.3728809"
+ cy="8.1694918"
+ rx="6.6779661"
+ ry="6.0677967" />
+</svg>
diff --git a/editor/import/resource_importer_texture.cpp b/editor/import/resource_importer_texture.cpp
index 8119b84b7e..beaa8d9600 100644
--- a/editor/import/resource_importer_texture.cpp
+++ b/editor/import/resource_importer_texture.cpp
@@ -295,7 +295,7 @@ void ResourceImporterTexture::_save_stex(const Ref<Image> &p_image, const String
case COMPRESS_VIDEO_RAM: {
Ref<Image> image = p_image->duplicate();
- image->generate_mipmaps();
+ image->generate_mipmaps(p_force_normal);
if (p_force_rgbe && image->get_format() >= Image::FORMAT_R8 && image->get_format() <= Image::FORMAT_RGBE9995) {
image->convert(Image::FORMAT_RGBE9995);
diff --git a/editor/plugins/animation_player_editor_plugin.cpp b/editor/plugins/animation_player_editor_plugin.cpp
index 220003eb73..b387972558 100644
--- a/editor/plugins/animation_player_editor_plugin.cpp
+++ b/editor/plugins/animation_player_editor_plugin.cpp
@@ -459,6 +459,12 @@ void AnimationPlayerEditor::_animation_remove_confirmed() {
Ref<Animation> anim = player->get_animation(current);
undo_redo->create_action(TTR("Remove Animation"));
+ if (player->get_autoplay() == current) {
+ undo_redo->add_do_method(player, "set_autoplay", "");
+ undo_redo->add_undo_method(player, "set_autoplay", current);
+ // Avoid having the autoplay icon linger around if there is only one animation in the player
+ undo_redo->add_do_method(this, "_animation_player_changed", player);
+ }
undo_redo->add_do_method(player, "remove_animation", current);
undo_redo->add_undo_method(player, "add_animation", current, anim);
undo_redo->add_do_method(this, "_animation_player_changed", player);
@@ -822,6 +828,7 @@ void AnimationPlayerEditor::_update_player() {
save_anim->set_disabled(animlist.size() == 0);
tool_anim->set_disabled(player == NULL);
onion_skinning->set_disabled(player == NULL);
+ pin->set_disabled(player == NULL);
int active_idx = -1;
for (List<StringName>::Element *E = animlist.front(); E; E = E->next()) {
diff --git a/editor/plugins/asset_library_editor_plugin.cpp b/editor/plugins/asset_library_editor_plugin.cpp
index 23cdde299c..05833704d1 100644
--- a/editor/plugins/asset_library_editor_plugin.cpp
+++ b/editor/plugins/asset_library_editor_plugin.cpp
@@ -639,7 +639,7 @@ const char *EditorAssetLibrary::support_key[SUPPORT_MAX] = {
void EditorAssetLibrary::_select_author(int p_id) {
- //opemn author window
+ // Open author window
}
void EditorAssetLibrary::_select_category(int p_id) {
@@ -659,16 +659,6 @@ void EditorAssetLibrary::_select_category(int p_id) {
void EditorAssetLibrary::_select_asset(int p_id) {
_api_request("asset/" + itos(p_id), REQUESTING_ASSET);
-
- /*
- if (description) {
- memdelete(description);
- }
-
-
- description = memnew( EditorAssetLibraryItemDescription );
- add_child(description);
- description->popup_centered_minsize();*/
}
void EditorAssetLibrary::_image_update(bool use_cache, bool final, const PoolByteArray &p_data, int p_queue_id) {
@@ -774,7 +764,7 @@ void EditorAssetLibrary::_image_request_completed(int p_status, int p_code, cons
_image_update(p_code == HTTPClient::RESPONSE_NOT_MODIFIED, true, p_data, p_queue_id);
} else {
- WARN_PRINTS("Error getting PNG file for asset id " + itos(image_queue[p_queue_id].asset_id));
+ WARN_PRINTS("Error getting PNG file from URL: " + image_queue[p_queue_id].image_url);
Object *obj = ObjectDB::get_instance(image_queue[p_queue_id].target);
if (obj) {
obj->call("set_image", image_queue[p_queue_id].image_type, image_queue[p_queue_id].image_index, get_icon("ErrorSign", "EditorIcons"));
diff --git a/editor/plugins/asset_library_editor_plugin.h b/editor/plugins/asset_library_editor_plugin.h
index 89b79d7cfb..69a65dd3dc 100644
--- a/editor/plugins/asset_library_editor_plugin.h
+++ b/editor/plugins/asset_library_editor_plugin.h
@@ -241,7 +241,6 @@ class EditorAssetLibrary : public PanelContainer {
bool active;
int queue_id;
- int asset_id;
ImageType image_type;
int image_index;
String image_url;
diff --git a/editor/plugins/canvas_item_editor_plugin.cpp b/editor/plugins/canvas_item_editor_plugin.cpp
index cd8723930c..ff38e12250 100644
--- a/editor/plugins/canvas_item_editor_plugin.cpp
+++ b/editor/plugins/canvas_item_editor_plugin.cpp
@@ -457,7 +457,7 @@ Rect2 CanvasItemEditor::_get_encompassing_rect(const Node *p_node) {
return rect;
}
-void CanvasItemEditor::_find_canvas_items_at_pos(const Point2 &p_pos, Node *p_node, Vector<_SelectResult> &r_items, int limit, const Transform2D &p_parent_xform, const Transform2D &p_canvas_xform) {
+void CanvasItemEditor::_find_canvas_items_at_pos(const Point2 &p_pos, Node *p_node, Vector<_SelectResult> &r_items, int p_limit, const Transform2D &p_parent_xform, const Transform2D &p_canvas_xform) {
if (!p_node)
return;
if (Object::cast_to<Viewport>(p_node))
@@ -466,37 +466,73 @@ void CanvasItemEditor::_find_canvas_items_at_pos(const Point2 &p_pos, Node *p_no
const real_t grab_distance = EDITOR_DEF("editors/poly_editor/point_grab_radius", 8);
CanvasItem *canvas_item = Object::cast_to<CanvasItem>(p_node);
- Node *scene = editor->get_edited_scene();
- if (!(p_node != scene && p_node->get_owner() != scene && (!scene->is_editable_instance(p_node) || p_node->has_meta("_edit_lock_")))) {
+ bool locked = p_node->has_meta("_edit_lock_") && p_node->get_meta("_edit_lock_");
+
+ if (!locked) {
for (int i = p_node->get_child_count() - 1; i >= 0; i--) {
if (canvas_item && !canvas_item->is_set_as_toplevel()) {
- _find_canvas_items_at_pos(p_pos, p_node->get_child(i), r_items, limit, p_parent_xform * canvas_item->get_transform(), p_canvas_xform);
+ _find_canvas_items_at_pos(p_pos, p_node->get_child(i), r_items, p_limit, p_parent_xform * canvas_item->get_transform(), p_canvas_xform);
} else {
CanvasLayer *cl = Object::cast_to<CanvasLayer>(p_node);
- _find_canvas_items_at_pos(p_pos, p_node->get_child(i), r_items, limit, Transform2D(), cl ? cl->get_transform() : p_canvas_xform);
+ _find_canvas_items_at_pos(p_pos, p_node->get_child(i), r_items, p_limit, Transform2D(), cl ? cl->get_transform() : p_canvas_xform);
}
- if (limit != 0 && r_items.size() >= limit)
+ if (p_limit != 0 && r_items.size() >= p_limit)
return;
}
- }
-
- if (canvas_item && canvas_item->is_visible_in_tree() && (canvas_item->get_owner() != editor->get_edited_scene() || !canvas_item->has_meta("_edit_lock_"))) {
- Transform2D xform = (p_parent_xform * p_canvas_xform * canvas_item->get_transform()).affine_inverse();
- const real_t local_grab_distance = xform.basis_xform(Vector2(grab_distance, 0)).length();
- if (canvas_item->_edit_is_selected_on_click(xform.xform(p_pos), local_grab_distance)) {
- Node2D *node = Object::cast_to<Node2D>(canvas_item);
- _SelectResult res;
- res.item = canvas_item;
- res.z_index = node ? node->get_z_index() : 0;
- res.has_z = node;
- r_items.push_back(res);
+ if (canvas_item && canvas_item->is_visible_in_tree()) {
+ Transform2D xform = (p_parent_xform * p_canvas_xform * canvas_item->get_transform()).affine_inverse();
+ const real_t local_grab_distance = xform.basis_xform(Vector2(grab_distance, 0)).length();
+ if (canvas_item->_edit_is_selected_on_click(xform.xform(p_pos), local_grab_distance)) {
+ Node2D *node = Object::cast_to<Node2D>(canvas_item);
+
+ _SelectResult res;
+ res.item = canvas_item;
+ res.z_index = node ? node->get_z_index() : 0;
+ res.has_z = node;
+ r_items.push_back(res);
+ }
}
}
return;
}
+void CanvasItemEditor::_get_canvas_items_at_pos(const Point2 &p_pos, Vector<_SelectResult> &r_items, int p_limit) {
+
+ Node *scene = editor->get_edited_scene();
+
+ _find_canvas_items_at_pos(p_pos, scene, r_items, p_limit);
+
+ //Remove invalid results
+ for (int i = 0; i < r_items.size(); i++) {
+ Node *node = r_items[i].item;
+
+ // Make sure the selected node is in the current scene
+ while (node && node != scene && node->get_owner() != scene) {
+ node = node->get_parent();
+ };
+
+ // Replace the node by the group if grouped
+ CanvasItem *canvas_item = Object::cast_to<CanvasItem>(node);
+ while (node && node != scene) {
+ CanvasItem *canvas_item_tmp = Object::cast_to<CanvasItem>(node);
+ if (canvas_item_tmp && node->has_meta("_edit_group_")) {
+ canvas_item = canvas_item_tmp;
+ }
+ node = node->get_parent();
+ }
+
+ //Remove the item if invalid
+ if (!canvas_item || (canvas_item != scene && canvas_item->get_owner() != scene && !scene->is_editable_instance(canvas_item->get_owner()))) {
+ r_items.remove(i);
+ i--;
+ } else {
+ r_items[i].item = canvas_item;
+ }
+ }
+}
+
void CanvasItemEditor::_find_canvas_items_in_rect(const Rect2 &p_rect, Node *p_node, List<CanvasItem *> *r_items, const Transform2D &p_parent_xform, const Transform2D &p_canvas_xform) {
if (!p_node)
return;
@@ -628,7 +664,7 @@ void CanvasItemEditor::_save_canvas_item_state(List<CanvasItem *> p_canvas_items
if (bone && bone->has_meta("_edit_bone_")) {
// Check if we have an IK chain
List<Node2D *> bone_ik_list;
- bool ik_found;
+ bool ik_found = false;
bone = Object::cast_to<Node2D>(bone->get_parent());
while (bone) {
bone_ik_list.push_back(bone);
@@ -896,7 +932,7 @@ bool CanvasItemEditor::_gui_input_rulers_and_guides(const Ref<InputEvent> &p_eve
bool CanvasItemEditor::_gui_input_zoom_or_pan(const Ref<InputEvent> &p_event) {
Ref<InputEventMouseButton> b = p_event;
if (b.is_valid()) {
- if (b->get_button_index() == BUTTON_WHEEL_DOWN) {
+ if (b->is_pressed() && b->get_button_index() == BUTTON_WHEEL_DOWN) {
// Scroll or pan down
if (bool(EditorSettings::get_singleton()->get("editors/2d/scroll_to_pan"))) {
view_offset.y += int(EditorSettings::get_singleton()->get("editors/2d/pan_speed")) / zoom * b->get_factor();
@@ -908,7 +944,7 @@ bool CanvasItemEditor::_gui_input_zoom_or_pan(const Ref<InputEvent> &p_event) {
return true;
}
- if (b->get_button_index() == BUTTON_WHEEL_UP) {
+ if (b->is_pressed() && b->get_button_index() == BUTTON_WHEEL_UP) {
// Scroll or pan up
if (bool(EditorSettings::get_singleton()->get("editors/2d/scroll_to_pan"))) {
view_offset.y -= int(EditorSettings::get_singleton()->get("editors/2d/pan_speed")) / zoom * b->get_factor();
@@ -920,7 +956,7 @@ bool CanvasItemEditor::_gui_input_zoom_or_pan(const Ref<InputEvent> &p_event) {
return true;
}
- if (b->get_button_index() == BUTTON_WHEEL_LEFT) {
+ if (b->is_pressed() && b->get_button_index() == BUTTON_WHEEL_LEFT) {
// Pan left
if (bool(EditorSettings::get_singleton()->get("editors/2d/scroll_to_pan"))) {
view_offset.x -= int(EditorSettings::get_singleton()->get("editors/2d/pan_speed")) / zoom * b->get_factor();
@@ -930,7 +966,7 @@ bool CanvasItemEditor::_gui_input_zoom_or_pan(const Ref<InputEvent> &p_event) {
}
}
- if (b->get_button_index() == BUTTON_WHEEL_RIGHT) {
+ if (b->is_pressed() && b->get_button_index() == BUTTON_WHEEL_RIGHT) {
// Pan right
if (bool(EditorSettings::get_singleton()->get("editors/2d/scroll_to_pan"))) {
view_offset.x += int(EditorSettings::get_singleton()->get("editors/2d/pan_speed")) / zoom * b->get_factor();
@@ -939,31 +975,60 @@ bool CanvasItemEditor::_gui_input_zoom_or_pan(const Ref<InputEvent> &p_event) {
return true;
}
}
- }
- Ref<InputEventMouseMotion> m = p_event;
- if (m.is_valid()) {
if (drag_type == DRAG_NONE) {
- if (((m->get_button_mask() & BUTTON_MASK_LEFT) && tool == TOOL_PAN) ||
- (m->get_button_mask() & BUTTON_MASK_MIDDLE) ||
- ((m->get_button_mask() & BUTTON_MASK_LEFT) && Input::get_singleton()->is_key_pressed(KEY_SPACE)) ||
- (EditorSettings::get_singleton()->get("editors/2d/simple_spacebar_panning") && Input::get_singleton()->is_key_pressed(KEY_SPACE))) {
+ if (b->is_pressed() &&
+ (b->get_button_index() == BUTTON_MIDDLE ||
+ (b->get_button_index() == BUTTON_LEFT && tool == TOOL_PAN) ||
+ (b->get_button_index() == BUTTON_LEFT && !EditorSettings::get_singleton()->get("editors/2d/simple_spacebar_panning") && Input::get_singleton()->is_key_pressed(KEY_SPACE)))) {
// Pan the viewport
- Point2i relative;
- if (bool(EditorSettings::get_singleton()->get("editors/2d/warped_mouse_panning"))) {
- relative = Input::get_singleton()->warp_mouse_motion(m, viewport->get_global_rect());
- } else {
- relative = m->get_relative();
+ drag_type = DRAG_PAN;
+ }
+ }
+
+ if (drag_type == DRAG_PAN) {
+ if (!b->is_pressed()) {
+ // Stop panning the viewport (for any mouse button press)
+ drag_type = DRAG_NONE;
+ }
+ }
+ }
+
+ Ref<InputEventKey> k = p_event;
+ if (k.is_valid()) {
+ if (k->get_scancode() == KEY_SPACE && EditorSettings::get_singleton()->get("editors/2d/simple_spacebar_panning")) {
+ if (drag_type == DRAG_NONE) {
+ if (k->is_pressed() && !k->is_echo()) {
+ //Pan the viewport
+ drag_type = DRAG_PAN;
+ }
+ } else if (drag_type == DRAG_PAN) {
+ if (!k->is_pressed()) {
+ // Stop panning the viewport (for any mouse button press)
+ drag_type = DRAG_NONE;
}
- view_offset.x -= relative.x / zoom;
- view_offset.y -= relative.y / zoom;
- _update_scrollbars();
- viewport->update();
- return true;
}
}
}
+ Ref<InputEventMouseMotion> m = p_event;
+ if (m.is_valid()) {
+ if (drag_type == DRAG_PAN) {
+ // Pan the viewport
+ Point2i relative;
+ if (bool(EditorSettings::get_singleton()->get("editors/2d/warped_mouse_panning"))) {
+ relative = Input::get_singleton()->warp_mouse_motion(m, viewport->get_global_rect());
+ } else {
+ relative = m->get_relative();
+ }
+ view_offset.x -= relative.x / zoom;
+ view_offset.y -= relative.y / zoom;
+ _update_scrollbars();
+ viewport->update();
+ return true;
+ }
+ }
+
Ref<InputEventMagnifyGesture> magnify_gesture = p_event;
if (magnify_gesture.is_valid()) {
// Zoom gesture
@@ -1675,17 +1740,7 @@ bool CanvasItemEditor::_gui_input_select(const Ref<InputEvent> &p_event) {
// Popup the selection menu list
Point2 click = transform.affine_inverse().xform(b->get_position());
- Node *scene = editor->get_edited_scene();
-
- _find_canvas_items_at_pos(click, scene, selection_results);
- for (int i = 0; i < selection_results.size(); i++) {
- CanvasItem *item = selection_results[i].item;
- if (item != scene && item->get_owner() != scene && !scene->is_editable_instance(item->get_owner())) {
- //invalid result
- selection_results.remove(i);
- i--;
- }
- }
+ _get_canvas_items_at_pos(click, selection_results);
if (selection_results.size() == 1) {
CanvasItem *item = selection_results[0].item;
@@ -1735,7 +1790,7 @@ bool CanvasItemEditor::_gui_input_select(const Ref<InputEvent> &p_event) {
// Find the item to select
CanvasItem *canvas_item = NULL;
Vector<_SelectResult> selection;
- _find_canvas_items_at_pos(click, scene, selection, editor_selection->get_selection().empty() ? 1 : 0);
+ _get_canvas_items_at_pos(click, selection, editor_selection->get_selection().empty() ? 1 : 0);
for (int i = 0; i < selection.size(); i++) {
if (editor_selection->is_selected(selection[i].item)) {
@@ -1754,23 +1809,6 @@ bool CanvasItemEditor::_gui_input_select(const Ref<InputEvent> &p_event) {
if (!selection.empty())
canvas_item = selection[0].item;
- // Check if the canvas item is in a group, and select the group instead if it is the case
- Node *node = canvas_item;
- while (node && node != scene) {
- CanvasItem *canvas_item_tmp = Object::cast_to<CanvasItem>(node);
- if (canvas_item_tmp && node->has_meta("_edit_group_")) {
- canvas_item = canvas_item_tmp;
- }
- node = node->get_parent();
- }
-
- // Make sure the selected node is in the current scene
- node = canvas_item;
- while (node && ((node != scene && node->get_owner() != scene) || !node->is_class("CanvasItem"))) {
- node = node->get_parent();
- };
- canvas_item = Object::cast_to<CanvasItem>(node);
-
if (!canvas_item) {
// Start a box selection
if (!b->get_shift()) {
@@ -1855,11 +1893,10 @@ bool CanvasItemEditor::_gui_input_hover(const Ref<InputEvent> &p_event) {
if (m.is_valid()) {
if (drag_type == DRAG_NONE && tool == TOOL_SELECT) {
Point2 click = transform.affine_inverse().xform(m->get_position());
- Node *scene = editor->get_edited_scene();
//Checks if the hovered items changed, update the viewport if so
Vector<_SelectResult> hovering_results_tmp;
- _find_canvas_items_at_pos(click, scene, hovering_results_tmp);
+ _get_canvas_items_at_pos(click, hovering_results_tmp);
hovering_results_tmp.sort();
bool changed = false;
if (hovering_results.size() == hovering_results_tmp.size()) {
@@ -1903,10 +1940,10 @@ void CanvasItemEditor::_gui_input_viewport(const Ref<InputEvent> &p_event) {
//printf("Rotate\n");
} else if ((accepted = _gui_input_move(p_event))) {
//printf("Move\n");
- } else if ((accepted = _gui_input_select(p_event))) {
- //printf("Selection\n");
} else if ((accepted = _gui_input_zoom_or_pan(p_event))) {
//printf("Zoom or pan\n");
+ } else if ((accepted = _gui_input_select(p_event))) {
+ //printf("Selection\n");
}
if (accepted)
@@ -1919,22 +1956,18 @@ void CanvasItemEditor::_gui_input_viewport(const Ref<InputEvent> &p_event) {
CursorShape c = CURSOR_ARROW;
switch (drag_type) {
case DRAG_NONE:
- if (Input::get_singleton()->is_mouse_button_pressed(BUTTON_MIDDLE) || Input::get_singleton()->is_key_pressed(KEY_SPACE)) {
- c = CURSOR_DRAG;
- } else {
- switch (tool) {
- case TOOL_MOVE:
- c = CURSOR_MOVE;
- break;
- case TOOL_EDIT_PIVOT:
- c = CURSOR_CROSS;
- break;
- case TOOL_PAN:
- c = CURSOR_DRAG;
- break;
- default:
- break;
- }
+ switch (tool) {
+ case TOOL_MOVE:
+ c = CURSOR_MOVE;
+ break;
+ case TOOL_EDIT_PIVOT:
+ c = CURSOR_CROSS;
+ break;
+ case TOOL_PAN:
+ c = CURSOR_DRAG;
+ break;
+ default:
+ break;
}
break;
case DRAG_LEFT:
@@ -1956,6 +1989,8 @@ void CanvasItemEditor::_gui_input_viewport(const Ref<InputEvent> &p_event) {
case DRAG_ALL:
c = CURSOR_MOVE;
break;
+ case DRAG_PAN:
+ c = CURSOR_DRAG;
default:
break;
}
diff --git a/editor/plugins/canvas_item_editor_plugin.h b/editor/plugins/canvas_item_editor_plugin.h
index 5ca8a37610..373a4b799e 100644
--- a/editor/plugins/canvas_item_editor_plugin.h
+++ b/editor/plugins/canvas_item_editor_plugin.h
@@ -194,7 +194,8 @@ class CanvasItemEditor : public VBoxContainer {
DRAG_V_GUIDE,
DRAG_H_GUIDE,
DRAG_DOUBLE_GUIDE,
- DRAG_KEY_MOVE
+ DRAG_KEY_MOVE,
+ DRAG_PAN
};
EditorSelection *editor_selection;
@@ -336,7 +337,9 @@ class CanvasItemEditor : public VBoxContainer {
Ref<ShortCut> multiply_grid_step_shortcut;
Ref<ShortCut> divide_grid_step_shortcut;
- void _find_canvas_items_at_pos(const Point2 &p_pos, Node *p_node, Vector<_SelectResult> &r_items, int limit = 0, const Transform2D &p_parent_xform = Transform2D(), const Transform2D &p_canvas_xform = Transform2D());
+ void _find_canvas_items_at_pos(const Point2 &p_pos, Node *p_node, Vector<_SelectResult> &r_items, int p_limit = 0, const Transform2D &p_parent_xform = Transform2D(), const Transform2D &p_canvas_xform = Transform2D());
+ void _get_canvas_items_at_pos(const Point2 &p_pos, Vector<_SelectResult> &r_items, int p_limit = 0);
+
void _find_canvas_items_in_rect(const Rect2 &p_rect, Node *p_node, List<CanvasItem *> *r_items, const Transform2D &p_parent_xform = Transform2D(), const Transform2D &p_canvas_xform = Transform2D());
bool _select_click_on_item(CanvasItem *item, Point2 p_click_pos, bool p_append);
diff --git a/editor/plugins/navigation_mesh_generator.cpp b/editor/plugins/navigation_mesh_generator.cpp
index 5d4e5520f4..0537c5c31f 100644
--- a/editor/plugins/navigation_mesh_generator.cpp
+++ b/editor/plugins/navigation_mesh_generator.cpp
@@ -280,26 +280,20 @@ void NavigationMeshGenerator::bake(Ref<NavigationMesh> p_nav_mesh, Node *p_node)
_build_recast_navigation_mesh(p_nav_mesh, &ep, hf, chf, cset, poly_mesh, detail_mesh, vertices, indices);
- if (hf) {
- rcFreeHeightField(hf);
- hf = 0;
- }
- if (chf) {
- rcFreeCompactHeightfield(chf);
- chf = 0;
- }
- if (cset) {
- rcFreeContourSet(cset);
- cset = 0;
- }
- if (poly_mesh) {
- rcFreePolyMesh(poly_mesh);
- poly_mesh = 0;
- }
- if (detail_mesh) {
- rcFreePolyMeshDetail(detail_mesh);
- detail_mesh = 0;
- }
+ rcFreeHeightField(hf);
+ hf = 0;
+
+ rcFreeCompactHeightfield(chf);
+ chf = 0;
+
+ rcFreeContourSet(cset);
+ cset = 0;
+
+ rcFreePolyMesh(poly_mesh);
+ poly_mesh = 0;
+
+ rcFreePolyMeshDetail(detail_mesh);
+ detail_mesh = 0;
}
ep.step(TTR("Done!"), 11);
}
diff --git a/editor/plugins/path_editor_plugin.cpp b/editor/plugins/path_editor_plugin.cpp
index 056219a575..6dde639c54 100644
--- a/editor/plugins/path_editor_plugin.cpp
+++ b/editor/plugins/path_editor_plugin.cpp
@@ -167,18 +167,12 @@ void PathSpatialGizmo::commit_handle(int p_idx, const Variant &p_restore, bool p
Vector3 ofs;
- if (p_cancel) {
-
- return;
- }
-
if (t == 0) {
-
if (p_cancel) {
-
c->set_point_in(p_idx, p_restore);
return;
}
+
ur->create_action(TTR("Set Curve In Position"));
ur->add_do_method(c.ptr(), "set_point_in", idx, c->get_point_in(idx));
ur->add_undo_method(c.ptr(), "set_point_in", idx, p_restore);
@@ -186,10 +180,11 @@ void PathSpatialGizmo::commit_handle(int p_idx, const Variant &p_restore, bool p
} else {
if (p_cancel) {
-
c->set_point_out(idx, p_restore);
+
return;
}
+
ur->create_action(TTR("Set Curve Out Position"));
ur->add_do_method(c.ptr(), "set_point_out", idx, c->get_point_out(idx));
ur->add_undo_method(c.ptr(), "set_point_out", idx, p_restore);
diff --git a/editor/plugins/polygon_2d_editor_plugin.cpp b/editor/plugins/polygon_2d_editor_plugin.cpp
index 3a169bd780..2815fa6406 100644
--- a/editor/plugins/polygon_2d_editor_plugin.cpp
+++ b/editor/plugins/polygon_2d_editor_plugin.cpp
@@ -35,7 +35,7 @@
#include "os/file_access.h"
#include "os/input.h"
#include "os/keyboard.h"
-
+#include "scene/2d/skeleton_2d.h"
Node2D *Polygon2DEditor::_get_node() const {
return node;
@@ -66,6 +66,8 @@ void Polygon2DEditor::_notification(int p_what) {
uv_button[UV_MODE_SCALE]->set_icon(get_icon("ToolScale", "EditorIcons"));
uv_button[UV_MODE_ADD_SPLIT]->set_icon(get_icon("AddSplit", "EditorIcons"));
uv_button[UV_MODE_REMOVE_SPLIT]->set_icon(get_icon("DeleteSplit", "EditorIcons"));
+ uv_button[UV_MODE_PAINT_WEIGHT]->set_icon(get_icon("PaintVertex", "EditorIcons"));
+ uv_button[UV_MODE_CLEAR_WEIGHT]->set_icon(get_icon("UnpaintVertex", "EditorIcons"));
b_snap_grid->set_icon(get_icon("Grid", "EditorIcons"));
b_snap_enable->set_icon(get_icon("SnapGrid", "EditorIcons"));
@@ -78,31 +80,167 @@ void Polygon2DEditor::_notification(int p_what) {
}
}
+void Polygon2DEditor::_sync_bones() {
+
+ print_line("syncinc");
+ if (!node->has_node(node->get_skeleton())) {
+ error->set_text(TTR("The skeleton property of the Polygon2D does not point to a Skeleton2D node"));
+ error->popup_centered_minsize();
+ return;
+ }
+
+ Node *sn = node->get_node(node->get_skeleton());
+ Skeleton2D *skeleton = Object::cast_to<Skeleton2D>(sn);
+
+ if (!skeleton) {
+ error->set_text(TTR("The skeleton property of the Polygon2D does not point to a Skeleton2D node"));
+ error->popup_centered_minsize();
+ return;
+ }
+
+ Array prev_bones = node->call("_get_bones");
+ node->clear_bones();
+
+ print_line("bones in skeleton: " + itos(skeleton->get_bone_count()));
+
+ for (int i = 0; i < skeleton->get_bone_count(); i++) {
+ NodePath path = skeleton->get_path_to(skeleton->get_bone(i));
+ PoolVector<float> weights;
+ int wc = node->get_polygon().size();
+
+ for (int j = 0; j < prev_bones.size(); j += 2) {
+ NodePath pvp = prev_bones[j];
+ PoolVector<float> pv = prev_bones[j + 1];
+ if (pvp == path && pv.size() == wc) {
+ weights = pv;
+ }
+ }
+
+ if (weights.size() == 0) { //create them
+ weights.resize(node->get_polygon().size());
+ PoolVector<float>::Write w = weights.write();
+ for (int j = 0; j < wc; j++) {
+ w[j] = 0.0;
+ }
+ }
+
+ node->add_bone(path, weights);
+ }
+ Array new_bones = node->call("_get_bones");
+
+ undo_redo->create_action(TTR("Sync bones"));
+ undo_redo->add_do_method(node, "_set_bones", new_bones);
+ undo_redo->add_undo_method(node, "_set_bones", prev_bones);
+ undo_redo->add_do_method(uv_edit_draw, "update");
+ undo_redo->add_undo_method(uv_edit_draw, "update");
+ undo_redo->add_do_method(this, "_update_bone_list");
+ undo_redo->add_undo_method(this, "_update_bone_list");
+ undo_redo->commit_action();
+}
+
+void Polygon2DEditor::_update_bone_list() {
+
+ NodePath selected;
+ while (bone_scroll_vb->get_child_count()) {
+ CheckBox *cb = Object::cast_to<CheckBox>(bone_scroll_vb->get_child(0));
+ if (cb && cb->is_pressed()) {
+ selected = cb->get_meta("bone_path");
+ }
+ memdelete(bone_scroll_vb->get_child(0));
+ }
+
+ Ref<ButtonGroup> bg;
+ bg.instance();
+ for (int i = 0; i < node->get_bone_count(); i++) {
+ CheckBox *cb = memnew(CheckBox);
+ NodePath np = node->get_bone_path(i);
+ String name;
+ if (np.get_name_count()) {
+ name = np.get_name(np.get_name_count() - 1);
+ }
+ if (name == String()) {
+ name = "Bone " + itos(i);
+ }
+ cb->set_text(name);
+ cb->set_button_group(bg);
+ cb->set_meta("bone_path", np);
+ bone_scroll_vb->add_child(cb);
+
+ if (np == selected)
+ cb->set_pressed(true);
+
+ cb->connect("pressed", this, "_bone_paint_selected", varray(i));
+ }
+
+ uv_edit_draw->update();
+}
+
+void Polygon2DEditor::_bone_paint_selected(int p_index) {
+ uv_edit_draw->update();
+}
+
void Polygon2DEditor::_uv_edit_mode_select(int p_mode) {
- if (p_mode == 0) {
+ if (p_mode == 0) { //uv
uv_button[UV_MODE_CREATE]->hide();
for (int i = UV_MODE_MOVE; i <= UV_MODE_SCALE; i++) {
uv_button[i]->show();
}
uv_button[UV_MODE_ADD_SPLIT]->hide();
uv_button[UV_MODE_REMOVE_SPLIT]->hide();
+ uv_button[UV_MODE_PAINT_WEIGHT]->hide();
+ uv_button[UV_MODE_CLEAR_WEIGHT]->hide();
_uv_mode(UV_MODE_EDIT_POINT);
- } else if (p_mode == 1) {
+ bone_scroll_main_vb->hide();
+ bone_paint_strength->hide();
+ bone_paint_radius->hide();
+ bone_paint_radius_label->hide();
+
+ } else if (p_mode == 1) { //poly
for (int i = 0; i <= UV_MODE_SCALE; i++) {
uv_button[i]->show();
}
uv_button[UV_MODE_ADD_SPLIT]->hide();
uv_button[UV_MODE_REMOVE_SPLIT]->hide();
+ uv_button[UV_MODE_PAINT_WEIGHT]->hide();
+ uv_button[UV_MODE_CLEAR_WEIGHT]->hide();
_uv_mode(UV_MODE_EDIT_POINT);
- } else {
+
+ bone_scroll_main_vb->hide();
+ bone_paint_strength->hide();
+ bone_paint_radius->hide();
+ bone_paint_radius_label->hide();
+
+ } else if (p_mode == 2) { //splits
for (int i = 0; i <= UV_MODE_SCALE; i++) {
uv_button[i]->hide();
}
uv_button[UV_MODE_ADD_SPLIT]->show();
uv_button[UV_MODE_REMOVE_SPLIT]->show();
+ uv_button[UV_MODE_PAINT_WEIGHT]->hide();
+ uv_button[UV_MODE_CLEAR_WEIGHT]->hide();
_uv_mode(UV_MODE_ADD_SPLIT);
+
+ bone_scroll_main_vb->hide();
+ bone_paint_strength->hide();
+ bone_paint_radius->hide();
+ bone_paint_radius_label->hide();
+
+ } else if (p_mode == 3) { //bonesĀ“
+ for (int i = 0; i <= UV_MODE_REMOVE_SPLIT; i++) {
+ uv_button[i]->hide();
+ }
+ uv_button[UV_MODE_PAINT_WEIGHT]->show();
+ uv_button[UV_MODE_CLEAR_WEIGHT]->show();
+ _uv_mode(UV_MODE_PAINT_WEIGHT);
+
+ bone_scroll_main_vb->show();
+ bone_paint_strength->show();
+ bone_paint_radius->show();
+ bone_paint_radius_label->show();
+ _update_bone_list();
+ bone_paint_pos = Vector2(-100000, -100000); //send brush away when switching
}
uv_edit_draw->update();
@@ -261,6 +399,7 @@ void Polygon2DEditor::_uv_input(const Ref<InputEvent> &p_input) {
uv_create = true;
uv_create_uv_prev = node->get_uv();
uv_create_poly_prev = node->get_polygon();
+ uv_create_bones_prev = node->call("_get_bones");
splits_prev = node->get_splits();
node->set_polygon(uv_prev);
node->set_uv(uv_prev);
@@ -274,6 +413,8 @@ void Polygon2DEditor::_uv_input(const Ref<InputEvent> &p_input) {
undo_redo->add_undo_method(node, "set_uv", uv_prev);
undo_redo->add_do_method(node, "set_polygon", node->get_polygon());
undo_redo->add_undo_method(node, "set_polygon", uv_prev);
+ undo_redo->add_do_method(node, "clear_bones");
+ undo_redo->add_undo_method(node, "_set_bones", node->call("_get_bones"));
undo_redo->add_do_method(uv_edit_draw, "update");
undo_redo->add_undo_method(uv_edit_draw, "update");
undo_redo->commit_action();
@@ -419,6 +560,25 @@ void Polygon2DEditor::_uv_input(const Ref<InputEvent> &p_input) {
}
}
+ if (uv_move_current == UV_MODE_PAINT_WEIGHT || uv_move_current == UV_MODE_CLEAR_WEIGHT) {
+
+ int bone_selected = -1;
+ for (int i = 0; i < bone_scroll_vb->get_child_count(); i++) {
+ CheckBox *c = Object::cast_to<CheckBox>(bone_scroll_vb->get_child(i));
+ if (c && c->is_pressed()) {
+ bone_selected = i;
+ break;
+ }
+ }
+
+ if (bone_selected != -1 && node->get_bone_weights(bone_selected).size() == uv_prev.size()) {
+
+ prev_weights = node->get_bone_weights(bone_selected);
+ bone_painting = true;
+ bone_painting_bone = bone_selected;
+ }
+ }
+
} else if (uv_drag && !uv_create) {
undo_redo->create_action(TTR("Transform UV Map"));
@@ -435,6 +595,15 @@ void Polygon2DEditor::_uv_input(const Ref<InputEvent> &p_input) {
undo_redo->commit_action();
uv_drag = false;
+ } else if (bone_painting) {
+
+ undo_redo->create_action(TTR("Paint bone weights"));
+ undo_redo->add_do_method(node, "set_bone_weights", bone_painting_bone, node->get_bone_weights(bone_painting_bone));
+ undo_redo->add_undo_method(node, "set_bone_weights", bone_painting_bone, prev_weights);
+ undo_redo->add_do_method(uv_edit_draw, "update");
+ undo_redo->add_undo_method(uv_edit_draw, "update");
+ undo_redo->commit_action();
+ bone_painting = false;
}
} else if (mb->get_button_index() == BUTTON_RIGHT && mb->is_pressed()) {
@@ -445,6 +614,7 @@ void Polygon2DEditor::_uv_input(const Ref<InputEvent> &p_input) {
uv_create = false;
node->set_uv(uv_create_uv_prev);
node->set_polygon(uv_create_poly_prev);
+ node->call("_set_bones", uv_create_bones_prev);
node->set_splits(splits_prev);
uv_edit_draw->update();
} else if (uv_drag) {
@@ -459,6 +629,8 @@ void Polygon2DEditor::_uv_input(const Ref<InputEvent> &p_input) {
} else if (split_create) {
split_create = false;
uv_edit_draw->update();
+ } else if (bone_painting) {
+ node->set_bone_weights(bone_painting_bone, prev_weights);
}
} else if (mb->get_button_index() == BUTTON_WHEEL_UP && mb->is_pressed()) {
@@ -569,10 +741,40 @@ void Polygon2DEditor::_uv_input(const Ref<InputEvent> &p_input) {
}
} break;
}
+
+ if (bone_painting) {
+ bone_paint_pos = Vector2(mm->get_position().x, mm->get_position().y);
+ PoolVector<float> painted_weights = node->get_bone_weights(bone_painting_bone);
+
+ {
+ int pc = painted_weights.size();
+ float amount = bone_paint_strength->get_value();
+ float radius = bone_paint_radius->get_value() * EDSCALE;
+
+ if (uv_mode == UV_MODE_CLEAR_WEIGHT) {
+ amount = -amount;
+ }
+
+ PoolVector<float>::Write w = painted_weights.write();
+ PoolVector<float>::Read r = prev_weights.read();
+ PoolVector<Vector2>::Read rv = uv_prev.read();
+
+ for (int i = 0; i < pc; i++) {
+ if (mtx.xform(rv[i]).distance_to(bone_paint_pos) < radius) {
+ w[i] = CLAMP(r[i] + amount, 0, 1);
+ }
+ }
+ }
+
+ node->set_bone_weights(bone_painting_bone, painted_weights);
+ }
uv_edit_draw->update();
} else if (split_create) {
uv_create_to = mtx.affine_inverse().xform(Vector2(mm->get_position().x, mm->get_position().y));
uv_edit_draw->update();
+ } else if (uv_mode == UV_MODE_PAINT_WEIGHT || uv_mode == UV_MODE_CLEAR_WEIGHT) {
+ bone_paint_pos = Vector2(mm->get_position().x, mm->get_position().y);
+ uv_edit_draw->update();
}
}
@@ -649,6 +851,24 @@ void Polygon2DEditor::_uv_draw() {
uvs = node->get_polygon();
}
+ PoolVector<float>::Read weight_r;
+
+ if (uv_edit_mode[3]->is_pressed()) {
+ int bone_selected = -1;
+ for (int i = 0; i < bone_scroll_vb->get_child_count(); i++) {
+ CheckBox *c = Object::cast_to<CheckBox>(bone_scroll_vb->get_child(i));
+ if (c && c->is_pressed()) {
+ bone_selected = i;
+ break;
+ }
+ }
+
+ if (bone_selected != -1 && node->get_bone_weights(bone_selected).size() == uvs.size()) {
+
+ weight_r = node->get_bone_weights(bone_selected).read();
+ }
+ }
+
Ref<Texture> handle = get_icon("EditorHandle", "EditorIcons");
Rect2 rect(Point2(), mtx.basis_xform(base_tex->get_size()));
@@ -662,7 +882,14 @@ void Polygon2DEditor::_uv_draw() {
next_point = uv_create_to;
}
uv_edit_draw->draw_line(mtx.xform(uvs[i]), mtx.xform(next_point), Color(0.9, 0.5, 0.5), 2);
- uv_edit_draw->draw_texture(handle, mtx.xform(uvs[i]) - handle->get_size() * 0.5);
+ if (weight_r.ptr()) {
+
+ Vector2 draw_pos = mtx.xform(uvs[i]);
+ float weight = weight_r[i];
+ uv_edit_draw->draw_rect(Rect2(draw_pos - Vector2(2, 2) * EDSCALE, Vector2(5, 5) * EDSCALE), Color(weight, weight, weight, 1.0));
+ } else {
+ uv_edit_draw->draw_texture(handle, mtx.xform(uvs[i]) - handle->get_size() * 0.5);
+ }
rect.expand_to(mtx.basis_xform(uvs[i]));
}
@@ -682,6 +909,11 @@ void Polygon2DEditor::_uv_draw() {
uv_edit_draw->draw_line(mtx.xform(uvs[idx_from]), mtx.xform(uvs[idx_to]), Color(0.9, 0.5, 0.5), 2);
}
+ if (uv_mode == UV_MODE_PAINT_WEIGHT || uv_mode == UV_MODE_CLEAR_WEIGHT) {
+
+ uv_edit_draw->draw_circle(bone_paint_pos, bone_paint_radius->get_value() * EDSCALE, Color(1, 1, 1, 0.1));
+ }
+
rect = rect.grow(200);
updating_uv_scroll = true;
uv_hscroll->set_min(rect.position.x);
@@ -711,6 +943,10 @@ void Polygon2DEditor::_bind_methods() {
ClassDB::bind_method(D_METHOD("_set_snap_step_x"), &Polygon2DEditor::_set_snap_step_x);
ClassDB::bind_method(D_METHOD("_set_snap_step_y"), &Polygon2DEditor::_set_snap_step_y);
ClassDB::bind_method(D_METHOD("_uv_edit_mode_select"), &Polygon2DEditor::_uv_edit_mode_select);
+ ClassDB::bind_method(D_METHOD("_sync_bones"), &Polygon2DEditor::_sync_bones);
+ ClassDB::bind_method(D_METHOD("_update_bone_list"), &Polygon2DEditor::_update_bone_list);
+
+ ClassDB::bind_method(D_METHOD("_bone_paint_selected"), &Polygon2DEditor::_bone_paint_selected);
}
Vector2 Polygon2DEditor::snap_point(Vector2 p_target) const {
@@ -755,19 +991,25 @@ Polygon2DEditor::Polygon2DEditor(EditorNode *p_editor) :
uv_edit_mode[2] = memnew(ToolButton);
uv_mode_hb->add_child(uv_edit_mode[2]);
uv_edit_mode[2]->set_toggle_mode(true);
+ uv_edit_mode[3] = memnew(ToolButton);
+ uv_mode_hb->add_child(uv_edit_mode[3]);
+ uv_edit_mode[3]->set_toggle_mode(true);
uv_edit_mode[0]->set_text(TTR("UV"));
uv_edit_mode[0]->set_pressed(true);
uv_edit_mode[1]->set_text(TTR("Poly"));
uv_edit_mode[2]->set_text(TTR("Splits"));
+ uv_edit_mode[3]->set_text(TTR("Bones"));
uv_edit_mode[0]->set_button_group(uv_edit_group);
uv_edit_mode[1]->set_button_group(uv_edit_group);
uv_edit_mode[2]->set_button_group(uv_edit_group);
+ uv_edit_mode[3]->set_button_group(uv_edit_group);
uv_edit_mode[0]->connect("pressed", this, "_uv_edit_mode_select", varray(0));
uv_edit_mode[1]->connect("pressed", this, "_uv_edit_mode_select", varray(1));
uv_edit_mode[2]->connect("pressed", this, "_uv_edit_mode_select", varray(2));
+ uv_edit_mode[3]->connect("pressed", this, "_uv_edit_mode_select", varray(3));
uv_mode_hb->add_child(memnew(VSeparator));
@@ -788,11 +1030,38 @@ Polygon2DEditor::Polygon2DEditor(EditorNode *p_editor) :
uv_button[4]->set_tooltip(TTR("Scale Polygon"));
uv_button[5]->set_tooltip(TTR("Connect two points to make a split"));
uv_button[6]->set_tooltip(TTR("Select a split to erase it"));
+ uv_button[7]->set_tooltip(TTR("Paint weights with specified intensity"));
+ uv_button[8]->set_tooltip(TTR("UnPaint weights with specified intensity"));
uv_button[0]->hide();
uv_button[5]->hide();
uv_button[6]->hide();
+ uv_button[7]->hide();
+ uv_button[8]->hide();
uv_button[1]->set_pressed(true);
+
+ bone_paint_strength = memnew(HSlider);
+ uv_mode_hb->add_child(bone_paint_strength);
+ bone_paint_strength->set_custom_minimum_size(Size2(75 * EDSCALE, 0));
+ bone_paint_strength->set_v_size_flags(SIZE_SHRINK_CENTER);
+ bone_paint_strength->set_min(0);
+ bone_paint_strength->set_max(1);
+ bone_paint_strength->set_step(0.01);
+ bone_paint_strength->set_value(0.5);
+
+ bone_paint_radius_label = memnew(Label(" " + TTR("Radius:") + " "));
+ uv_mode_hb->add_child(bone_paint_radius_label);
+ bone_paint_radius = memnew(SpinBox);
+ uv_mode_hb->add_child(bone_paint_radius);
+
+ bone_paint_strength->hide();
+ bone_paint_radius->hide();
+ bone_paint_radius_label->hide();
+ bone_paint_radius->set_min(1);
+ bone_paint_radius->set_max(100);
+ bone_paint_radius->set_step(1);
+ bone_paint_radius->set_value(32);
+
HBoxContainer *uv_main_hb = memnew(HBoxContainer);
uv_main_vb->add_child(uv_main_hb);
uv_edit_draw = memnew(Control);
@@ -878,6 +1147,8 @@ Polygon2DEditor::Polygon2DEditor(EditorNode *p_editor) :
uv_zoom->set_max(4);
uv_zoom->set_value(1);
uv_zoom->set_step(0.01);
+ uv_zoom->set_v_size_flags(SIZE_SHRINK_CENTER);
+
uv_mode_hb->add_child(uv_zoom);
uv_zoom->set_custom_minimum_size(Size2(200, 0));
uv_zoom_value = memnew(SpinBox);
@@ -893,6 +1164,20 @@ Polygon2DEditor::Polygon2DEditor(EditorNode *p_editor) :
uv_main_vb->add_child(uv_hscroll);
uv_hscroll->connect("value_changed", this, "_uv_scroll_changed");
+ bone_scroll_main_vb = memnew(VBoxContainer);
+ bone_scroll_main_vb->hide();
+ sync_bones = memnew(Button(TTR("Sync Bones")));
+ bone_scroll_main_vb->add_child(sync_bones);
+ uv_main_hb->add_child(bone_scroll_main_vb);
+ bone_scroll = memnew(ScrollContainer);
+ bone_scroll->set_v_scroll(true);
+ bone_scroll->set_h_scroll(false);
+ bone_scroll_main_vb->add_child(bone_scroll);
+ bone_scroll->set_v_size_flags(SIZE_EXPAND_FILL);
+ bone_scroll_vb = memnew(VBoxContainer);
+ bone_scroll->add_child(bone_scroll_vb);
+ sync_bones->connect("pressed", this, "_sync_bones");
+
uv_edit_draw->connect("draw", this, "_uv_draw");
uv_edit_draw->connect("gui_input", this, "_uv_input");
uv_draw_zoom = 1.0;
@@ -901,6 +1186,7 @@ Polygon2DEditor::Polygon2DEditor(EditorNode *p_editor) :
uv_create = false;
updating_uv_scroll = false;
split_create = false;
+ bone_painting = false;
error = memnew(AcceptDialog);
add_child(error);
diff --git a/editor/plugins/polygon_2d_editor_plugin.h b/editor/plugins/polygon_2d_editor_plugin.h
index 8631ffb9a7..b18ead4d98 100644
--- a/editor/plugins/polygon_2d_editor_plugin.h
+++ b/editor/plugins/polygon_2d_editor_plugin.h
@@ -32,7 +32,7 @@
#define POLYGON_2D_EDITOR_PLUGIN_H
#include "editor/plugins/abstract_polygon_2d_editor.h"
-
+#include "scene/gui/scroll_container.h"
/**
@author Juan Linietsky <reduzio@gmail.com>
*/
@@ -57,10 +57,12 @@ class Polygon2DEditor : public AbstractPolygon2DEditor {
UV_MODE_SCALE,
UV_MODE_ADD_SPLIT,
UV_MODE_REMOVE_SPLIT,
+ UV_MODE_PAINT_WEIGHT,
+ UV_MODE_CLEAR_WEIGHT,
UV_MODE_MAX
};
- ToolButton *uv_edit_mode[3];
+ ToolButton *uv_edit_mode[4];
Ref<ButtonGroup> uv_edit_group;
Polygon2D *node;
@@ -78,11 +80,27 @@ class Polygon2DEditor : public AbstractPolygon2DEditor {
MenuButton *uv_menu;
TextureRect *uv_icon_zoom;
+ VBoxContainer *bone_scroll_main_vb;
+ ScrollContainer *bone_scroll;
+ VBoxContainer *bone_scroll_vb;
+ Button *sync_bones;
+ HSlider *bone_paint_strength;
+ SpinBox *bone_paint_radius;
+ Label *bone_paint_radius_label;
+ bool bone_painting;
+ int bone_painting_bone;
+ PoolVector<float> prev_weights;
+ Vector2 bone_paint_pos;
+
+ void _sync_bones();
+ void _update_bone_list();
+
Vector2 uv_draw_ofs;
float uv_draw_zoom;
PoolVector<Vector2> uv_prev;
PoolVector<Vector2> uv_create_uv_prev;
PoolVector<Vector2> uv_create_poly_prev;
+ Array uv_create_bones_prev;
PoolVector<int> splits_prev;
Vector2 uv_create_to;
@@ -118,6 +136,7 @@ class Polygon2DEditor : public AbstractPolygon2DEditor {
void _set_snap_step_y(float p_val);
void _uv_edit_mode_select(int p_mode);
+ void _bone_paint_selected(int p_index);
protected:
virtual Node2D *_get_node() const;
diff --git a/editor/plugins/sprite_frames_editor_plugin.cpp b/editor/plugins/sprite_frames_editor_plugin.cpp
index 71a3c90795..a9afc7a670 100644
--- a/editor/plugins/sprite_frames_editor_plugin.cpp
+++ b/editor/plugins/sprite_frames_editor_plugin.cpp
@@ -45,6 +45,12 @@ void SpriteFramesEditor::_notification(int p_what) {
if (p_what == NOTIFICATION_ENTER_TREE) {
load->set_icon(get_icon("Load", "EditorIcons"));
+ copy->set_icon(get_icon("ActionCopy", "EditorIcons"));
+ paste->set_icon(get_icon("ActionPaste", "EditorIcons"));
+ empty->set_icon(get_icon("InsertBefore", "EditorIcons"));
+ empty2->set_icon(get_icon("InsertAfter", "EditorIcons"));
+ move_up->set_icon(get_icon("MoveLeft", "EditorIcons"));
+ move_down->set_icon(get_icon("MoveRight", "EditorIcons"));
_delete->set_icon(get_icon("Remove", "EditorIcons"));
new_anim->set_icon(get_icon("New", "EditorIcons"));
remove_anim->set_icon(get_icon("Remove", "EditorIcons"));
@@ -736,27 +742,35 @@ SpriteFramesEditor::SpriteFramesEditor() {
hbc->add_child(load);
copy = memnew(Button);
- copy->set_text(TTR("Copy"));
+ copy->set_flat(true);
+ copy->set_tooltip(TTR("Copy"));
hbc->add_child(copy);
paste = memnew(Button);
- paste->set_text(TTR("Paste"));
+ paste->set_flat(true);
+ paste->set_tooltip(TTR("Paste"));
hbc->add_child(paste);
empty = memnew(Button);
- empty->set_text(TTR("Insert Empty (Before)"));
+ empty->set_flat(true);
+ empty->set_tooltip(TTR("Insert Empty (Before)"));
hbc->add_child(empty);
empty2 = memnew(Button);
- empty2->set_text(TTR("Insert Empty (After)"));
+ empty2->set_flat(true);
+ empty2->set_tooltip(TTR("Insert Empty (After)"));
hbc->add_child(empty2);
+ hbc->add_spacer(false);
+
move_up = memnew(Button);
- move_up->set_text(TTR("Move (Before)"));
+ move_up->set_flat(true);
+ move_up->set_tooltip(TTR("Move (Before)"));
hbc->add_child(move_up);
move_down = memnew(Button);
- move_down->set_text(TTR("Move (After)"));
+ move_down->set_flat(true);
+ move_down->set_tooltip(TTR("Move (After)"));
hbc->add_child(move_down);
_delete = memnew(Button);
diff --git a/editor/plugins/tile_map_editor_plugin.cpp b/editor/plugins/tile_map_editor_plugin.cpp
index 14c584fa35..72b3af5a09 100644
--- a/editor/plugins/tile_map_editor_plugin.cpp
+++ b/editor/plugins/tile_map_editor_plugin.cpp
@@ -724,7 +724,11 @@ bool TileMapEditor::forward_gui_input(const Ref<InputEvent> &p_event) {
if (mb->get_shift()) {
+#ifdef APPLE_STYLE_KEYS
+ if (mb->get_command())
+#else
if (mb->get_control())
+#endif
tool = TOOL_RECTANGLE_PAINT;
else
tool = TOOL_LINE_PAINT;
@@ -734,9 +738,11 @@ bool TileMapEditor::forward_gui_input(const Ref<InputEvent> &p_event) {
return true;
}
-
+#ifdef APPLE_STYLE_KEYS
+ if (mb->get_command()) {
+#else
if (mb->get_control()) {
-
+#endif
tool = TOOL_PICKING;
_pick_tile(over_tile);
@@ -940,8 +946,11 @@ bool TileMapEditor::forward_gui_input(const Ref<InputEvent> &p_event) {
undo_redo->add_undo_method(node, "set", "tile_data", node->get("tile_data"));
if (mb->get_shift()) {
-
+#ifdef APPLE_STYLE_KEYS
+ if (mb->get_command())
+#else
if (mb->get_control())
+#endif
tool = TOOL_RECTANGLE_ERASE;
else
tool = TOOL_LINE_ERASE;
diff --git a/editor/plugins/tile_map_editor_plugin.h b/editor/plugins/tile_map_editor_plugin.h
index 3257901c88..642870aec0 100644
--- a/editor/plugins/tile_map_editor_plugin.h
+++ b/editor/plugins/tile_map_editor_plugin.h
@@ -125,12 +125,11 @@ class TileMapEditor : public VBoxContainer {
bool yf;
bool tr;
- CellOp() {
- idx = -1;
- xf = false;
- yf = false;
- tr = false;
- }
+ CellOp() :
+ idx(TileMap::INVALID_CELL),
+ xf(false),
+ yf(false),
+ tr(false) {}
};
Map<Point2i, CellOp> paint_undo;
@@ -141,8 +140,12 @@ class TileMapEditor : public VBoxContainer {
bool flip_h;
bool flip_v;
bool transpose;
- int auto_x;
- int auto_y;
+
+ TileData() :
+ cell(TileMap::INVALID_CELL),
+ flip_h(false),
+ flip_v(false),
+ transpose(false) {}
};
List<TileData> copydata;
diff --git a/editor/plugins/tile_set_editor_plugin.cpp b/editor/plugins/tile_set_editor_plugin.cpp
index 41692e805f..385fa24ad8 100644
--- a/editor/plugins/tile_set_editor_plugin.cpp
+++ b/editor/plugins/tile_set_editor_plugin.cpp
@@ -149,6 +149,7 @@ void TileSetEditor::_import_node(Node *p_node, Ref<TileSet> p_library) {
p_library->tile_set_light_occluder(id, occluder);
p_library->tile_set_occluder_offset(id, -phys_offset);
p_library->tile_set_navigation_polygon_offset(id, -phys_offset);
+ p_library->tile_set_z_index(id, mi->get_z_index());
}
}
@@ -805,7 +806,7 @@ void TileSetEditor::_on_workspace_input(const Ref<InputEvent> &p_ie) {
Vector2 coord((int)(mb->get_position().x / (spacing + size.x)), (int)(mb->get_position().y / (spacing + size.y)));
Vector2 pos(coord.x * (spacing + size.x), coord.y * (spacing + size.y));
pos = mb->get_position() - pos;
- uint16_t bit;
+ uint16_t bit = 0;
if (tileset->autotile_get_bitmask_mode(get_current_tile()) == TileSet::BITMASK_2X2) {
if (pos.x < size.x / 2) {
if (pos.y < size.y / 2) {
@@ -868,7 +869,7 @@ void TileSetEditor::_on_workspace_input(const Ref<InputEvent> &p_ie) {
Vector2 coord((int)(mm->get_position().x / (spacing + size.x)), (int)(mm->get_position().y / (spacing + size.y)));
Vector2 pos(coord.x * (spacing + size.x), coord.y * (spacing + size.y));
pos = mm->get_position() - pos;
- uint16_t bit;
+ uint16_t bit = 0;
if (tileset->autotile_get_bitmask_mode(get_current_tile()) == TileSet::BITMASK_2X2) {
if (pos.x < size.x / 2) {
if (pos.y < size.y / 2) {
@@ -1146,7 +1147,7 @@ void TileSetEditor::_on_tool_clicked(int p_tool) {
case EDITMODE_COLLISION: {
if (!edited_collision_shape.is_null()) {
Vector<TileSet::ShapeData> sd = tileset->tile_get_shapes(get_current_tile());
- int index;
+ int index = -1;
for (int i = 0; i < sd.size(); i++) {
if (sd[i].shape == edited_collision_shape) {
index = i;
diff --git a/editor/project_export.cpp b/editor/project_export.cpp
index 7e9a884142..8b8c756219 100644
--- a/editor/project_export.cpp
+++ b/editor/project_export.cpp
@@ -703,9 +703,9 @@ void ProjectExportDialog::_export_pck_zip_selected(const String &p_path) {
ERR_FAIL_COND(platform.is_null());
if (p_path.ends_with(".zip")) {
- platform->save_zip(current, p_path);
+ platform->export_zip(current, export_pck_zip_debug->is_pressed(), p_path);
} else if (p_path.ends_with(".pck")) {
- platform->save_pack(current, p_path);
+ platform->export_pack(current, export_pck_zip_debug->is_pressed(), p_path);
}
}
@@ -981,6 +981,11 @@ ProjectExportDialog::ProjectExportDialog() {
export_debug->set_pressed(true);
export_project->get_vbox()->add_child(export_debug);
+ export_pck_zip_debug = memnew(CheckButton);
+ export_pck_zip_debug->set_text(TTR("Export With Debug"));
+ export_pck_zip_debug->set_pressed(true);
+ export_pck_zip->get_vbox()->add_child(export_pck_zip_debug);
+
set_hide_on_ok(false);
editor_icons = "EditorIcons";
diff --git a/editor/project_export.h b/editor/project_export.h
index 6c74743769..b62254974d 100644
--- a/editor/project_export.h
+++ b/editor/project_export.h
@@ -131,6 +131,7 @@ private:
FileDialog *export_pck_zip;
FileDialog *export_project;
CheckButton *export_debug;
+ CheckButton *export_pck_zip_debug;
void _open_export_template_manager();
diff --git a/editor/script_editor_debugger.cpp b/editor/script_editor_debugger.cpp
index e9529eb1c0..50519e2c6e 100644
--- a/editor/script_editor_debugger.cpp
+++ b/editor/script_editor_debugger.cpp
@@ -710,25 +710,6 @@ void ScriptEditorDebugger::_parse_message(const String &p_msg, const Array &p_da
error_list->set_item_metadata(error_list->get_item_count() - 1, stack);
error_count++;
- /*
- int count = p_data[1];
-
- Array cstack;
-
- OutputError oe = errors.front()->get();
-
- packet_peer_stream->put_var(oe.hr);
- packet_peer_stream->put_var(oe.min);
- packet_peer_stream->put_var(oe.sec);
- packet_peer_stream->put_var(oe.msec);
- packet_peer_stream->put_var(oe.source_func);
- packet_peer_stream->put_var(oe.source_file);
- packet_peer_stream->put_var(oe.source_line);
- packet_peer_stream->put_var(oe.error);
- packet_peer_stream->put_var(oe.error_descr);
- packet_peer_stream->put_var(oe.warning);
- packet_peer_stream->put_var(oe.callstack);
- */
} else if (p_msg == "profile_sig") {
//cache a signature
@@ -755,6 +736,7 @@ void ScriptEditorDebugger::_parse_message(const String &p_msg, const Array &p_da
EditorProfiler::Metric::Category::Item item;
item.calls = 1;
item.line = 0;
+
item.name = "Physics Time";
item.total = metric.physics_time;
item.self = item.total;
@@ -792,8 +774,9 @@ void ScriptEditorDebugger::_parse_message(const String &p_msg, const Array &p_da
for (int i = 0; i < values.size(); i += 2) {
EditorProfiler::Metric::Category::Item item;
- item.name = values[i];
item.calls = 1;
+ item.line = 0;
+ item.name = values[i];
item.self = values[i + 1];
item.total = item.self;
item.signature = "categ::" + name + "::" + item.name;
diff --git a/editor/spatial_editor_gizmos.cpp b/editor/spatial_editor_gizmos.cpp
index 8c90d86b9e..a3c4b73ae4 100644
--- a/editor/spatial_editor_gizmos.cpp
+++ b/editor/spatial_editor_gizmos.cpp
@@ -4052,9 +4052,9 @@ SpatialEditorGizmos::SpatialEditorGizmos() {
for (int k = 0; k < 3; k++) {
if (i < 3)
- face_points[j][(i + k) % 3] = v[k] * (i >= 3 ? -1 : 1);
+ face_points[j][(i + k) % 3] = v[k];
else
- face_points[3 - j][(i + k) % 3] = v[k] * (i >= 3 ? -1 : 1);
+ face_points[3 - j][(i + k) % 3] = -v[k];
}
}
//tri 1