summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ISSUE_TEMPLATE.md11
-rw-r--r--core/class_db.cpp9
-rw-r--r--core/dictionary.cpp2
-rw-r--r--core/dictionary.h2
-rw-r--r--core/hash_map.h17
-rw-r--r--core/io/resource_loader.cpp44
-rw-r--r--core/os/file_access.cpp55
-rw-r--r--core/variant_call.cpp2
-rw-r--r--doc/classes/BakedLightmap.xml16
-rw-r--r--doc/classes/BakedLightmapData.xml2
-rw-r--r--doc/classes/Dictionary.xml6
-rw-r--r--doc/classes/LineEdit.xml7
-rw-r--r--drivers/gles3/rasterizer_canvas_gles3.cpp2
-rw-r--r--drivers/gles3/rasterizer_gles3.cpp37
-rw-r--r--drivers/gles3/rasterizer_scene_gles3.cpp6
-rw-r--r--drivers/gles3/shader_gles3.cpp31
-rw-r--r--editor/editor_autoload_settings.cpp28
-rw-r--r--editor/editor_export.cpp19
-rw-r--r--editor/editor_help.cpp259
-rw-r--r--editor/editor_help.h12
-rw-r--r--editor/editor_node.cpp10
-rw-r--r--editor/editor_themes.cpp6
-rw-r--r--editor/export_template_manager.cpp35
-rw-r--r--editor/export_template_manager.h2
-rw-r--r--editor/icons/SCsub3
-rw-r--r--editor/icons/icon_GUI_visibility_hidden.svg2
-rw-r--r--editor/icons/icon_a_a_b_b.svg (renamed from editor/icons/icon_mini_aabb.svg)0
-rw-r--r--editor/icons/icon_array.svg (renamed from editor/icons/icon_mini_array.svg)0
-rw-r--r--editor/icons/icon_basis.svg4
-rw-r--r--editor/icons/icon_bool.svg3
-rw-r--r--editor/icons/icon_color.svg7
-rw-r--r--editor/icons/icon_dictionary.svg3
-rw-r--r--editor/icons/icon_float.svg3
-rw-r--r--editor/icons/icon_int.svg3
-rw-r--r--editor/icons/icon_kinematic_body.svg4
-rw-r--r--editor/icons/icon_kinematic_body_2d.svg6
-rw-r--r--editor/icons/icon_match_case.svg3
-rw-r--r--editor/icons/icon_member_constant.svg3
-rw-r--r--editor/icons/icon_member_method.svg3
-rw-r--r--editor/icons/icon_member_property.svg3
-rw-r--r--editor/icons/icon_member_signal.svg3
-rw-r--r--editor/icons/icon_member_theme.svg6
-rw-r--r--editor/icons/icon_mini_basis.svg6
-rw-r--r--editor/icons/icon_mini_boolean.svg5
-rw-r--r--editor/icons/icon_mini_color.svg7
-rw-r--r--editor/icons/icon_mini_color_array.svg14
-rw-r--r--editor/icons/icon_mini_dictionary.svg5
-rw-r--r--editor/icons/icon_mini_float.svg5
-rw-r--r--editor/icons/icon_mini_float_array.svg7
-rw-r--r--editor/icons/icon_mini_int_array.svg7
-rw-r--r--editor/icons/icon_mini_integer.svg5
-rw-r--r--editor/icons/icon_mini_object.svg4
-rw-r--r--editor/icons/icon_mini_path.svg5
-rw-r--r--editor/icons/icon_mini_plane.svg5
-rw-r--r--editor/icons/icon_mini_quat.svg7
-rw-r--r--editor/icons/icon_mini_raw_array.svg7
-rw-r--r--editor/icons/icon_mini_rect2.svg5
-rw-r--r--editor/icons/icon_mini_string.svg5
-rw-r--r--editor/icons/icon_mini_string_array.svg7
-rw-r--r--editor/icons/icon_mini_transform.svg6
-rw-r--r--editor/icons/icon_mini_transform2D.svg6
-rw-r--r--editor/icons/icon_mini_variant.svg5
-rw-r--r--editor/icons/icon_mini_vector2.svg6
-rw-r--r--editor/icons/icon_mini_vector2_array.svg7
-rw-r--r--editor/icons/icon_mini_vector3.svg6
-rw-r--r--editor/icons/icon_mini_vector3_array.svg7
-rw-r--r--editor/icons/icon_nil.svg3
-rw-r--r--editor/icons/icon_node_path.svg3
-rw-r--r--editor/icons/icon_plane.svg6
-rw-r--r--editor/icons/icon_pool_byte_array.svg5
-rw-r--r--editor/icons/icon_pool_color_array.svg8
-rw-r--r--editor/icons/icon_pool_int_array.svg5
-rw-r--r--editor/icons/icon_pool_real_array.svg5
-rw-r--r--editor/icons/icon_pool_string_array.svg5
-rw-r--r--editor/icons/icon_pool_vector2_array.svg5
-rw-r--r--editor/icons/icon_pool_vector3_array.svg5
-rw-r--r--editor/icons/icon_quat.svg8
-rw-r--r--editor/icons/icon_r_i_d.svg (renamed from editor/icons/icon_mini_rid.svg)0
-rw-r--r--editor/icons/icon_range.svg5
-rw-r--r--editor/icons/icon_rect2.svg3
-rw-r--r--editor/icons/icon_scroll_bar.svg5
-rw-r--r--editor/icons/icon_string.svg3
-rw-r--r--editor/icons/icon_theme.svg16
-rw-r--r--editor/icons/icon_transform.svg4
-rw-r--r--editor/icons/icon_transform_2_D.svg4
-rw-r--r--editor/icons/icon_variant.svg17
-rw-r--r--editor/icons/icon_vector2.svg4
-rw-r--r--editor/icons/icon_vector3.svg4
-rw-r--r--editor/import/resource_importer_scene.cpp138
-rw-r--r--editor/plugins/animation_player_editor_plugin.cpp6
-rw-r--r--editor/plugins/spatial_editor_plugin.cpp63
-rw-r--r--editor/plugins/spatial_editor_plugin.h4
-rw-r--r--editor/plugins/tile_set_editor_plugin.cpp6
-rw-r--r--editor/project_settings_editor.cpp8
-rw-r--r--editor/property_editor.cpp4
-rw-r--r--editor/property_editor.h4
-rw-r--r--editor/scene_tree_dock.cpp12
-rw-r--r--editor/scene_tree_dock.h1
-rw-r--r--editor/settings_config_dialog.cpp76
-rw-r--r--editor/settings_config_dialog.h6
-rw-r--r--editor/spatial_editor_gizmos.cpp2
-rw-r--r--modules/gdnative/SCsub4
-rw-r--r--modules/gdnative/gdnative_library_editor_plugin.cpp423
-rw-r--r--modules/gdnative/gdnative_library_editor_plugin.h113
-rw-r--r--modules/gdnative/gdnative_library_singleton_editor.cpp (renamed from modules/gdnative/gd_native_library_editor.cpp)19
-rw-r--r--modules/gdnative/gdnative_library_singleton_editor.h (renamed from modules/gdnative/gd_native_library_editor.h)6
-rw-r--r--modules/gdnative/register_types.cpp7
-rw-r--r--modules/gdscript/gdscript_function.cpp2
-rw-r--r--modules/gridmap/doc_classes/GridMap.xml30
-rw-r--r--modules/gridmap/grid_map.cpp234
-rw-r--r--modules/gridmap/grid_map.h13
-rw-r--r--modules/stb_vorbis/audio_stream_ogg_vorbis.cpp16
-rw-r--r--modules/visual_script/visual_script_editor.cpp110
-rw-r--r--modules/visual_script/visual_script_flow_control.cpp915
-rw-r--r--modules/visual_script/visual_script_flow_control.h34
-rw-r--r--platform/android/detect.py2
-rw-r--r--platform/android/export/export.cpp3
-rw-r--r--platform/android/godot_android.cpp2
-rw-r--r--platform/android/java_glue.cpp9
-rw-r--r--platform/windows/detect.py3
-rw-r--r--scene/3d/baked_lightmap.cpp84
-rw-r--r--scene/3d/baked_lightmap.h7
-rw-r--r--scene/3d/portal.h3
-rw-r--r--scene/3d/room_instance.h2
-rw-r--r--scene/3d/sprite_3d.cpp1
-rw-r--r--scene/3d/voxel_light_baker.cpp89
-rw-r--r--scene/gui/control.cpp2
-rw-r--r--scene/gui/line_edit.cpp33
-rw-r--r--scene/gui/line_edit.h5
-rw-r--r--scene/gui/popup_menu.cpp47
-rw-r--r--scene/gui/text_edit.cpp10
-rw-r--r--scene/gui/text_edit.h2
-rw-r--r--scene/main/node.cpp4
-rw-r--r--scene/register_scene_types.cpp6
-rw-r--r--scene/resources/mesh.cpp7
-rw-r--r--scene/resources/room.h2
-rw-r--r--servers/visual/shader_language.cpp58
-rw-r--r--servers/visual/visual_server_canvas.cpp60
-rw-r--r--servers/visual/visual_server_scene.h28
139 files changed, 1674 insertions, 2002 deletions
diff --git a/ISSUE_TEMPLATE.md b/ISSUE_TEMPLATE.md
index 2a3c298633..dbfb2bdeab 100644
--- a/ISSUE_TEMPLATE.md
+++ b/ISSUE_TEMPLATE.md
@@ -1,4 +1,9 @@
-**Operating system or device, Godot version, GPU Model and driver (if graphics related):**
+**Godot version:**
+<!-- If thirdparty of self-compiled, specify the build date or commit hash. -->
+
+
+**OS/device including version:**
+<!-- If graphics related, specify also GPU model and drivers. -->
**Issue description:**
@@ -8,5 +13,5 @@
**Steps to reproduce:**
-**Link to minimal example project:**
-<!-- Optional but very welcome. You can drag and drop a zip archive to upload it. -->
+**Minimal reproduction project:**
+<!-- Optional but greatly speeds up debugging. You can drag and drop a zip archive to upload it. -->
diff --git a/core/class_db.cpp b/core/class_db.cpp
index edd49fe95f..b18e3d2b65 100644
--- a/core/class_db.cpp
+++ b/core/class_db.cpp
@@ -348,10 +348,11 @@ uint64_t ClassDB::get_api_hash(APIType p_api) {
hash = hash_djb2_one_64(mb->get_argument_type(-1), hash); //return
for (int i = 0; i < mb->get_argument_count(); i++) {
- hash = hash_djb2_one_64(mb->get_argument_info(i).type, hash);
- hash = hash_djb2_one_64(mb->get_argument_info(i).name.hash(), hash);
- hash = hash_djb2_one_64(mb->get_argument_info(i).hint, hash);
- hash = hash_djb2_one_64(mb->get_argument_info(i).hint_string.hash(), hash);
+ const PropertyInfo info = mb->get_argument_info(i);
+ hash = hash_djb2_one_64(info.type, hash);
+ hash = hash_djb2_one_64(info.name.hash(), hash);
+ hash = hash_djb2_one_64(info.hint, hash);
+ hash = hash_djb2_one_64(info.hint_string.hash(), hash);
}
hash = hash_djb2_one_64(mb->get_default_argument_count(), hash);
diff --git a/core/dictionary.cpp b/core/dictionary.cpp
index 44fce2474f..66af6a1a9a 100644
--- a/core/dictionary.cpp
+++ b/core/dictionary.cpp
@@ -215,7 +215,7 @@ const Variant *Dictionary::next(const Variant *p_key) const {
return NULL;
}
-Dictionary Dictionary::copy() const {
+Dictionary Dictionary::duplicate() const {
Dictionary n;
diff --git a/core/dictionary.h b/core/dictionary.h
index c8177d5648..1d8ca0023e 100644
--- a/core/dictionary.h
+++ b/core/dictionary.h
@@ -74,7 +74,7 @@ public:
Array keys() const;
Array values() const;
- Dictionary copy() const;
+ Dictionary duplicate() const;
Dictionary(const Dictionary &p_from);
Dictionary();
diff --git a/core/hash_map.h b/core/hash_map.h
index a53cb53c84..3ec3961d73 100644
--- a/core/hash_map.h
+++ b/core/hash_map.h
@@ -313,7 +313,7 @@ public:
_FORCE_INLINE_ TData *getptr(const TKey &p_key) {
- if (!hash_table)
+ if (unlikely(!hash_table))
return NULL;
Element *e = const_cast<Element *>(get_element(p_key));
@@ -326,7 +326,7 @@ public:
_FORCE_INLINE_ const TData *getptr(const TKey &p_key) const {
- if (!hash_table)
+ if (unlikely(!hash_table))
return NULL;
const Element *e = const_cast<Element *>(get_element(p_key));
@@ -345,7 +345,7 @@ public:
template <class C>
_FORCE_INLINE_ TData *custom_getptr(C p_custom_key, uint32_t p_custom_hash) {
- if (!hash_table)
+ if (unlikely(!hash_table))
return NULL;
uint32_t hash = p_custom_hash;
@@ -371,7 +371,7 @@ public:
template <class C>
_FORCE_INLINE_ const TData *custom_getptr(C p_custom_key, uint32_t p_custom_hash) const {
- if (!hash_table)
+ if (unlikely(!hash_table))
return NULL;
uint32_t hash = p_custom_hash;
@@ -400,7 +400,7 @@ public:
bool erase(const TKey &p_key) {
- if (!hash_table)
+ if (unlikely(!hash_table))
return false;
uint32_t hash = Hasher::hash(p_key);
@@ -478,7 +478,8 @@ public:
*/
const TKey *next(const TKey *p_key) const {
- if (!hash_table) return NULL;
+ if (unlikely(!hash_table))
+ return NULL;
if (!p_key) { /* get the first key */
@@ -559,7 +560,7 @@ public:
}
void get_key_value_ptr_array(const Pair **p_pairs) const {
- if (!hash_table)
+ if (unlikely(!hash_table))
return;
for (int i = 0; i < (1 << hash_table_power); i++) {
@@ -573,7 +574,7 @@ public:
}
void get_key_list(List<TKey> *p_keys) const {
- if (!hash_table)
+ if (unlikely(!hash_table))
return;
for (int i = 0; i < (1 << hash_table_power); i++) {
diff --git a/core/io/resource_loader.cpp b/core/io/resource_loader.cpp
index d2aad1d63a..dea9f38634 100644
--- a/core/io/resource_loader.cpp
+++ b/core/io/resource_loader.cpp
@@ -35,6 +35,7 @@
#include "print_string.h"
#include "project_settings.h"
#include "translation.h"
+#include "variant_parser.h"
ResourceFormatLoader *ResourceLoader::loader[MAX_LOADERS];
int ResourceLoader::loader_count = 0;
@@ -454,6 +455,49 @@ String ResourceLoader::_path_remap(const String &p_path, bool *r_translation_rem
if (path_remaps.has(new_path)) {
new_path = path_remaps[new_path];
}
+
+ if (new_path == p_path) { //did not remap
+ //try file remap
+ Error err;
+ FileAccess *f = FileAccess::open(p_path + ".remap", FileAccess::READ, &err);
+
+ if (f) {
+
+ VariantParser::StreamFile stream;
+ stream.f = f;
+
+ String assign;
+ Variant value;
+ VariantParser::Tag next_tag;
+
+ int lines = 0;
+ String error_text;
+ while (true) {
+
+ assign = Variant();
+ next_tag.fields.clear();
+ next_tag.name = String();
+
+ err = VariantParser::parse_tag_assign_eof(&stream, lines, error_text, next_tag, assign, value, NULL, true);
+ if (err == ERR_FILE_EOF) {
+ break;
+ } else if (err != OK) {
+ ERR_PRINTS("Parse error: " + p_path + ".remap:" + itos(lines) + " error: " + error_text);
+ break;
+ }
+
+ if (assign == "path") {
+ new_path = value;
+ break;
+ } else if (next_tag.name != "remap") {
+ break;
+ }
+ }
+
+ memdelete(f);
+ }
+ }
+
return new_path;
}
diff --git a/core/os/file_access.cpp b/core/os/file_access.cpp
index 7b2062936b..20c1221f2b 100644
--- a/core/os/file_access.cpp
+++ b/core/os/file_access.cpp
@@ -273,9 +273,62 @@ String FileAccess::get_token() const {
return String::utf8(token.get_data());
}
+class CharBuffer {
+ Vector<char> vector;
+ char stack_buffer[256];
+
+ char *buffer;
+ int capacity;
+ int written;
+
+ bool grow() {
+
+ if (vector.resize(next_power_of_2(1 + written)) != OK) {
+
+ return false;
+ }
+
+ if (buffer == stack_buffer) { // first chunk?
+
+ for (int i = 0; i < written; i++) {
+
+ vector[i] = stack_buffer[i];
+ }
+ }
+
+ buffer = vector.ptrw();
+ capacity = vector.size();
+ ERR_FAIL_COND_V(written >= capacity, false);
+
+ return true;
+ }
+
+public:
+ _FORCE_INLINE_ CharBuffer() :
+ buffer(stack_buffer),
+ capacity(sizeof(stack_buffer) / sizeof(char)),
+ written(0) {
+ }
+
+ _FORCE_INLINE_ void push_back(char c) {
+
+ if (written >= capacity) {
+
+ ERR_FAIL_COND(!grow());
+ }
+
+ buffer[written++] = c;
+ }
+
+ _FORCE_INLINE_ const char *get_data() const {
+
+ return buffer;
+ }
+};
+
String FileAccess::get_line() const {
- CharString line;
+ CharBuffer line;
CharType c = get_8();
diff --git a/core/variant_call.cpp b/core/variant_call.cpp
index 2b99a60ba5..0284c4d866 100644
--- a/core/variant_call.cpp
+++ b/core/variant_call.cpp
@@ -462,6 +462,7 @@ struct _VariantCall {
VCALL_LOCALMEM0R(Dictionary, hash);
VCALL_LOCALMEM0R(Dictionary, keys);
VCALL_LOCALMEM0R(Dictionary, values);
+ VCALL_LOCALMEM0R(Dictionary, duplicate);
VCALL_LOCALMEM2(Array, set);
VCALL_LOCALMEM1R(Array, get);
@@ -1607,6 +1608,7 @@ void register_variant_methods() {
ADDFUNC0R(DICTIONARY, INT, Dictionary, hash, varray());
ADDFUNC0R(DICTIONARY, ARRAY, Dictionary, keys, varray());
ADDFUNC0R(DICTIONARY, ARRAY, Dictionary, values, varray());
+ ADDFUNC0R(DICTIONARY, DICTIONARY, Dictionary, duplicate, varray());
ADDFUNC0R(ARRAY, INT, Array, size, varray());
ADDFUNC0R(ARRAY, BOOL, Array, empty, varray());
diff --git a/doc/classes/BakedLightmap.xml b/doc/classes/BakedLightmap.xml
index 8084af3817..b351aeac05 100644
--- a/doc/classes/BakedLightmap.xml
+++ b/doc/classes/BakedLightmap.xml
@@ -57,11 +57,7 @@
</constant>
<constant name="SUBDIV_1024" value="3" enum="Subdiv">
</constant>
- <constant name="SUBDIV_2048" value="4" enum="Subdiv">
- </constant>
- <constant name="SUBDIV_4096" value="5" enum="Subdiv">
- </constant>
- <constant name="SUBDIV_MAX" value="6" enum="Subdiv">
+ <constant name="SUBDIV_MAX" value="4" enum="Subdiv">
</constant>
<constant name="BAKE_QUALITY_LOW" value="0" enum="BakeQuality">
</constant>
@@ -73,5 +69,15 @@
</constant>
<constant name="BAKE_MODE_RAY_TRACE" value="1" enum="BakeMode">
</constant>
+ <constant name="BAKE_ERROR_OK" value="0" enum="BakeError">
+ </constant>
+ <constant name="BAKE_ERROR_NO_SAVE_PATH" value="1" enum="BakeError">
+ </constant>
+ <constant name="BAKE_ERROR_NO_MESHES" value="2" enum="BakeError">
+ </constant>
+ <constant name="BAKE_ERROR_CANT_CREATE_IMAGE" value="3" enum="BakeError">
+ </constant>
+ <constant name="BAKE_ERROR_USER_ABORTED" value="4" enum="BakeError">
+ </constant>
</constants>
</class>
diff --git a/doc/classes/BakedLightmapData.xml b/doc/classes/BakedLightmapData.xml
index 6997dcb0b2..2b95cff136 100644
--- a/doc/classes/BakedLightmapData.xml
+++ b/doc/classes/BakedLightmapData.xml
@@ -16,6 +16,8 @@
</argument>
<argument index="1" name="lightmap" type="Texture">
</argument>
+ <argument index="2" name="instance" type="int">
+ </argument>
<description>
</description>
</method>
diff --git a/doc/classes/Dictionary.xml b/doc/classes/Dictionary.xml
index 40b60f00cf..08c01c1d85 100644
--- a/doc/classes/Dictionary.xml
+++ b/doc/classes/Dictionary.xml
@@ -16,6 +16,12 @@
Clear the dictionary, removing all key/value pairs.
</description>
</method>
+ <method name="duplicate">
+ <return type="Dictionary">
+ </return>
+ <description>
+ </description>
+ </method>
<method name="empty">
<return type="bool">
</return>
diff --git a/doc/classes/LineEdit.xml b/doc/classes/LineEdit.xml
index 9a03d4e0c1..4434a7b7e2 100644
--- a/doc/classes/LineEdit.xml
+++ b/doc/classes/LineEdit.xml
@@ -27,6 +27,13 @@
Erases the [LineEdit] text.
</description>
</method>
+ <method name="deselect">
+ <return type="void">
+ </return>
+ <description>
+ Clears the current selection.
+ </description>
+ </method>
<method name="get_cursor_position" qualifiers="const">
<return type="int">
</return>
diff --git a/drivers/gles3/rasterizer_canvas_gles3.cpp b/drivers/gles3/rasterizer_canvas_gles3.cpp
index 309497c938..5d93c6a982 100644
--- a/drivers/gles3/rasterizer_canvas_gles3.cpp
+++ b/drivers/gles3/rasterizer_canvas_gles3.cpp
@@ -1545,7 +1545,7 @@ void RasterizerCanvasGLES3::reset_canvas() {
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0);
//use for reading from screen
- if (storage->frame.current_rt) {
+ if (storage->frame.current_rt && !storage->frame.current_rt->flags[RasterizerStorage::RENDER_TARGET_NO_SAMPLING]) {
glActiveTexture(GL_TEXTURE0 + storage->config.max_texture_image_units - 3);
glBindTexture(GL_TEXTURE_2D, storage->frame.current_rt->effects.mip_maps[0].color);
}
diff --git a/drivers/gles3/rasterizer_gles3.cpp b/drivers/gles3/rasterizer_gles3.cpp
index cd0adbd0d1..6b827002f8 100644
--- a/drivers/gles3/rasterizer_gles3.cpp
+++ b/drivers/gles3/rasterizer_gles3.cpp
@@ -354,47 +354,10 @@ void RasterizerGLES3::blit_render_target_to_screen(RID p_render_target, const Re
void RasterizerGLES3::end_frame(bool p_swap_buffers) {
-#if 0
- canvas->canvas_begin();
- glActiveTexture(GL_TEXTURE0);
- glBindTexture(GL_TEXTURE_2D,storage->resources.white_tex);
- glDisable(GL_BLEND);
- glDisable(GL_DEPTH_TEST);
- glDisable(GL_CULL_FACE);
-
-
- float vtx[8]={0,0,
- 0,1,
- 1,1,
- 1,0
- };
-
- glBindBuffer(GL_ARRAY_BUFFER,0);
- glBindBuffer(GL_ELEMENT_ARRAY_BUFFER,0);
-
- glEnableVertexAttribArray(VS::ARRAY_VERTEX);
- glVertexAttribPointer( VS::ARRAY_VERTEX, 2 ,GL_FLOAT, false, 0, vtx );
-
-
- //glBindBuffer(GL_ARRAY_BUFFER,canvas->data.canvas_quad_vertices);
- //glEnableVertexAttribArray(VS::ARRAY_VERTEX);
- //glVertexAttribPointer( VS::ARRAY_VERTEX, 2 ,GL_FLOAT, false, 0, 0 );
-
- glBindVertexArray(canvas->data.canvas_quad_array);
-
- canvas->draw_generic_textured_rect(Rect2(0,0,15,15),Rect2(0,0,1,1));
-#endif
if (p_swap_buffers)
OS::get_singleton()->swap_buffers();
else
glFinish();
-
- /* print_line("objects: "+itos(storage->info.render_object_count));
- print_line("material chages: "+itos(storage->info.render_material_switch_count));
- print_line("surface changes: "+itos(storage->info.render_surface_switch_count));
- print_line("shader changes: "+itos(storage->info.render_shader_rebind_count));
- print_line("vertices: "+itos(storage->info.render_vertices_count));
-*/
}
void RasterizerGLES3::finalize() {
diff --git a/drivers/gles3/rasterizer_scene_gles3.cpp b/drivers/gles3/rasterizer_scene_gles3.cpp
index 29ab531177..b777f9343a 100644
--- a/drivers/gles3/rasterizer_scene_gles3.cpp
+++ b/drivers/gles3/rasterizer_scene_gles3.cpp
@@ -2786,12 +2786,6 @@ void RasterizerSceneGLES3::_setup_lights(RID *p_light_cull_result, int p_light_c
copymem(&state.omni_array_tmp[li->light_index * state.ubo_light_size], &ubo_data, state.ubo_light_size);
state.omni_light_count++;
-#if 0
- if (li->light_ptr->shadow_enabled) {
- li->shadow_projection[0] = Transform(camera_transform_inverse * li->transform).inverse();
- lights_use_shadow=true;
- }
-#endif
} break;
case VS::LIGHT_SPOT: {
diff --git a/drivers/gles3/shader_gles3.cpp b/drivers/gles3/shader_gles3.cpp
index 9e234f5005..56b1cfdf0f 100644
--- a/drivers/gles3/shader_gles3.cpp
+++ b/drivers/gles3/shader_gles3.cpp
@@ -279,21 +279,6 @@ ShaderGLES3::Version *ShaderGLES3::get_current_version() {
strings.push_back("precision highp sampler2DArray;\n");
#endif
-#if 0
- if (cc) {
-
- String _code_string = "#define VERTEX_SHADER_CODE "+cc->vertex+"\n";
- String _code_globals = "#define VERTEX_SHADER_GLOBALS "+cc->vertex_globals+"\n";
-
- code_string=_code_string.ascii();
- code_globals=_code_globals.ascii();
- DEBUG_PRINT( code_globals.get_data() );
- DEBUG_PRINT( code_string.get_data() );
- strings.push_back(code_globals);
- strings.push_back(code_string);
- }
-#endif
-
strings.push_back(vertex_code0.get_data());
if (cc) {
@@ -382,21 +367,6 @@ ShaderGLES3::Version *ShaderGLES3::get_current_version() {
strings.push_back("precision highp sampler2DArray;\n");
#endif
-#if 0
- if (cc) {
-
- String _code_string = "#define FRAGMENT_SHADER_CODE "+cc->fragment+"\n";
- String _code_globals = "#define FRAGMENT_SHADER_GLOBALS "+cc->fragment_globals+"\n";
-
- code_string=_code_string.ascii();
- code_globals=_code_globals.ascii();
- DEBUG_PRINT( code_globals.get_data() );
- DEBUG_PRINT( code_string.get_data() );
- strings.push_back(code_globals);
- strings.push_back(code_string);
- }
-#endif
-
strings.push_back(fragment_code0.get_data());
if (cc) {
material_string = cc->uniforms.ascii();
@@ -495,7 +465,6 @@ ShaderGLES3::Version *ShaderGLES3::get_current_version() {
if (feedbacks[i].conditional == -1 || (1 << feedbacks[i].conditional) & conditional_version.version) {
//conditional for this feedback is enabled
- print_line("tf varying: " + itos(feedback.size()) + " " + String(feedbacks[i].name));
feedback.push_back(feedbacks[i].name);
}
}
diff --git a/editor/editor_autoload_settings.cpp b/editor/editor_autoload_settings.cpp
index ae7ed7ce61..2796f776d7 100644
--- a/editor/editor_autoload_settings.cpp
+++ b/editor/editor_autoload_settings.cpp
@@ -548,34 +548,28 @@ EditorAutoloadSettings::EditorAutoloadSettings() {
HBoxContainer *hbc = memnew(HBoxContainer);
add_child(hbc);
- VBoxContainer *vbc_path = memnew(VBoxContainer);
- vbc_path->set_h_size_flags(SIZE_EXPAND_FILL);
+ Label *l = memnew(Label);
+ l->set_text(TTR("Path:"));
+ hbc->add_child(l);
autoload_add_path = memnew(EditorLineEditFileChooser);
autoload_add_path->set_h_size_flags(SIZE_EXPAND_FILL);
-
autoload_add_path->get_file_dialog()->set_mode(EditorFileDialog::MODE_OPEN_FILE);
autoload_add_path->get_file_dialog()->connect("file_selected", this, "_autoload_file_callback");
+ hbc->add_child(autoload_add_path);
- vbc_path->add_margin_child(TTR("Path:"), autoload_add_path);
- hbc->add_child(vbc_path);
-
- VBoxContainer *vbc_name = memnew(VBoxContainer);
- vbc_name->set_h_size_flags(SIZE_EXPAND_FILL);
-
- HBoxContainer *hbc_name = memnew(HBoxContainer);
+ l = memnew(Label);
+ l->set_text(TTR("Node Name:"));
+ hbc->add_child(l);
autoload_add_name = memnew(LineEdit);
autoload_add_name->set_h_size_flags(SIZE_EXPAND_FILL);
- hbc_name->add_child(autoload_add_name);
+ hbc->add_child(autoload_add_name);
Button *add_autoload = memnew(Button);
add_autoload->set_text(TTR("Add"));
- hbc_name->add_child(add_autoload);
add_autoload->connect("pressed", this, "_autoload_add");
-
- vbc_name->add_margin_child(TTR("Node Name:"), hbc_name);
- hbc->add_child(vbc_name);
+ hbc->add_child(add_autoload);
tree = memnew(Tree);
tree->set_hide_root(true);
@@ -606,5 +600,7 @@ EditorAutoloadSettings::EditorAutoloadSettings() {
tree->connect("item_edited", this, "_autoload_edited");
tree->connect("button_pressed", this, "_autoload_button_pressed");
- add_margin_child(TTR("List:"), tree, true);
+ tree->set_v_size_flags(SIZE_EXPAND_FILL);
+
+ add_child(tree, true);
}
diff --git a/editor/editor_export.cpp b/editor/editor_export.cpp
index 3585417d13..1b88a56b75 100644
--- a/editor/editor_export.cpp
+++ b/editor/editor_export.cpp
@@ -740,7 +740,24 @@ Error EditorExportPlatform::export_project_files(const Ref<EditorExportPreset> &
ProjectSettings::CustomMap custom_map;
if (path_remaps.size()) {
- custom_map["path_remap/remapped_paths"] = path_remaps;
+ if (1) { //new remap mode, use always as it's friendlier with multiple .pck exports
+ for (int i = 0; i < path_remaps.size(); i += 2) {
+ String from = path_remaps[i];
+ String to = path_remaps[i + 1];
+ String remap_file = "[remap]\n\npath=\"" + to.c_escape() + "\"\n";
+ CharString utf8 = remap_file.utf8();
+ Vector<uint8_t> new_file;
+ new_file.resize(utf8.length());
+ for (int j = 0; j < utf8.length(); j++) {
+ new_file[j] = utf8[j];
+ }
+
+ p_func(p_udata, from + ".remap", new_file, idx, total);
+ }
+ } else {
+ //old remap mode, will still work, but it's unused because it's not multiple pck export friendly
+ custom_map["path_remap/remapped_paths"] = path_remaps;
+ }
}
// Store icon and splash images directly, they need to bypass the import system and be loaded as images
diff --git a/editor/editor_help.cpp b/editor/editor_help.cpp
index 676b168371..46badc8c86 100644
--- a/editor/editor_help.cpp
+++ b/editor/editor_help.cpp
@@ -522,6 +522,19 @@ EditorHelpIndex::EditorHelpIndex() {
/// /////////////////////////////////
DocData *EditorHelp::doc = NULL;
+void EditorHelp::_init_colors() {
+
+ title_color = get_color("accent_color", "Editor");
+ text_color = get_color("default_color", "RichTextLabel");
+ headline_color = get_color("headline_color", "EditorHelp");
+ base_type_color = title_color.linear_interpolate(text_color, 0.5);
+ comment_color = Color(text_color.r, text_color.g, text_color.b, 0.6);
+ symbol_color = comment_color;
+ value_color = Color(text_color.r, text_color.g, text_color.b, 0.4);
+ qualifier_color = Color(text_color.r, text_color.g, text_color.b, 0.8);
+ type_color = get_color("accent_color", "Editor").linear_interpolate(text_color, 0.5);
+}
+
void EditorHelp::_unhandled_key_input(const Ref<InputEvent> &p_ev) {
if (!is_visible_in_tree())
@@ -654,6 +667,86 @@ void EditorHelp::_add_type(const String &p_type, const String &p_enum) {
class_desc->pop();
}
+void EditorHelp::_add_method(const DocData::MethodDoc &p_method, bool p_overview) {
+
+ method_line[p_method.name] = class_desc->get_line_count() - 2; //gets overridden if description
+
+ const bool is_vararg = p_method.qualifiers.find("vararg") != -1;
+
+ if (p_overview) {
+ class_desc->push_cell();
+ class_desc->push_align(RichTextLabel::ALIGN_RIGHT);
+ }
+
+ _add_type(p_method.return_type, p_method.return_enum);
+
+ if (p_overview) {
+ class_desc->pop(); //align
+ class_desc->pop(); //cell
+ class_desc->push_cell();
+ } else {
+ class_desc->add_text(" ");
+ }
+
+ if (p_overview && p_method.description != "") {
+ class_desc->push_meta("@method" + p_method.name);
+ }
+
+ class_desc->push_color(headline_color);
+ _add_text(p_method.name);
+ class_desc->pop();
+
+ if (p_overview && p_method.description != "") {
+ class_desc->pop(); //meta
+ }
+
+ class_desc->push_color(symbol_color);
+ class_desc->add_text(p_method.arguments.size() || is_vararg ? "( " : "(");
+ class_desc->pop();
+
+ for (int j = 0; j < p_method.arguments.size(); j++) {
+ class_desc->push_color(text_color);
+ if (j > 0)
+ class_desc->add_text(", ");
+ _add_type(p_method.arguments[j].type, p_method.arguments[j].enumeration);
+ class_desc->add_text(" ");
+ _add_text(p_method.arguments[j].name);
+ if (p_method.arguments[j].default_value != "") {
+
+ class_desc->push_color(symbol_color);
+ class_desc->add_text("=");
+ class_desc->pop();
+ _add_text(p_method.arguments[j].default_value);
+ }
+
+ class_desc->pop();
+ }
+
+ if (is_vararg) {
+ class_desc->push_color(text_color);
+ if (p_method.arguments.size())
+ class_desc->add_text(", ");
+ class_desc->push_color(symbol_color);
+ class_desc->add_text("...");
+ class_desc->pop();
+ class_desc->pop();
+ }
+
+ class_desc->push_color(symbol_color);
+ class_desc->add_text(p_method.arguments.size() || is_vararg ? " )" : ")");
+ class_desc->pop();
+ if (p_method.qualifiers != "") {
+
+ class_desc->push_color(qualifier_color);
+ class_desc->add_text(" ");
+ _add_text(p_method.qualifiers);
+ class_desc->pop();
+ }
+
+ if (p_overview)
+ class_desc->pop(); //cell
+}
+
Error EditorHelp::_goto_desc(const String &p_class, int p_vscr) {
//ERR_FAIL_COND(!doc->class_list.has(p_class));
@@ -679,15 +772,7 @@ Error EditorHelp::_goto_desc(const String &p_class, int p_vscr) {
edited_class = p_class;
//edited_class->show();
- // Colors
- const Color title_color = get_color("accent_color", "Editor");
- const Color text_color = get_color("default_color", "RichTextLabel");
- const Color headline_color = get_color("headline_color", "EditorHelp");
- const Color base_type_color = title_color.linear_interpolate(text_color, 0.5);
- const Color comment_color = Color(text_color.r, text_color.g, text_color.b, 0.6);
- const Color symbol_color = comment_color;
- const Color value_color = Color(text_color.r, text_color.g, text_color.b, 0.4);
- const Color qualifier_color = Color(text_color.r, text_color.g, text_color.b, 0.8);
+ _init_colors();
DocData::ClassDoc cd = doc->class_list[p_class]; //make a copy, so we can sort without worrying
@@ -892,78 +977,55 @@ Error EditorHelp::_goto_desc(const String &p_class, int p_vscr) {
class_desc->push_table(2);
class_desc->set_table_column_expand(1, 1);
- for (int i = 0; i < methods.size(); i++) {
-
- bool is_vararg = methods[i].qualifiers.find("vararg") != -1;
+ bool any_previous = false;
+ for (int pass = 0; pass < 2; pass++) {
+ Vector<DocData::MethodDoc> m;
- method_line[methods[i].name] = class_desc->get_line_count() - 2; //gets overridden if description
-
- class_desc->push_cell();
- class_desc->push_align(RichTextLabel::ALIGN_RIGHT);
- class_desc->push_font(doc_code_font);
- _add_type(methods[i].return_type, methods[i].return_enum);
- //class_desc->add_text(" ");
- class_desc->pop(); //align
- class_desc->pop(); //font
- class_desc->pop(); //cell
-
- class_desc->push_cell();
- class_desc->push_font(doc_code_font);
+ for (int i = 0; i < methods.size(); i++) {
+ const String &q = methods[i].qualifiers;
+ if ((pass == 0 && q.find("virtual") != -1) || (pass == 1 && q.find("virtual") == -1)) {
+ m.push_back(methods[i]);
+ }
+ }
- if (methods[i].description != "") {
- method_descr = true;
- class_desc->push_meta("@method" + methods[i].name);
+ if (any_previous && !m.empty()) {
+ class_desc->push_cell();
+ class_desc->pop(); //cell
+ class_desc->push_cell();
+ class_desc->pop(); //cell
+ any_previous = false;
}
- class_desc->push_color(headline_color);
- _add_text(methods[i].name);
- class_desc->pop();
- if (methods[i].description != "")
- class_desc->pop(); // pop meta
- class_desc->push_color(symbol_color);
- class_desc->add_text(methods[i].arguments.size() || is_vararg ? "( " : "(");
- class_desc->pop();
- for (int j = 0; j < methods[i].arguments.size(); j++) {
- class_desc->push_color(text_color);
- if (j > 0)
- class_desc->add_text(", ");
- _add_type(methods[i].arguments[j].type, methods[i].arguments[j].enumeration);
- class_desc->add_text(" ");
- _add_text(methods[i].arguments[j].name);
- if (methods[i].arguments[j].default_value != "") {
- class_desc->push_color(symbol_color);
- class_desc->add_text("=");
- class_desc->pop();
- _add_text(methods[i].arguments[j].default_value);
+ String group_prefix;
+ for (int i = 0; i < m.size(); i++) {
+ const String new_prefix = m[i].name.substr(0, 3);
+ bool is_new_group = false;
+
+ if (i < m.size() - 1 && new_prefix == m[i + 1].name.substr(0, 3) && new_prefix != group_prefix) {
+ is_new_group = i > 0;
+ group_prefix = new_prefix;
+ } else if (group_prefix != "" && new_prefix != group_prefix) {
+ is_new_group = true;
+ group_prefix = "";
}
- class_desc->pop();
- }
-
- if (is_vararg) {
- class_desc->push_color(text_color);
- if (methods[i].arguments.size())
- class_desc->add_text(", ");
- class_desc->push_color(symbol_color);
- class_desc->add_text("...");
- class_desc->pop();
- class_desc->pop();
- }
+ if (is_new_group && pass == 1) {
+ class_desc->push_cell();
+ class_desc->pop(); //cell
+ class_desc->push_cell();
+ class_desc->pop(); //cell
+ }
- class_desc->push_color(symbol_color);
- class_desc->add_text(methods[i].arguments.size() || is_vararg ? " )" : ")");
- class_desc->pop();
- if (methods[i].qualifiers != "") {
+ if (m[i].description != "") {
+ method_descr = true;
+ }
- class_desc->push_color(qualifier_color);
- class_desc->add_text(" ");
- _add_text(methods[i].qualifiers);
- class_desc->pop();
+ _add_method(m[i], true);
}
- class_desc->pop(); //monofont
- //class_desc->add_newline();
- class_desc->pop(); //cell
+
+ any_previous = !m.empty();
}
+
class_desc->pop(); //table
class_desc->pop();
class_desc->add_newline();
@@ -1366,60 +1428,7 @@ Error EditorHelp::_goto_desc(const String &p_class, int p_vscr) {
for (int i = 0; i < methods.size(); i++) {
- bool is_vararg = methods[i].qualifiers.find("vararg") != -1;
-
- method_line[methods[i].name] = class_desc->get_line_count() - 2;
-
- class_desc->push_font(doc_code_font);
- _add_type(methods[i].return_type, methods[i].return_enum);
-
- class_desc->add_text(" ");
- class_desc->push_color(headline_color);
- _add_text(methods[i].name);
- class_desc->pop();
- class_desc->push_color(symbol_color);
- class_desc->add_text(methods[i].arguments.size() || is_vararg ? "( " : "(");
- class_desc->pop();
- for (int j = 0; j < methods[i].arguments.size(); j++) {
- class_desc->push_color(text_color);
- if (j > 0)
- class_desc->add_text(", ");
- _add_type(methods[i].arguments[j].type, methods[i].arguments[j].enumeration);
- class_desc->add_text(" ");
- _add_text(methods[i].arguments[j].name);
- if (methods[i].arguments[j].default_value != "") {
-
- class_desc->push_color(symbol_color);
- class_desc->add_text("=");
- class_desc->pop();
- _add_text(methods[i].arguments[j].default_value);
- }
-
- class_desc->pop();
- }
-
- if (is_vararg) {
- class_desc->push_color(text_color);
- if (methods[i].arguments.size())
- class_desc->add_text(", ");
- class_desc->push_color(symbol_color);
- class_desc->add_text("...");
- class_desc->pop();
- class_desc->pop();
- }
-
- class_desc->push_color(symbol_color);
- class_desc->add_text(methods[i].arguments.size() || is_vararg ? " )" : ")");
- class_desc->pop();
- if (methods[i].qualifiers != "") {
-
- class_desc->push_color(qualifier_color);
- class_desc->add_text(" ");
- _add_text(methods[i].qualifiers);
- class_desc->pop();
- }
-
- class_desc->pop();
+ _add_method(methods[i], false);
class_desc->add_newline();
class_desc->push_color(text_color);
diff --git a/editor/editor_help.h b/editor/editor_help.h
index a224c7f8ee..96a3309ca3 100644
--- a/editor/editor_help.h
+++ b/editor/editor_help.h
@@ -139,6 +139,17 @@ class EditorHelp : public VBoxContainer {
String base_path;
+ Color title_color;
+ Color text_color;
+ Color headline_color;
+ Color base_type_color;
+ Color type_color;
+ Color comment_color;
+ Color symbol_color;
+ Color value_color;
+ Color qualifier_color;
+
+ void _init_colors();
void _help_callback(const String &p_topic);
void _add_text(const String &p_bbcode);
@@ -146,6 +157,7 @@ class EditorHelp : public VBoxContainer {
//void _button_pressed(int p_idx);
void _add_type(const String &p_type, const String &p_enum = String());
+ void _add_method(const DocData::MethodDoc &p_method, bool p_overview = true);
void _class_list_select(const String &p_select);
void _class_desc_select(const String &p_select);
diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp
index cb8407386d..0eb8ea6e46 100644
--- a/editor/editor_node.cpp
+++ b/editor/editor_node.cpp
@@ -444,15 +444,7 @@ void EditorNode::_fs_changed() {
continue;
if (E->get()->get_import_path() != String()) {
-//this is an imported resource, will be reloaded if reimported via the _resources_reimported() callback
-//imported resource
-#if 0
- uint64_t mt = FileAccess::get_modified_time(E->get()->get_import_path());
-
- if (mt != E->get()->get_import_last_modified_time()) {
- changed.push_back(E->get());
- }
-#endif
+ //this is an imported resource, will be reloaded if reimported via the _resources_reimported() callback
continue;
}
diff --git a/editor/editor_themes.cpp b/editor/editor_themes.cpp
index 152eda7d91..cc0b292cc4 100644
--- a/editor/editor_themes.cpp
+++ b/editor/editor_themes.cpp
@@ -999,6 +999,12 @@ Ref<Theme> create_editor_theme(const Ref<Theme> p_theme) {
theme->set_icon("bg", "ColorPickerButton", theme->get_icon("GuiMiniCheckerboard", "EditorIcons"));
+ // Information on 3D viewport
+ Ref<StyleBoxFlat> style_info_3d_viewport = style_default->duplicate();
+ style_info_3d_viewport->set_bg_color(style_info_3d_viewport->get_bg_color() * Color(1, 1, 1, 0.5));
+ style_info_3d_viewport->set_border_width_all(0);
+ theme->set_stylebox("Information3dViewport", "EditorStyles", style_info_3d_viewport);
+
// adaptive script theme constants
// for comments and elements with lower relevance
const Color dim_color = Color(font_color.r, font_color.g, font_color.b, 0.5);
diff --git a/editor/export_template_manager.cpp b/editor/export_template_manager.cpp
index cdb7256329..a72769b222 100644
--- a/editor/export_template_manager.cpp
+++ b/editor/export_template_manager.cpp
@@ -176,7 +176,7 @@ void ExportTemplateManager::_uninstall_template_confirm() {
_update_template_list();
}
-void ExportTemplateManager::_install_from_file(const String &p_file) {
+void ExportTemplateManager::_install_from_file(const String &p_file, bool p_use_progress) {
FileAccess *fa = NULL;
zlib_filefunc_def io = zipio_create_io_from_file(&fa);
@@ -259,7 +259,10 @@ void ExportTemplateManager::_install_from_file(const String &p_file) {
ret = unzGoToFirstFile(pkg);
- EditorProgress p("ltask", TTR("Extracting Export Templates"), fc);
+ EditorProgress *p = NULL;
+ if (p_use_progress) {
+ p = memnew(EditorProgress("ltask", TTR("Extracting Export Templates"), fc));
+ }
fc = 0;
@@ -270,7 +273,7 @@ void ExportTemplateManager::_install_from_file(const String &p_file) {
char fname[16384];
unzGetCurrentFileInfo(pkg, &info, fname, 16384, NULL, 0, NULL, 0);
- String file = fname;
+ String file = String(fname).get_file();
Vector<uint8_t> data;
data.resize(info.uncompressed_size);
@@ -280,20 +283,18 @@ void ExportTemplateManager::_install_from_file(const String &p_file) {
unzReadCurrentFile(pkg, data.ptrw(), data.size());
unzCloseCurrentFile(pkg);
- print_line(fname);
- /*
- for(int i=0;i<512;i++) {
- print_line(itos(data[i]));
+ if (p) {
+ p->step(TTR("Importing:") + " " + file, fc);
}
- */
-
- file = file.get_file();
-
- p.step(TTR("Importing:") + " " + file, fc);
FileAccess *f = FileAccess::open(template_path.plus_file(file), FileAccess::WRITE);
- ERR_CONTINUE(!f);
+ if (!f) {
+ ret = unzGoToNextFile(pkg);
+ fc++;
+ ERR_CONTINUE(!f);
+ }
+
f->store_buffer(data.ptr(), data.size());
memdelete(f);
@@ -302,6 +303,10 @@ void ExportTemplateManager::_install_from_file(const String &p_file) {
fc++;
}
+ if (p) {
+ memdelete(p);
+ }
+
unzClose(pkg);
_update_template_list();
@@ -405,7 +410,7 @@ void ExportTemplateManager::_http_download_templates_completed(int p_status, int
memdelete(f);
template_list_state->set_text(TTR("Download Complete."));
template_downloader->hide();
- _install_from_file(path);
+ _install_from_file(path, false);
}
}
} break;
@@ -547,7 +552,7 @@ ExportTemplateManager::ExportTemplateManager() {
template_open->add_filter("*.tpz ; Godot Export Templates");
template_open->set_access(FileDialog::ACCESS_FILESYSTEM);
template_open->set_mode(FileDialog::MODE_OPEN_FILE);
- template_open->connect("file_selected", this, "_install_from_file");
+ template_open->connect("file_selected", this, "_install_from_file", varray(true));
add_child(template_open);
set_title(TTR("Export Template Manager"));
diff --git a/editor/export_template_manager.h b/editor/export_template_manager.h
index 644c6b466b..36093da66a 100644
--- a/editor/export_template_manager.h
+++ b/editor/export_template_manager.h
@@ -69,7 +69,7 @@ class ExportTemplateManager : public ConfirmationDialog {
void _uninstall_template_confirm();
virtual void ok_pressed();
- void _install_from_file(const String &p_file);
+ void _install_from_file(const String &p_file, bool p_use_progress = true);
void _http_download_mirror_completed(int p_status, int p_code, const PoolStringArray &headers, const PoolByteArray &p_data);
void _http_download_templates_completed(int p_status, int p_code, const PoolStringArray &headers, const PoolByteArray &p_data);
diff --git a/editor/icons/SCsub b/editor/icons/SCsub
index e28c229a38..0e4a4796ec 100644
--- a/editor/icons/SCsub
+++ b/editor/icons/SCsub
@@ -49,6 +49,9 @@ def make_editor_icons_action(target, source, env):
fname = str(f)
icon_name = os.path.basename(fname)[5:-4].title().replace("_", "")
+ # some special cases
+ if icon_name in ['Int', 'Bool', 'Float']:
+ icon_name = icon_name.lower()
if icon_name.endswith("MediumThumb"): # dont know a better way to handle this
thumb_medium_indices.append(str(index))
if icon_name.endswith("BigThumb"): # dont know a better way to handle this
diff --git a/editor/icons/icon_GUI_visibility_hidden.svg b/editor/icons/icon_GUI_visibility_hidden.svg
index 61131c77c8..7b7f3c8031 100644
--- a/editor/icons/icon_GUI_visibility_hidden.svg
+++ b/editor/icons/icon_GUI_visibility_hidden.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="m7.9998 2c-2.5567 0-5.7907 1.9477-6.9551 5.7051a1.0001 1.0001 0 0 0 -0.00586 0.5703c1.1244 3.9354 4.4609 5.7246 6.9609 5.7246s5.8365-1.7892 6.9609-5.7246a1.0001 1.0001 0 0 0 0 -0.5527c-1.1003-3.7876-4.4066-5.7227-6.9609-5.7227zm0 2a4 4 0 0 1 4 4 4 4 0 0 1 -4 4 4 4 0 0 1 -4 -4 4 4 0 0 1 4 -4zm0 2a2 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" color="#000000" color-rendering="auto" fill="#e0e0e0" fill-opacity=".39216" fill-rule="evenodd" image-rendering="auto" shape-rendering="auto" solid-color="#000000" style="isolation:auto;mix-blend-mode:normal;text-decoration-color:#000000;text-decoration-line:none;text-decoration-style:solid;text-indent:0;text-transform:none;white-space:normal"/>
+<path d="m2.9609 7.7266-1.9219 0.54883c0.31999 1.12 0.8236 2.0593 1.4316 2.8398l-0.83398 0.83398 1.4141 1.4141 0.84375-0.84375c0.98585 0.74762 2.0766 1.2067 3.1055 1.3867v1.0938h2v-1.0938c1.0288-0.17998 2.1196-0.6391 3.1055-1.3867l0.84375 0.84375 1.4141-1.4141-0.83398-0.83398c0.60804-0.78055 1.1117-1.7199 1.4316-2.8398l-1.9219-0.54883c-0.8756 3.0646-3.5391 4.2734-5.0391 4.2734s-4.1635-1.2088-5.0391-4.2734z" color="#000000" color-rendering="auto" dominant-baseline="auto" fill="#e0e0e0" fill-opacity=".99608" fill-rule="evenodd" 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_mini_aabb.svg b/editor/icons/icon_a_a_b_b.svg
index 1af05f9b68..1af05f9b68 100644
--- a/editor/icons/icon_mini_aabb.svg
+++ b/editor/icons/icon_a_a_b_b.svg
diff --git a/editor/icons/icon_mini_array.svg b/editor/icons/icon_array.svg
index 4a279bf87b..4a279bf87b 100644
--- a/editor/icons/icon_mini_array.svg
+++ b/editor/icons/icon_array.svg
diff --git a/editor/icons/icon_basis.svg b/editor/icons/icon_basis.svg
new file mode 100644
index 0000000000..e9bee04f56
--- /dev/null
+++ b/editor/icons/icon_basis.svg
@@ -0,0 +1,4 @@
+<svg width="16" height="12" version="1.1" viewBox="0 0 16 12" xmlns="http://www.w3.org/2000/svg">
+<path d="m0 2v8h2a3 3 0 0 0 3 -3 3 3 0 0 0 -3 -3v-2zm10 0v2h2v-2zm-3 2a2 2 0 0 0 -1.7324 1 2 2 0 0 0 0 2 2 2 0 0 0 1.7324 1h-2v2h2a2 2 0 0 0 1.7324 -1 2 2 0 0 0 0 -2 2 2 0 0 0 -1.7324 -1h2v-2zm7 0a2 2 0 0 0 -1.7324 1 2 2 0 0 0 0 2 2 2 0 0 0 1.7324 1h-2v-2h-2v4h4a2 2 0 0 0 1.7324 -1 2 2 0 0 0 0 -2 2 2 0 0 0 -1.7324 -1h2v-2zm-12 2a1 1 0 0 1 1 1 1 1 0 0 1 -1 1z" fill="#e3ec69"/>
+<path d="m10 2v2h2v-2zm0 4v4h2v-4z" fill="#fff" fill-opacity=".39216"/>
+</svg>
diff --git a/editor/icons/icon_bool.svg b/editor/icons/icon_bool.svg
new file mode 100644
index 0000000000..c4c919dfca
--- /dev/null
+++ b/editor/icons/icon_bool.svg
@@ -0,0 +1,3 @@
+<svg width="16" height="12" version="1.1" viewBox="0 0 16 12" xmlns="http://www.w3.org/2000/svg">
+<path d="m0 2v8h2a3 3 0 0 0 2.5 -1.3457 3 3 0 0 0 2.5 1.3457 3 3 0 0 0 2 -0.76758 3 3 0 0 0 2 0.76758 3 3 0 0 0 2.5 -1.3457 3 3 0 0 0 2.5 1.3457v-2a1 1 0 0 1 -1 -1v-5h-2v2.7695a3 3 0 0 0 -2 -0.76953 3 3 0 0 0 -2 0.76758 3 3 0 0 0 -2 -0.76758 3 3 0 0 0 -2.5 1.3457 3 3 0 0 0 -2.5 -1.3457v-2zm2 4a1 1 0 0 1 1 1 1 1 0 0 1 -1 1zm5 0a1 1 0 0 1 1 1 1 1 0 0 1 -1 1 1 1 0 0 1 -1 -1 1 1 0 0 1 1 -1zm4 0a1 1 0 0 1 1 1 1 1 0 0 1 -1 1 1 1 0 0 1 -1 -1 1 1 0 0 1 1 -1z" fill="#8da6f0"/>
+</svg>
diff --git a/editor/icons/icon_color.svg b/editor/icons/icon_color.svg
new file mode 100644
index 0000000000..52c7890e60
--- /dev/null
+++ b/editor/icons/icon_color.svg
@@ -0,0 +1,7 @@
+<svg width="16" height="12" version="1.1" viewBox="0 0 16 12" xmlns="http://www.w3.org/2000/svg">
+<g>
+<path d="m4 4a3 3 0 0 0 -3 3 3 3 0 0 0 3 3h1v-2h-1a1 1 0 0 1 -1 -1 1 1 0 0 1 1 -1h1v-2z" fill="#ff8484"/>
+<path d="m14 4a3 3 0 0 0 -3 3v3h2v-3a1 1 0 0 1 1 -1h1v-2z" fill="#84c2ff"/>
+<path d="m6 2v5a3 3 0 0 0 3 3h1v-2h-1a1 1 0 0 1 -1 -1v-5z" fill="#84ffb1"/>
+</g>
+</svg>
diff --git a/editor/icons/icon_dictionary.svg b/editor/icons/icon_dictionary.svg
new file mode 100644
index 0000000000..b0146bb5d3
--- /dev/null
+++ b/editor/icons/icon_dictionary.svg
@@ -0,0 +1,3 @@
+<svg width="16" height="12" version="1.1" viewBox="0 0 16 12" xmlns="http://www.w3.org/2000/svg">
+<path d="m3 2v2a3 3 0 0 0 -3 3 3 3 0 0 0 3 3h2v-8h-2zm3 0v2h2v-2h-2zm7 0v5a3 3 0 0 0 3 3v-2a1 1 0 0 1 -1 -1v-1h1v-2h-1v-2h-2zm-2 2a3 3 0 0 0 -3 3 3 3 0 0 0 3 3h1v-2h-1a1 1 0 0 1 -1 -1 1 1 0 0 1 1 -1h1v-2h-1zm-3 3v-1h-2v4h2v-3zm-5-1v2a1 1 0 0 1 -1 -1 1 1 0 0 1 1 -1z" fill="#77edb1"/>
+</svg>
diff --git a/editor/icons/icon_float.svg b/editor/icons/icon_float.svg
new file mode 100644
index 0000000000..4091101fd1
--- /dev/null
+++ b/editor/icons/icon_float.svg
@@ -0,0 +1,3 @@
+<svg width="16" height="12" version="1.1" viewBox="0 0 16 12" xmlns="http://www.w3.org/2000/svg">
+<path d="m3 2a3 3 0 0 0 -3 3v5h2v-2h2v-2h-2v-1a1 1 0 0 1 1 -1h1v-2zm3 0v5a3 3 0 0 0 3 3h1v-2h-1a1 1 0 0 1 -1 -1v-5zm6 0v5a3 3 0 0 0 3 3h1v-2h-1a1 1 0 0 1 -1 -1v-1h2v-2h-2v-2z" fill="#61daf4"/>
+</svg>
diff --git a/editor/icons/icon_int.svg b/editor/icons/icon_int.svg
new file mode 100644
index 0000000000..e16bb2ec07
--- /dev/null
+++ b/editor/icons/icon_int.svg
@@ -0,0 +1,3 @@
+<svg width="16" height="12" version="1.1" viewBox="0 0 16 12" xmlns="http://www.w3.org/2000/svg">
+<path d="m1 2v2h2v-2zm11 0v5a3 3 0 0 0 3 3h1v-2h-1a1 1 0 0 1 -1 -1v-1h2v-2h-2v-2zm-8 2v6h2v-4h1a1 1 0 0 1 1 1v3h2v-3a3 3 0 0 0 -3 -3h-1zm-3 2v4h2v-4z" fill="#7dc6ef"/>
+</svg>
diff --git a/editor/icons/icon_kinematic_body.svg b/editor/icons/icon_kinematic_body.svg
index 6f8d69fa53..c5f817c68c 100644
--- a/editor/icons/icon_kinematic_body.svg
+++ b/editor/icons/icon_kinematic_body.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="m6 1c-0.55401 0-1 0.44599-1 1v3c0 0.55401 0.44599 1 1 1h1v0.99023a1.0001 1.0001 0 0 0 -0.31641 0.0625l-2.0508 0.68359-0.68359-2.0508a1.0001 1.0001 0 0 0 -0.99023 -0.69727 1.0001 1.0001 0 0 0 -0.9082 1.3281l1 3a1.0001 1.0001 0 0 0 1.2656 0.63281l1.6836-0.56055v0.61133c0 0.040884 0.018715 0.075662 0.023438 0.11523l-4.5781 3.0527a1.0001 1.0001 0 1 0 1.1094 1.6641l5.0566-3.3711 1.4941 2.9863a1.0001 1.0001 0 0 0 1.2109 0.50195l3-1a1.0001 1.0001 0 1 0 -0.63281 -1.8965l-2.1777 0.72461-0.97461-1.9512c0.2759-0.17764 0.46875-0.47227 0.46875-0.82617v-1h1.3828l0.72266 1.4473a1.0001 1.0001 0 1 0 1.7891 -0.89453l-1-2a1.0001 1.0001 0 0 0 -0.89453 -0.55273h-3v-1h1c0.55401 0 1-0.44599 1-1v-3c0-0.55401-0.44599-1-1-1h-4zm0 2h1v2h-1v-2z" fill="#fc9c9c" fill-opacity=".99608"/>
-</g>
+<path d="m6 1c-0.55401 0-1 0.44599-1 1v3c0 0.55401 0.44599 1 1 1h1v0.99023a1.0001 1.0001 0 0 0 -0.31641 0.0625l-2.0508 0.68359-0.68359-2.0508a1.0001 1.0001 0 0 0 -0.99023 -0.69727 1.0001 1.0001 0 0 0 -0.9082 1.3281l1 3a1.0001 1.0001 0 0 0 1.2656 0.63281l1.6836-0.56055v0.61133c0 0.04088 0.018715 0.07566 0.023437 0.11523l-4.5781 3.0527a1.0001 1.0001 0 1 0 1.1094 1.6641l5.0566-3.3711 1.4941 2.9863a1.0001 1.0001 0 0 0 1.2109 0.50195l3-1a1.0001 1.0001 0 1 0 -0.63281 -1.8965l-2.1777 0.72461-0.97461-1.9512c0.2759-0.17764 0.46875-0.47227 0.46875-0.82617v-1h1.3828l0.72266 1.4473a1.0001 1.0001 0 1 0 1.7891 -0.89453l-1-2a1.0001 1.0001 0 0 0 -0.89453 -0.55273h-3v-1h1c0.55401 0 1-0.44599 1-1v-3c0-0.55401-0.44599-1-1-1zm0 2h1v2h-1z" fill="#fc9c9c" fill-opacity=".99608"/>
</svg>
diff --git a/editor/icons/icon_kinematic_body_2d.svg b/editor/icons/icon_kinematic_body_2d.svg
index 0441e499c0..cac3ac7684 100644
--- a/editor/icons/icon_kinematic_body_2d.svg
+++ b/editor/icons/icon_kinematic_body_2d.svg
@@ -1,7 +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)">
-<g transform="translate(.49212 -.0044019)" fill="#a5b7f3">
-<path transform="translate(0 1036.4)" d="m6 1c-0.55401 0-1 0.44599-1 1v3c0 0.55401 0.44599 1 1 1h1v0.99023a1.0001 1.0001 0 0 0 -0.31641 0.0625l-2.0508 0.68359-0.68359-2.0508a1.0001 1.0001 0 0 0 -0.99023 -0.69727 1.0001 1.0001 0 0 0 -0.9082 1.3281l1 3a1.0001 1.0001 0 0 0 1.2656 0.63281l1.6836-0.56055v0.61133c0 0.04088 0.018715 0.07566 0.023437 0.11523l-4.5781 3.0527a1.0001 1.0001 0 1 0 1.1094 1.6641l5.0566-3.3711 1.4941 2.9863a1.0001 1.0001 0 0 0 1.2109 0.50195l3-1a1.0001 1.0001 0 1 0 -0.63281 -1.8965l-2.1777 0.72461-0.97461-1.9512c0.2759-0.17764 0.46875-0.47227 0.46875-0.82617v-1h1.3828l0.72266 1.4473a1.0001 1.0001 0 1 0 1.7891 -0.89453l-1-2a1.0001 1.0001 0 0 0 -0.89453 -0.55273h-3v-1h1c0.55401 0 1-0.44599 1-1v-3c0-0.55401-0.44599-1-1-1zm0 2h1v2h-1z" fill="#a5b7f3"/>
-</g>
-</g>
+<path d="m6.4921 1c-0.55401 0-1 0.446-1 1v3c0 0.554 0.44599 1 1 1h1v0.9902a1.0001 1.0001 0 0 0 -0.31641 0.062l-2.0508 0.6836-0.68359-2.0508a1.0001 1.0001 0 0 0 -0.99023 -0.6972 1.0001 1.0001 0 0 0 -0.9082 1.3281l1 3a1.0001 1.0001 0 0 0 1.2656 0.6328l1.6836-0.5605v0.6113c0 0.041 0.018715 0.076 0.023437 0.1152l-4.5781 3.0528a1.0001 1.0001 0 1 0 1.1094 1.664l5.0566-3.3711 1.4941 2.9864a1.0001 1.0001 0 0 0 1.2109 0.5019l3-1a1.0001 1.0001 0 1 0 -0.63281 -1.8965l-2.1777 0.7246-0.97461-1.9511c0.2759-0.1777 0.46875-0.4723 0.46875-0.8262v-1h1.3828l0.72266 1.4473a1.0001 1.0001 0 1 0 1.7891 -0.8946l-1-2a1.0001 1.0001 0 0 0 -0.89453 -0.5527h-3v-1h1c0.55401 0 1-0.446 1-1v-3c0-0.554-0.44599-1-1-1zm0 2h1v2h-1z" fill="#a5b7f3"/>
</svg>
diff --git a/editor/icons/icon_match_case.svg b/editor/icons/icon_match_case.svg
new file mode 100644
index 0000000000..2958933aca
--- /dev/null
+++ b/editor/icons/icon_match_case.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="m4 1c-2.2091-6.6e-7 -4.069 1.7919-4 4v10h2v-4h4v4h2v-10c0-2.2091-1.7909-4-4-4zm5 11c0 1.6569 1.3431 3 3 3 0.3409-0.0014 0.67908-0.0608 1-0.17578v0.17578h2v-6c0-1.6569-1.3431-3-3-3h-1v2h1c0.55228 0 1 0.44772 1 1v0.17383c-0.32104-0.11432-0.65921-0.1731-1-0.17383-1.6569 0-3 1.3431-3 3zm-5-9c1.1046-1e-7 1.914 0.89879 2 2v4h-4v-4c0-1.1046 0.89543-2 2-2zm8 8c0.55228 0 1 0.44772 1 1s-0.44772 1-1 1-1-0.44772-1-1 0.44772-1 1-1z" fill="#e0e0e0" stroke-width="0"/>
+</svg>
diff --git a/editor/icons/icon_member_constant.svg b/editor/icons/icon_member_constant.svg
new file mode 100644
index 0000000000..0f8c6966c4
--- /dev/null
+++ b/editor/icons/icon_member_constant.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="m10.135 3.002c-1.5244-0.04132-2.9843 0.61528-3.9648 1.7832-1.5607 1.8591-1.5607 4.5706 0 6.4297 1.5599 1.8584 4.229 2.3286 6.3301 1.1152l-1.0039-1.7363c-0.45449 0.26416-0.97042 0.40425-1.4961 0.40625-1.6569 0-3-1.3431-3-3-1e-7 -1.6569 1.3431-3 3-3 0.5255 0.0014061 1.0414 0.14082 1.4961 0.4043l1.0039-1.7344c-0.72056-0.41598-1.5335-0.64557-2.3652-0.66797zm-7.1348 7.998c-0.55228 0-1 0.44772-1 1-1e-7 0.55228 0.44772 1 1 1s1-0.44772 1-1c1e-7 -0.55228-0.44772-1-1-1z" fill="#e0e0e0" stroke-width="0"/>
+</svg>
diff --git a/editor/icons/icon_member_method.svg b/editor/icons/icon_member_method.svg
new file mode 100644
index 0000000000..57c93339b6
--- /dev/null
+++ b/editor/icons/icon_member_method.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="m6.0215 3c-0.40133-0.0028518-0.79916 0.074854-1.1699 0.22852-1.1208 0.46444-1.8516 1.5582-1.8516 2.7715v7h2v-3h2v-2h-2v-2c0-0.55228 0.44772-1 1-1 0.2652 4.01e-5 0.51953 0.10542 0.70703 0.29297l1.4141-1.4141c-0.55724-0.5574-1.3115-0.87312-2.0996-0.87891zm2.9785 3c-1.3263 2.6586-1.3404 4.3252 0 7h2c-1.3404-2.6748-1.3263-4.3414 0-7h-2zm4 0c1.3263 2.6586 1.3404 4.3252 0 7h2c1.3404-2.6748 1.3263-4.3414 0-7h-2zm-12 5a1 1 0 0 0 -1 1 1 1 0 0 0 1 1 1 1 0 0 0 1 -1 1 1 0 0 0 -1 -1z" fill="#e0e0e0" stroke-width="0"/>
+</svg>
diff --git a/editor/icons/icon_member_property.svg b/editor/icons/icon_member_property.svg
new file mode 100644
index 0000000000..918d0a64e9
--- /dev/null
+++ b/editor/icons/icon_member_property.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="m7 4v9h2v-3h1c1.6569 0 3-1.3431 3-3s-1.3431-3-3-3zm2 2h1c0.55228 0 1 0.44772 1 1s-0.44798 0.98275-1 1h-1zm-5 5c-0.55228 0-1 0.44772-1 1-1e-7 0.55228 0.44772 1 1 1s1-0.44772 1-1c1e-7 -0.55228-0.44772-1-1-1z" fill="#e0e0e0" stroke-width="0"/>
+</svg>
diff --git a/editor/icons/icon_member_signal.svg b/editor/icons/icon_member_signal.svg
new file mode 100644
index 0000000000..2957cbbc50
--- /dev/null
+++ b/editor/icons/icon_member_signal.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="m6 1a1 1 0 0 0 -1 1 1 1 0 0 0 1 1c4.4301 0 8 3.5699 8 8a1 1 0 0 0 1 1 1 1 0 0 0 1 -1c0-5.511-4.489-10-10-10zm0 4a1 1 0 0 0 -1 1 1 1 0 0 0 1 1c2.221 0 4 1.779 4 4a1 1 0 0 0 1 1 1 1 0 0 0 1 -1c0-3.3018-2.6981-6-6-6zm0 4a2 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-5 2c-0.55228 0-1 0.44772-1 1-1e-7 0.55228 0.44772 1 1 1s1-0.44772 1-1c1e-7 -0.55228-0.44772-1-1-1z" fill="#e0e0e0" stroke-width="0"/>
+</svg>
diff --git a/editor/icons/icon_member_theme.svg b/editor/icons/icon_member_theme.svg
new file mode 100644
index 0000000000..880450abae
--- /dev/null
+++ b/editor/icons/icon_member_theme.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 fill="#e0e0e0" stroke-width="0">
+<path d="m3 11c-0.55228 0-1 0.44772-1 1-1e-7 0.55228 0.44772 1 1 1s1-0.44772 1-1c1e-7 -0.55228-0.44772-1-1-1z"/>
+<path d="m10 2c-2.4 4-4 4.7909-4 7 0 2.2091 1.8297 4 4 4 2.1703 0 4-1.7909 4-4 0-2.2091-1.6-3-4-7z"/>
+</g>
+</svg>
diff --git a/editor/icons/icon_mini_basis.svg b/editor/icons/icon_mini_basis.svg
deleted file mode 100644
index 21b4f29aa4..0000000000
--- a/editor/icons/icon_mini_basis.svg
+++ /dev/null
@@ -1,6 +0,0 @@
-<svg width="16" height="12" version="1.1" viewBox="0 0 16 12" xmlns="http://www.w3.org/2000/svg">
-<g transform="translate(0 -1040.4)">
-<path transform="translate(0 1040.4)" d="m0 2v4 4h2a3 3 0 0 0 3 -3 3 3 0 0 0 -3 -3v-2h-2zm10 0v2h2v-2h-2zm-3 2a2 2 0 0 0 -1.7324 1 2 2 0 0 0 0 2 2 2 0 0 0 1.7324 1h-2v2h2a2 2 0 0 0 1.7324 -1 2 2 0 0 0 0 -2 2 2 0 0 0 -1.7324 -1h2v-2h-2zm7 0a2 2 0 0 0 -1.7324 1 2 2 0 0 0 0 2 2 2 0 0 0 1.7324 1h-2v-2h-2v4h2 2a2 2 0 0 0 1.7324 -1 2 2 0 0 0 0 -2 2 2 0 0 0 -1.7324 -1h2v-2h-2zm-12 2a1 1 0 0 1 1 1 1 1 0 0 1 -1 1v-2z" fill="#e3ec69"/>
-<path d="m10 1042.4v2h2v-2zm0 4v4h2v-4z" fill="#fff" fill-opacity=".39216"/>
-</g>
-</svg>
diff --git a/editor/icons/icon_mini_boolean.svg b/editor/icons/icon_mini_boolean.svg
deleted file mode 100644
index b1e169d73c..0000000000
--- a/editor/icons/icon_mini_boolean.svg
+++ /dev/null
@@ -1,5 +0,0 @@
-<svg width="16" height="12" version="1.1" viewBox="0 0 16 12" xmlns="http://www.w3.org/2000/svg">
-<g transform="translate(0 -1040.4)">
-<path transform="translate(0 1040.4)" d="m0 2v4 4h2a3 3 0 0 0 2.5 -1.3457 3 3 0 0 0 2.5 1.3457 3 3 0 0 0 2 -0.76758 3 3 0 0 0 2 0.76758 3 3 0 0 0 2.5 -1.3457 3 3 0 0 0 2.5 1.3457v-2a1 1 0 0 1 -1 -1v-5h-2v2.7695a3 3 0 0 0 -2 -0.76953 3 3 0 0 0 -2 0.76758 3 3 0 0 0 -2 -0.76758 3 3 0 0 0 -2.5 1.3457 3 3 0 0 0 -2.5 -1.3457v-2h-2zm2 4a1 1 0 0 1 1 1 1 1 0 0 1 -1 1v-2zm5 0a1 1 0 0 1 1 1 1 1 0 0 1 -1 1 1 1 0 0 1 -1 -1 1 1 0 0 1 1 -1zm4 0a1 1 0 0 1 1 1 1 1 0 0 1 -1 1 1 1 0 0 1 -1 -1 1 1 0 0 1 1 -1z" fill="#8da6f0"/>
-</g>
-</svg>
diff --git a/editor/icons/icon_mini_color.svg b/editor/icons/icon_mini_color.svg
deleted file mode 100644
index 623f922158..0000000000
--- a/editor/icons/icon_mini_color.svg
+++ /dev/null
@@ -1,7 +0,0 @@
-<svg width="16" height="12" version="1.1" viewBox="0 0 16 12" xmlns="http://www.w3.org/2000/svg">
-<g transform="translate(0 -1040.4)">
-<path transform="translate(0 1040.4)" d="m4 4a3 3 0 0 0 -3 3 3 3 0 0 0 3 3h1v-2h-1a1 1 0 0 1 -1 -1 1 1 0 0 1 1 -1h1v-2h-1z" fill="#ff8484"/>
-<path transform="translate(0 1040.4)" d="m14 4a3 3 0 0 0 -3 3v3h2v-3a1 1 0 0 1 1 -1h1v-2h-1z" fill="#84c2ff"/>
-<path transform="translate(0 1040.4)" d="m6 2v5a3 3 0 0 0 3 3h1v-2h-1a1 1 0 0 1 -1 -1v-5h-2z" fill="#84ffb1"/>
-</g>
-</svg>
diff --git a/editor/icons/icon_mini_color_array.svg b/editor/icons/icon_mini_color_array.svg
deleted file mode 100644
index 2a5588a698..0000000000
--- a/editor/icons/icon_mini_color_array.svg
+++ /dev/null
@@ -1,14 +0,0 @@
-<svg width="16" height="12" version="1.1" viewBox="0 0 16 12" xmlns="http://www.w3.org/2000/svg">
-<g transform="translate(0 -1040.4)">
-<rect y="1050.4" width="4" height="2" fill="#e0e0e0"/>
-<rect y="1040.4" width="2" height="12" fill="#e0e0e0"/>
-<rect y="1040.4" width="4" height="2" fill="#e0e0e0"/>
-<rect transform="scale(-1,1)" x="-16" y="1050.4" width="4" height="2" fill="#e0e0e0"/>
-<rect transform="scale(-1,1)" x="-16" y="1040.4" width="2" height="12" fill="#e0e0e0"/>
-<rect transform="scale(-1,1)" x="-16" y="1040.4" width="4" height="2" fill="#e0e0e0"/>
-<path transform="translate(0 1040.4)" d="m6 3.5a3 3 0 0 0 -3 3 3 3 0 0 0 3 3h1v-2h-1a1 1 0 0 1 -1 -1 1 1 0 0 1 1 -1h1v-2h-1z" fill="#ff7070"/>
-<rect x="10" y="1046.9" width="2" height="3" fill="#70bfff"/>
-<path d="m13 1043.9a3 3 0 0 0 -3 3h2a1 1 0 0 1 1 -1v-2z" fill="#70bfff"/>
-<path transform="translate(0 1040.4)" d="m7 1.5v5a3 3 0 0 0 3 3v-2a1 1 0 0 1 -1 -1v-5h-2z" fill="#7aff70"/>
-</g>
-</svg>
diff --git a/editor/icons/icon_mini_dictionary.svg b/editor/icons/icon_mini_dictionary.svg
deleted file mode 100644
index 814f27e2f9..0000000000
--- a/editor/icons/icon_mini_dictionary.svg
+++ /dev/null
@@ -1,5 +0,0 @@
-<svg width="16" height="12" version="1.1" viewBox="0 0 16 12" xmlns="http://www.w3.org/2000/svg">
-<g transform="translate(0 -1040.4)">
-<path transform="translate(0 1040.4)" d="m3 2v2a3 3 0 0 0 -3 3 3 3 0 0 0 3 3h2v-8h-2zm3 0v2h2v-2h-2zm7 0v5a3 3 0 0 0 3 3v-2a1 1 0 0 1 -1 -1v-1h1v-2h-1v-2h-2zm-2 2a3 3 0 0 0 -3 3 3 3 0 0 0 3 3h1v-2h-1a1 1 0 0 1 -1 -1 1 1 0 0 1 1 -1h1v-2h-1zm-3 3v-1h-2v4h2v-3zm-5-1v2a1 1 0 0 1 -1 -1 1 1 0 0 1 1 -1z" fill="#77edb1"/>
-</g>
-</svg>
diff --git a/editor/icons/icon_mini_float.svg b/editor/icons/icon_mini_float.svg
deleted file mode 100644
index 68f09ef07a..0000000000
--- a/editor/icons/icon_mini_float.svg
+++ /dev/null
@@ -1,5 +0,0 @@
-<svg width="16" height="12" version="1.1" viewBox="0 0 16 12" xmlns="http://www.w3.org/2000/svg">
-<g transform="translate(0 -1040.4)">
-<path transform="translate(0 1040.4)" d="m3 2a3 3 0 0 0 -3 3v5h2v-2h2v-2h-2v-1a1 1 0 0 1 1 -1h1v-2h-1zm3 0v5a3 3 0 0 0 3 3h1v-2h-1a1 1 0 0 1 -1 -1v-5h-2zm6 0v5a3 3 0 0 0 3 3h1v-2h-1a1 1 0 0 1 -1 -1v-1h2v-2h-2v-2h-2z" fill="#61daf4"/>
-</g>
-</svg>
diff --git a/editor/icons/icon_mini_float_array.svg b/editor/icons/icon_mini_float_array.svg
deleted file mode 100644
index 3e3c88cc99..0000000000
--- a/editor/icons/icon_mini_float_array.svg
+++ /dev/null
@@ -1,7 +0,0 @@
-<svg width="16" height="12" version="1.1" viewBox="0 0 16 12" xmlns="http://www.w3.org/2000/svg">
-<g transform="translate(0 -1040.4)">
-<path transform="translate(0 1040.4)" d="m0 0v2 8 2h4v-2h-2v-8h2v-2h-2-2zm12 0v2h2v8h-2v2h4v-2-10h-4z" fill="#e0e0e0"/>
-<path transform="translate(0 1040.4)" d="m6 2a3 3 0 0 0 -3 3v5h2v-2h1v-2h-1v-1a1 1 0 0 1 1 -1v-2zm1 0v5a3 3 0 0 0 3 3v-2a1 1 0 0 1 -1 -1v-5h-2zm3 0v5a3 3 0 0 0 3 3v-2a1 1 0 0 1 -1 -1v-1h1v-2h-1v-2h-2z" fill="#61daf4"/>
-<path d="m7 1042.4v5a3 3 0 0 0 3 3v-2a1 1 0 0 1 -1 -1v-5h-2z" fill="#fff" fill-opacity=".39216"/>
-</g>
-</svg>
diff --git a/editor/icons/icon_mini_int_array.svg b/editor/icons/icon_mini_int_array.svg
deleted file mode 100644
index 04957c8d4b..0000000000
--- a/editor/icons/icon_mini_int_array.svg
+++ /dev/null
@@ -1,7 +0,0 @@
-<svg width="16" height="12" version="1.1" viewBox="0 0 16 12" xmlns="http://www.w3.org/2000/svg">
-<g transform="translate(0 -1040.4)">
-<path transform="translate(0 1040.4)" d="m0 0v2 8 2h2 2v-2h-2v-8h2v-2h-4zm12 0v2h2v8h-2v2h4v-2-8-2h-2-2z" fill="#e0e0e0"/>
-<path transform="translate(0 1040.4)" d="m3 2v2h2v-2h-2zm2 2v2h-2v4h2 2v-4a1 1 0 0 1 1 1v3h2v-3a3 3 0 0 0 -3 -3h-2zm5 3a3 3 0 0 0 3 3v-2a1 1 0 0 1 -1 -1v-1h1v-2h-1v-2h-2v5z" fill="#7dc6ef"/>
-<path transform="translate(0 1040.4)" d="m5 4v6h2v-4a1 1 0 0 1 1 1v3h2v-3a3 3 0 0 0 -3 -3h-2z" fill="#fff" fill-opacity=".39216"/>
-</g>
-</svg>
diff --git a/editor/icons/icon_mini_integer.svg b/editor/icons/icon_mini_integer.svg
deleted file mode 100644
index 3bfe95980d..0000000000
--- a/editor/icons/icon_mini_integer.svg
+++ /dev/null
@@ -1,5 +0,0 @@
-<svg width="16" height="12" version="1.1" viewBox="0 0 16 12" xmlns="http://www.w3.org/2000/svg">
-<g transform="translate(0 -1040.4)">
-<path transform="translate(0 1040.4)" d="m1 2v2h2v-2h-2zm11 0v5a3 3 0 0 0 3 3h1v-2h-1a1 1 0 0 1 -1 -1v-1h2v-2h-2v-2h-2zm-8 2v6h2v-4h1a1 1 0 0 1 1 1v3h2v-3a3 3 0 0 0 -3 -3h-1-2zm-3 2v4h2v-4h-2z" fill="#7dc6ef"/>
-</g>
-</svg>
diff --git a/editor/icons/icon_mini_object.svg b/editor/icons/icon_mini_object.svg
index a59808b970..ffac2061c5 100644
--- a/editor/icons/icon_mini_object.svg
+++ b/editor/icons/icon_mini_object.svg
@@ -1,5 +1,3 @@
<svg width="16" height="12" version="1.1" viewBox="0 0 16 12" xmlns="http://www.w3.org/2000/svg">
-<g transform="translate(0 -1040.4)">
-<path transform="translate(0 1040.4)" d="m6 2v5 3h2a3 3 0 0 0 3 -3 3 3 0 0 0 -3 -3v-2h-2zm0 5a3 3 0 0 0 -3 -3 3 3 0 0 0 -3 3 3 3 0 0 0 3 3 3 3 0 0 0 3 -3zm7-3v5a1 1 0 0 1 -1 1h-1v2h1a3 3 0 0 0 3 -3v-5h-2zm-10 2a1 1 0 0 1 1 1 1 1 0 0 1 -1 1 1 1 0 0 1 -1 -1 1 1 0 0 1 1 -1zm5 0a1 1 0 0 1 1 1 1 1 0 0 1 -1 1v-2z" fill="#79f3e8"/>
-</g>
+<path d="m6 2v8h2a3 3 0 0 0 3 -3 3 3 0 0 0 -3 -3v-2zm0 5a3 3 0 0 0 -3 -3 3 3 0 0 0 -3 3 3 3 0 0 0 3 3 3 3 0 0 0 3 -3zm7-3v5a1 1 0 0 1 -1 1h-1v2h1a3 3 0 0 0 3 -3v-5zm-10 2a1 1 0 0 1 1 1 1 1 0 0 1 -1 1 1 1 0 0 1 -1 -1 1 1 0 0 1 1 -1zm5 0a1 1 0 0 1 1 1 1 1 0 0 1 -1 1z" fill="#79f3e8"/>
</svg>
diff --git a/editor/icons/icon_mini_path.svg b/editor/icons/icon_mini_path.svg
deleted file mode 100644
index 4c99ad8cc0..0000000000
--- a/editor/icons/icon_mini_path.svg
+++ /dev/null
@@ -1,5 +0,0 @@
-<svg width="16" height="12" version="1.1" viewBox="0 0 16 12" xmlns="http://www.w3.org/2000/svg">
-<g transform="translate(0 -1040.4)">
-<path transform="translate(0 1040.4)" d="m0 2v8h2v-2a3 3 0 0 0 3 -3 3 3 0 0 0 -3 -3h-2zm6 0v5a3 3 0 0 0 3 3h1v-2h-1a1 1 0 0 1 -1 -1v-1h2v-2h-2v-2h-2zm5 0v8h2v-4a1 1 0 0 1 1 1v3h2v-3a3 3 0 0 0 -3 -3v-2h-2zm-9 2a1 1 0 0 1 1 1 1 1 0 0 1 -1 1v-2z" fill="#6993ec"/>
-</g>
-</svg>
diff --git a/editor/icons/icon_mini_plane.svg b/editor/icons/icon_mini_plane.svg
deleted file mode 100644
index e02fded99f..0000000000
--- a/editor/icons/icon_mini_plane.svg
+++ /dev/null
@@ -1,5 +0,0 @@
-<svg width="16" height="12" version="1.1" viewBox="0 0 16 12" xmlns="http://www.w3.org/2000/svg">
-<g transform="translate(0 -1040.4)">
-<path transform="translate(0 1040.4)" d="m1 2v8h2v-2a3 3 0 0 0 3 -3 3 3 0 0 0 -3 -3h-2zm6 0v5a3 3 0 0 0 3 3v-2a1 1 0 0 1 -1 -1v-5h-2zm-4 2a1 1 0 0 1 1 1 1 1 0 0 1 -1 1v-2zm8 0v6h2v-4a1 1 0 0 1 1 1v3h2v-3a3 3 0 0 0 -3 -3h-2z" fill="#f77070"/>
-</g>
-</svg>
diff --git a/editor/icons/icon_mini_quat.svg b/editor/icons/icon_mini_quat.svg
deleted file mode 100644
index c705fae2b6..0000000000
--- a/editor/icons/icon_mini_quat.svg
+++ /dev/null
@@ -1,7 +0,0 @@
-<svg width="16" height="12" version="1.1" viewBox="0 0 16 12" xmlns="http://www.w3.org/2000/svg">
-<g transform="translate(0 -1040.4)">
-<path transform="translate(0 1040.4)" d="m3 3a3 3 0 0 0 -3 3 3 3 0 0 0 3 3v2h2v-2.7695a3 3 0 0 0 2 0.76953h2v-6h-2v4a1 1 0 0 1 -1 -1v-3h-1-1-1zm0 2v2a1 1 0 0 1 -1 -1 1 1 0 0 1 1 -1z" fill="#ec69a3"/>
-<path d="m4 1043.4v3a3 3 0 0 0 3 3h2v-6h-2v4a1 1 0 0 1 -1 -1v-3z" fill="#fff" fill-opacity=".39216"/>
-<path transform="translate(0 1040.4)" d="m13 1v2h-2a3 3 0 0 0 -3 3 3 3 0 0 0 3 3h2v-3a3 3 0 0 0 3 3v-2a1 1 0 0 1 -1 -1v-1h1v-2h-1v-2h-2zm-2 4v2a1 1 0 0 1 -1 -1 1 1 0 0 1 1 -1z" fill="#ec69a3"/>
-</g>
-</svg>
diff --git a/editor/icons/icon_mini_raw_array.svg b/editor/icons/icon_mini_raw_array.svg
deleted file mode 100644
index ebd6c9a225..0000000000
--- a/editor/icons/icon_mini_raw_array.svg
+++ /dev/null
@@ -1,7 +0,0 @@
-<svg width="16" height="12" version="1.1" viewBox="0 0 16 12" xmlns="http://www.w3.org/2000/svg">
-<g transform="translate(0 -1040.4)">
-<path transform="translate(0 1040.4)" d="m0 0v2 8 2h4v-2h-2v-8h2v-2h-2-2zm12 0v2h2v8h-2v2h4v-2-8-2h-2-2z" fill="#e0e0e0"/>
-<path transform="translate(0 1040.4)" d="m5 3a3 3 0 0 0 -3 3v3h2v-3a1 1 0 0 1 1 -1h1v4h2a3 3 0 0 0 1 -0.17578v0.17578h2a3 3 0 0 0 3 -3v-3h-2v3a1 1 0 0 1 -1 1v-1-3h-2v3a1 1 0 0 1 -1 1v-4h-2-1z" fill="#69ec9e"/>
-<path d="m6 1049.4v-6h2v4a1 1 0 0 0 1 -1v-3h2v3 1a1 1 0 0 0 1 -1v-3h2v3a3 3 0 0 1 -3 3h-2v-0.1758a3 3 0 0 1 -1 0.1758h-2z" fill="#fff" fill-opacity=".39216"/>
-</g>
-</svg>
diff --git a/editor/icons/icon_mini_rect2.svg b/editor/icons/icon_mini_rect2.svg
deleted file mode 100644
index 9dec66dfa1..0000000000
--- a/editor/icons/icon_mini_rect2.svg
+++ /dev/null
@@ -1,5 +0,0 @@
-<svg width="16" height="12" version="1.1" viewBox="0 0 16 12" xmlns="http://www.w3.org/2000/svg">
-<g transform="translate(0 -1040.4)">
-<path transform="translate(0 1040.4)" d="m13 2v2h-1a3 3 0 0 0 -2.5 1.3457 3 3 0 0 0 -2.5 -1.3457 3 3 0 0 0 -3 3 3 3 0 0 0 3 3h1v-2h-1a1 1 0 0 1 -1 -1h2 1a3 3 0 0 0 3 3h1v-2h-1a1 1 0 0 1 -1 -1 1 1 0 0 1 1 -1h1v1a3 3 0 0 0 3 3v-2a1 1 0 0 1 -1 -1v-1h1v-2h-1v-2h-2zm-10 2a3 3 0 0 0 -3 3v3h2v-3a1 1 0 0 1 1 -1h1v-2h-1z" fill="#f191a5"/>
-</g>
-</svg>
diff --git a/editor/icons/icon_mini_string.svg b/editor/icons/icon_mini_string.svg
deleted file mode 100644
index 17e565cd75..0000000000
--- a/editor/icons/icon_mini_string.svg
+++ /dev/null
@@ -1,5 +0,0 @@
-<svg width="16" height="12" version="1.1" viewBox="0 0 16 12" xmlns="http://www.w3.org/2000/svg">
-<g transform="translate(0 -1040.4)">
-<path transform="translate(0 1040.4)" d="m5 2a3 3 0 0 0 -3 3v2a1 1 0 0 1 -1 1h-1v2h1a3 3 0 0 0 3 -3v-2a1 1 0 0 1 1 -1h1v-2h-1zm2 0v5a3 3 0 0 0 3 3h1v-2h-1a1 1 0 0 1 -1 -1v-1h2v-2h-2v-2h-2zm8 2a3 3 0 0 0 -3 3v3h2v-3a1 1 0 0 1 1 -1h1v-2h-1z" fill="#6ba7ec"/>
-</g>
-</svg>
diff --git a/editor/icons/icon_mini_string_array.svg b/editor/icons/icon_mini_string_array.svg
deleted file mode 100644
index af81cabce4..0000000000
--- a/editor/icons/icon_mini_string_array.svg
+++ /dev/null
@@ -1,7 +0,0 @@
-<svg width="16" height="12" version="1.1" viewBox="0 0 16 12" xmlns="http://www.w3.org/2000/svg">
-<g transform="translate(0 -1040.4)">
-<path transform="translate(0 1040.4)" d="m0 0v2 8 2h2 2v-2h-2v-8h2v-2h-2-2zm12 0v2h2v8h-2v2h4v-2-10h-4z" fill="#e0e0e0"/>
-<path transform="translate(0 1040.4)" d="m7 2a3 3 0 0 0 -3 3v2a1 1 0 0 1 -1 1h-1v2h1a3 3 0 0 0 3 -3v-2a1 1 0 0 1 1 -1h1v3a3 3 0 0 0 3 3h2v-3a1 1 0 0 1 1 -1v-2a3 3 0 0 0 -3 3v1a1 1 0 0 1 -1 -1v-1h1v-2h-1v-2h-2-1z" fill="#6ba7ec"/>
-<path d="m8 1042.4v5a3 3 0 0 0 3 3v-2a1 1 0 0 1 -1 -1v-1h1v-2h-1v-2h-2z" fill="#fff" fill-opacity=".39216"/>
-</g>
-</svg>
diff --git a/editor/icons/icon_mini_transform.svg b/editor/icons/icon_mini_transform.svg
deleted file mode 100644
index 53bad91efc..0000000000
--- a/editor/icons/icon_mini_transform.svg
+++ /dev/null
@@ -1,6 +0,0 @@
-<svg width="16" height="12" version="1.1" viewBox="0 0 16 12" xmlns="http://www.w3.org/2000/svg">
-<g transform="translate(0 -1040.4)">
-<path transform="translate(0 1040.4)" d="m0 2l2 4-2 4h2l0.9082-2.1816 1.0918 2.1816h2l-2-4 2-4h-2l-0.9082 2.1816-1.0918-2.1816h-2zm6 8h2v-2h1v-2h-1v-1a1 1 0 0 1 1 -1h1v-2h-1a3 3 0 0 0 -3 3v5zm4-6v2 2 2h2v-2l1 1 1-1v2h2v-2-2-2h-2l-1 2-1-2h-2z" fill="#f6a86e"/>
-<path d="m9 1042.4a3 3 0 0 0 -3 3v5h2v-2h1v-2h-1v-1a1 1 0 0 1 1 -1h1v-2h-1z" fill="#fff" fill-opacity=".39216"/>
-</g>
-</svg>
diff --git a/editor/icons/icon_mini_transform2D.svg b/editor/icons/icon_mini_transform2D.svg
deleted file mode 100644
index b4723d37c4..0000000000
--- a/editor/icons/icon_mini_transform2D.svg
+++ /dev/null
@@ -1,6 +0,0 @@
-<svg width="16" height="12" version="1.1" viewBox="0 0 16 12" xmlns="http://www.w3.org/2000/svg">
-<g transform="translate(0 -1040.4)">
-<path transform="translate(0 1040.4)" d="m0 2v2h2v6h2v-6h2v-2h-6zm7 0v2a1 1 0 0 1 1 1 1 1 0 0 1 -1 1 2 2 0 0 0 -1.7324 1 2 2 0 0 0 -0.26562 1h-0.0019531v0.046875 1.9531h2 3 2a4 4 0 0 0 3.4648 -2 4 4 0 0 0 0 -4 4 4 0 0 0 -3.4648 -2h-2v6h-3a3 3 0 0 0 2.5977 -1.5 3 3 0 0 0 0 -3 3 3 0 0 0 -2.5977 -1.5zm5 2a2 2 0 0 1 1.7324 1 2 2 0 0 1 0 2 2 2 0 0 1 -1.7324 1v-4z" fill="#c4ec69"/>
-<path transform="translate(0 1040.4)" d="m7 2v2a1 1 0 0 1 1 1 1 1 0 0 1 -1 1 2 2 0 0 0 -1.7324 1 2 2 0 0 0 -0.26562 1h-0.0019531v0.046875 1.9531h2 3v-2h-3a3 3 0 0 0 2.5977 -1.5 3 3 0 0 0 0 -3 3 3 0 0 0 -2.5977 -1.5z" fill="#fff" fill-opacity=".39216"/>
-</g>
-</svg>
diff --git a/editor/icons/icon_mini_variant.svg b/editor/icons/icon_mini_variant.svg
deleted file mode 100644
index 4b9a2a5f18..0000000000
--- a/editor/icons/icon_mini_variant.svg
+++ /dev/null
@@ -1,5 +0,0 @@
-<svg width="16" height="12" version="1.1" viewBox="0 0 16 12" xmlns="http://www.w3.org/2000/svg">
-<g transform="translate(0 -1040.4)">
-<path transform="translate(0 1040.4)" d="m3 4a3 3 0 0 0 -3 3 3 3 0 0 0 3 3h2v-6h-2zm3 0v6h2v-4a1 1 0 0 1 1 1v3h2v-3a3 3 0 0 0 -3 -3h-2zm5 3a3 3 0 0 0 3 3v2h2v-8h-2v4a1 1 0 0 1 -1 -1v-3h-2v3zm-8-1v2a1 1 0 0 1 -1 -1 1 1 0 0 1 1 -1z" fill="#69ecbd"/>
-</g>
-</svg>
diff --git a/editor/icons/icon_mini_vector2.svg b/editor/icons/icon_mini_vector2.svg
deleted file mode 100644
index 907e6ba84d..0000000000
--- a/editor/icons/icon_mini_vector2.svg
+++ /dev/null
@@ -1,6 +0,0 @@
-<svg width="16" height="12" version="1.1" viewBox="0 0 16 12" xmlns="http://www.w3.org/2000/svg">
-<g transform="translate(0 -1040.4)">
-<path transform="translate(0 1040.4)" d="m12 2v2h1a1 1 0 0 1 1 1 1 1 0 0 1 -1 1 2 2 0 0 0 -1.7324 1 2 2 0 0 0 -0.26562 1h-0.001953v2h5v-2h-3a3 3 0 0 0 2.5977 -1.5 3 3 0 0 0 0 -3 3 3 0 0 0 -2.5977 -1.5h-1zm-11 2v6h2a3 3 0 0 0 3 -3v-3h-2v3a1 1 0 0 1 -1 1v-4h-2zm5 3a3 3 0 0 0 3 3h1v-2h-1a1 1 0 0 1 -1 -1 1 1 0 0 1 1 -1h1v-2h-1a3 3 0 0 0 -3 3z" fill="#bd91f1"/>
-<path transform="translate(0 1040.4)" d="m12 2v2h1a1 1 0 0 1 1 1 1 1 0 0 1 -1 1 2 2 0 0 0 -1.7324 1 2 2 0 0 0 -0.26562 1h-0.001953v2h5v-2h-3a3 3 0 0 0 2.5977 -1.5 3 3 0 0 0 0 -3 3 3 0 0 0 -2.5977 -1.5h-1z" fill="#fff" fill-opacity=".39216"/>
-</g>
-</svg>
diff --git a/editor/icons/icon_mini_vector2_array.svg b/editor/icons/icon_mini_vector2_array.svg
deleted file mode 100644
index e05eefc46a..0000000000
--- a/editor/icons/icon_mini_vector2_array.svg
+++ /dev/null
@@ -1,7 +0,0 @@
-<svg width="16" height="12" version="1.1" viewBox="0 0 16 12" xmlns="http://www.w3.org/2000/svg">
-<g transform="translate(0 -1040.4)">
-<path transform="translate(0 1040.4)" d="m0 0v2 10h2 2v-2h-2v-8h2v-2h-2-2zm12 0v2h2v8h-2v2h4v-2-10h-4z" fill="#e0e0e0"/>
-<path transform="translate(0 1040.4)" d="m9 2v2h1a1 1 0 0 1 1 1 1 1 0 0 1 -1 1 2 2 0 0 0 -1.7324 1 2 2 0 0 0 -0.26562 1h-0.0019531v0.046875 1.9531h2 3v-2h-3a3 3 0 0 0 2.5977 -1.5 3 3 0 0 0 0 -3 3 3 0 0 0 -2.5977 -1.5h-1zm-6 1v6h2a3 3 0 0 0 3 -3v-3h-2v3a1 1 0 0 1 -1 1v-4h-2z" fill="#bd91f1"/>
-<path d="m9 1042.4v2h1a1 1 0 0 1 1 1 1 1 0 0 1 -1 1 2 2 0 0 0 -1.7324 1 2 2 0 0 0 -0.26562 1h-0.00195v0.047 1.9531h2 3v-2h-3a3 3 0 0 0 2.5977 -1.5 3 3 0 0 0 0 -3 3 3 0 0 0 -2.5977 -1.5001h-1z" fill="#fff" fill-opacity=".39216"/>
-</g>
-</svg>
diff --git a/editor/icons/icon_mini_vector3.svg b/editor/icons/icon_mini_vector3.svg
deleted file mode 100644
index be1f8ec360..0000000000
--- a/editor/icons/icon_mini_vector3.svg
+++ /dev/null
@@ -1,6 +0,0 @@
-<svg width="16" height="12" version="1.1" viewBox="0 0 16 12" xmlns="http://www.w3.org/2000/svg">
-<g transform="translate(0 -1040.4)">
-<path transform="translate(0 1040.4)" d="m12 2v2h2a1 1 0 0 1 -1 1v2a1 1 0 0 1 1 1 1 1 0 0 1 -1 1h-1v2h1a3 3 0 0 0 2.5977 -1.5 3 3 0 0 0 0 -3 3 3 0 0 0 -0.36523 -0.50195 3 3 0 0 0 0.36523 -0.49805 3 3 0 0 0 0.39844 -1.5h0.003906v-2h-4zm-11 2v6h2a3 3 0 0 0 3 -3v-3h-2v3a1 1 0 0 1 -1 1v-4h-2zm5 3a3 3 0 0 0 3 3h1v-2h-1a1 1 0 0 1 -1 -1 1 1 0 0 1 1 -1h1v-2h-1a3 3 0 0 0 -3 3z" fill="#e286f0"/>
-<path transform="translate(0 1040.4)" d="m12 2v2h2a1 1 0 0 1 -1 1v2a1 1 0 0 1 1 1 1 1 0 0 1 -1 1h-1v2h1a3 3 0 0 0 2.5977 -1.5 3 3 0 0 0 0 -3 3 3 0 0 0 -0.36523 -0.50195 3 3 0 0 0 0.36523 -0.49805 3 3 0 0 0 0.39844 -1.5h0.003906v-2h-4z" fill="#fff" fill-opacity=".39216"/>
-</g>
-</svg>
diff --git a/editor/icons/icon_mini_vector3_array.svg b/editor/icons/icon_mini_vector3_array.svg
deleted file mode 100644
index e2843d2e68..0000000000
--- a/editor/icons/icon_mini_vector3_array.svg
+++ /dev/null
@@ -1,7 +0,0 @@
-<svg width="16" height="12" version="1.1" viewBox="0 0 16 12" xmlns="http://www.w3.org/2000/svg">
-<g transform="translate(0 -1040.4)">
-<path transform="translate(0 1040.4)" d="m0 0v2 8 2h4v-2h-2v-8h2v-2h-2-2zm12 0v2h2v8h-2v2h4v-2-10h-4z" fill="#e0e0e0"/>
-<path transform="translate(0 1040.4)" d="m8 1v2h1 1a1 1 0 0 1 -1 1v2a1 1 0 0 1 1 1 1 1 0 0 1 -1 1h-1v2h1a3 3 0 0 0 2.5977 -1.5 3 3 0 0 0 0 -3 3 3 0 0 0 -0.36523 -0.50195 3 3 0 0 0 0.36523 -0.49805 3 3 0 0 0 0.39844 -1.5h0.003906v-2h-0.76562-2.2344-1zm0 2h-2v3a1 1 0 0 1 -1 1v-4h-2v6h2a3 3 0 0 0 3 -3v-3z" fill="#e286f0"/>
-<path transform="translate(0 1040.4)" d="m8 1v2h1 1a1 1 0 0 1 -1 1v2a1 1 0 0 1 1 1 1 1 0 0 1 -1 1h-1v2h1a3 3 0 0 0 2.5977 -1.5 3 3 0 0 0 0 -3 3 3 0 0 0 -0.36523 -0.50195 3 3 0 0 0 0.36523 -0.49805 3 3 0 0 0 0.39844 -1.5h0.003906v-2h-0.76562-2.2344-1z" fill="#fff" fill-opacity=".39216"/>
-</g>
-</svg>
diff --git a/editor/icons/icon_nil.svg b/editor/icons/icon_nil.svg
new file mode 100644
index 0000000000..b266161c2b
--- /dev/null
+++ b/editor/icons/icon_nil.svg
@@ -0,0 +1,3 @@
+<svg width="16" height="12" version="1.1" viewBox="0 0 16 12" xmlns="http://www.w3.org/2000/svg">
+<path d="m8 2v2h2v-2zm4 0v5c0 1.6569 1.3431 3 3 3h1v-2h-1c-0.55228-9.6e-6 -0.99999-0.44772-1-1v-5zm-11 2v6h2v-4h1c0.55228 9.6e-6 0.99999 0.44772 1 1v3h2v-3c0-1.6569-1.3431-3-3-3zm7 2v4h2v-4z" fill="#e0e0e0"/>
+</svg>
diff --git a/editor/icons/icon_node_path.svg b/editor/icons/icon_node_path.svg
new file mode 100644
index 0000000000..1697c026a3
--- /dev/null
+++ b/editor/icons/icon_node_path.svg
@@ -0,0 +1,3 @@
+<svg width="16" height="12" version="1.1" viewBox="0 0 16 12" xmlns="http://www.w3.org/2000/svg">
+<path d="m0 2v8h2v-2a3 3 0 0 0 3 -3 3 3 0 0 0 -3 -3h-2zm6 0v5a3 3 0 0 0 3 3h1v-2h-1a1 1 0 0 1 -1 -1v-1h2v-2h-2v-2h-2zm5 0v8h2v-4a1 1 0 0 1 1 1v3h2v-3a3 3 0 0 0 -3 -3v-2h-2zm-9 2a1 1 0 0 1 1 1 1 1 0 0 1 -1 1v-2z" fill="#6993ec"/>
+</svg>
diff --git a/editor/icons/icon_plane.svg b/editor/icons/icon_plane.svg
index d0525e13dc..e02fded99f 100644
--- a/editor/icons/icon_plane.svg
+++ b/editor/icons/icon_plane.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 d="m1 1044.4 7 3 7-3-7-3z" fill="#e0e0e0" fill-rule="evenodd"/>
+<svg width="16" height="12" version="1.1" viewBox="0 0 16 12" xmlns="http://www.w3.org/2000/svg">
+<g transform="translate(0 -1040.4)">
+<path transform="translate(0 1040.4)" d="m1 2v8h2v-2a3 3 0 0 0 3 -3 3 3 0 0 0 -3 -3h-2zm6 0v5a3 3 0 0 0 3 3v-2a1 1 0 0 1 -1 -1v-5h-2zm-4 2a1 1 0 0 1 1 1 1 1 0 0 1 -1 1v-2zm8 0v6h2v-4a1 1 0 0 1 1 1v3h2v-3a3 3 0 0 0 -3 -3h-2z" fill="#f77070"/>
</g>
</svg>
diff --git a/editor/icons/icon_pool_byte_array.svg b/editor/icons/icon_pool_byte_array.svg
new file mode 100644
index 0000000000..29d6bfe4f0
--- /dev/null
+++ b/editor/icons/icon_pool_byte_array.svg
@@ -0,0 +1,5 @@
+<svg width="16" height="12" version="1.1" viewBox="0 0 16 12" xmlns="http://www.w3.org/2000/svg">
+<path d="m0 0v12h4v-2h-2v-8h2v-2h-2zm12 0v2h2v8h-2v2h4v-12h-2z" fill="#e0e0e0"/>
+<path d="m5 3a3 3 0 0 0 -3 3v3h2v-3a1 1 0 0 1 1 -1h1v4h2a3 3 0 0 0 1 -0.17578v0.17578h2a3 3 0 0 0 3 -3v-3h-2v3a1 1 0 0 1 -1 1v-4h-2v3a1 1 0 0 1 -1 1v-4h-2z" fill="#69ec9e"/>
+<path d="m6 9v-6h2v4a1 1 0 0 0 1 -1v-3h2v4a1 1 0 0 0 1 -1v-3h2v3a3 3 0 0 1 -3 3h-2v-0.1758a3 3 0 0 1 -1 0.1758z" fill="#fff" fill-opacity=".39216"/>
+</svg>
diff --git a/editor/icons/icon_pool_color_array.svg b/editor/icons/icon_pool_color_array.svg
new file mode 100644
index 0000000000..dcce58f9c6
--- /dev/null
+++ b/editor/icons/icon_pool_color_array.svg
@@ -0,0 +1,8 @@
+<svg width="16" height="12" version="1.1" viewBox="0 0 16 12" xmlns="http://www.w3.org/2000/svg">
+<g>
+<path d="m0 0v12h4v-2h-2v-8h2v-2h-4zm12 0v2h2v8h-2v2h4v-12h-4z" fill="#e0e0e0"/>
+<path d="m6 3.5a3 3 0 0 0 -3 3 3 3 0 0 0 3 3h1v-2h-1a1 1 0 0 1 -1 -1 1 1 0 0 1 1 -1h1v-2z" fill="#ff7070"/>
+<path d="m13 3.5a3 3 0 0 0 -3 3v3h2v-3a1 1 0 0 1 1 -1z" fill="#70bfff"/>
+<path d="m7 1.5v5a3 3 0 0 0 3 3v-2a1 1 0 0 1 -1 -1v-5z" fill="#7aff70"/>
+</g>
+</svg>
diff --git a/editor/icons/icon_pool_int_array.svg b/editor/icons/icon_pool_int_array.svg
new file mode 100644
index 0000000000..d59f9e1531
--- /dev/null
+++ b/editor/icons/icon_pool_int_array.svg
@@ -0,0 +1,5 @@
+<svg width="16" height="12" version="1.1" viewBox="0 0 16 12" xmlns="http://www.w3.org/2000/svg">
+<path d="m0 0v12h4v-2h-2v-8h2v-2zm12 0v2h2v8h-2v2h4v-12z" fill="#e0e0e0"/>
+<path d="m3 2v2h2v-2zm2 2v2h-2v4h4v-4a1 1 0 0 1 1 1v3h2v-3a3 3 0 0 0 -3 -3zm5 3a3 3 0 0 0 3 3v-2a1 1 0 0 1 -1 -1v-1h1v-2h-1v-2h-2z" fill="#7dc6ef"/>
+<path d="m5 4v6h2v-4a1 1 0 0 1 1 1v3h2v-3a3 3 0 0 0 -3 -3z" fill="#fff" fill-opacity=".39216"/>
+</svg>
diff --git a/editor/icons/icon_pool_real_array.svg b/editor/icons/icon_pool_real_array.svg
new file mode 100644
index 0000000000..78a8064611
--- /dev/null
+++ b/editor/icons/icon_pool_real_array.svg
@@ -0,0 +1,5 @@
+<svg width="16" height="12" version="1.1" viewBox="0 0 16 12" xmlns="http://www.w3.org/2000/svg">
+<path d="m0 0v12h4v-2h-2v-8h2v-2zm12 0v2h2v8h-2v2h4v-12z" fill="#e0e0e0"/>
+<path d="m6 2a3 3 0 0 0 -3 3v5h2v-2h1v-2h-1v-1a1 1 0 0 1 1 -1zm1 0v5a3 3 0 0 0 3 3v-2a1 1 0 0 1 -1 -1v-5zm3 0v5a3 3 0 0 0 3 3v-2a1 1 0 0 1 -1 -1v-1h1v-2h-1v-2z" fill="#61daf4"/>
+<path d="m7 2v5a3 3 0 0 0 3 3v-2a1 1 0 0 1 -1 -1v-5z" fill="#fff" fill-opacity=".39216"/>
+</svg>
diff --git a/editor/icons/icon_pool_string_array.svg b/editor/icons/icon_pool_string_array.svg
new file mode 100644
index 0000000000..401bfe6145
--- /dev/null
+++ b/editor/icons/icon_pool_string_array.svg
@@ -0,0 +1,5 @@
+<svg width="16" height="12" version="1.1" viewBox="0 0 16 12" xmlns="http://www.w3.org/2000/svg">
+<path d="m0 0v12h4v-2h-2v-8h2v-2zm12 0v2h2v8h-2v2h4v-12z" fill="#e0e0e0"/>
+<path d="m7 2a3 3 0 0 0 -3 3v2a1 1 0 0 1 -1 1h-1v2h1a3 3 0 0 0 3 -3v-2a1 1 0 0 1 1 -1h1v3a3 3 0 0 0 3 3h2v-3a1 1 0 0 1 1 -1v-2a3 3 0 0 0 -3 3v1a1 1 0 0 1 -1 -1v-1h1v-2h-1v-2h-2z" fill="#6ba7ec"/>
+<path d="m8 2v5a3 3 0 0 0 3 3v-2a1 1 0 0 1 -1 -1v-1h1v-2h-1v-2z" fill="#fff" fill-opacity=".39216"/>
+</svg>
diff --git a/editor/icons/icon_pool_vector2_array.svg b/editor/icons/icon_pool_vector2_array.svg
new file mode 100644
index 0000000000..bb089a26ef
--- /dev/null
+++ b/editor/icons/icon_pool_vector2_array.svg
@@ -0,0 +1,5 @@
+<svg width="16" height="12" version="1.1" viewBox="0 0 16 12" xmlns="http://www.w3.org/2000/svg">
+<path d="m0 0v12h4v-2h-2v-8h2v-2zm12 0v2h2v8h-2v2h4v-12z" fill="#e0e0e0"/>
+<path d="m9 2v2h1a1 1 0 0 1 1 1 1 1 0 0 1 -1 1 2 2 0 0 0 -1.7324 1 2 2 0 0 0 -0.26562 1h-0.0019531v2h5v-2h-3a3 3 0 0 0 2.5977 -1.5 3 3 0 0 0 0 -3 3 3 0 0 0 -2.5977 -1.5zm-6 1v6h2a3 3 0 0 0 3 -3v-3h-2v3a1 1 0 0 1 -1 1v-4z" fill="#bd91f1"/>
+<path d="m9 2v2h1a1 1 0 0 1 1 1 1 1 0 0 1 -1 1 2 2 0 0 0 -1.7324 1 2 2 0 0 0 -0.26562 1h-0.00195v2.0001h5v-2h-3a3 3 0 0 0 2.5977 -1.5 3 3 0 0 0 0 -3 3 3 0 0 0 -2.5977 -1.5001z" fill="#fff" fill-opacity=".39216"/>
+</svg>
diff --git a/editor/icons/icon_pool_vector3_array.svg b/editor/icons/icon_pool_vector3_array.svg
new file mode 100644
index 0000000000..4f69183e30
--- /dev/null
+++ b/editor/icons/icon_pool_vector3_array.svg
@@ -0,0 +1,5 @@
+<svg width="16" height="12" version="1.1" viewBox="0 0 16 12" xmlns="http://www.w3.org/2000/svg">
+<path d="m0 0v12h4v-2h-2v-8h2v-2zm12 0v2h2v8h-2v2h4v-12z" fill="#e0e0e0"/>
+<path d="m8 1v2h2c0 0.55228-0.44772 1-1 1v2c0.55228 0 1 0.44772 1 1s-0.44772 1-1 1h-1v2h1c1.0716-1.501e-4 2.0618-0.57193 2.5977-1.5 0.5359-0.9282 0.5359-2.0718 0-3-0.10406-0.1795-0.22646-0.34772-0.36523-0.50195 0.13856-0.15301 0.26095-0.31991 0.36523-0.49805 0.26209-0.45639 0.3995-0.97371 0.39844-1.5h0.003906v-2zm0 2h-2v3c-9.6e-6 0.55228-0.44772 0.99999-1 1v-4h-2v6h2c1.6569 0 3-1.3431 3-3z" fill="#e286f0"/>
+<path d="m8 1v2h2c0 0.55228-0.44772 1-1 1v2c0.55228 0 1 0.44772 1 1s-0.44772 1-1 1h-1v2h1c1.0716-1.501e-4 2.0618-0.57193 2.5977-1.5 0.5359-0.9282 0.5359-2.0718 0-3-0.10406-0.1795-0.22646-0.34772-0.36523-0.50195 0.13856-0.15301 0.26095-0.31991 0.36523-0.49805 0.26209-0.45639 0.3995-0.97371 0.39844-1.5h0.003906v-2z" fill="#fff" fill-opacity=".39216"/>
+</svg>
diff --git a/editor/icons/icon_quat.svg b/editor/icons/icon_quat.svg
index fc99c33aeb..07433920a1 100644
--- a/editor/icons/icon_quat.svg
+++ b/editor/icons/icon_quat.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="m7 1v6h2v-6h-2zm4 2.3906v2.0137a5 2 0 0 1 2 1.5957 5 2 0 0 1 -5 2 5 2 0 0 1 -5 -2 5 2 0 0 1 2 -1.5977v-2.0098a7 4 0 0 0 -4 3.6074 7 4 0 0 0 7 4 7 4 0 0 0 7 -4 7 4 0 0 0 -4 -3.6094zm-4 9.6094v2h2v-2h-2z" fill="#e0e0e0"/>
-</g>
+<svg width="16" height="12" version="1.1" viewBox="0 0 16 12" xmlns="http://www.w3.org/2000/svg">
+<path d="m3 3a3 3 0 0 0 -3 3 3 3 0 0 0 3 3v2h2v-2.7695a3 3 0 0 0 2 0.76953h2v-6h-2v4a1 1 0 0 1 -1 -1v-3h-2zm0 2v2a1 1 0 0 1 -1 -1 1 1 0 0 1 1 -1z" fill="#ec69a3"/>
+<path d="m4 3v3a3 3 0 0 0 3 3h2v-6h-2v4a1 1 0 0 1 -1 -1v-3z" fill="#fff" fill-opacity=".39216"/>
+<path d="m13 1v2h-2a3 3 0 0 0 -3 3 3 3 0 0 0 3 3h2v-3a3 3 0 0 0 3 3v-2a1 1 0 0 1 -1 -1v-1h1v-2h-1v-2zm-2 4v2a1 1 0 0 1 -1 -1 1 1 0 0 1 1 -1z" fill="#ec69a3"/>
</svg>
diff --git a/editor/icons/icon_mini_rid.svg b/editor/icons/icon_r_i_d.svg
index f1709a5acc..f1709a5acc 100644
--- a/editor/icons/icon_mini_rid.svg
+++ b/editor/icons/icon_r_i_d.svg
diff --git a/editor/icons/icon_range.svg b/editor/icons/icon_range.svg
deleted file mode 100644
index 4bf0170e55..0000000000
--- a/editor/icons/icon_range.svg
+++ /dev/null
@@ -1,5 +0,0 @@
-<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="m1 3v10h2v-4h2v2h2v-2h2v2h2v-2h2v4h2v-10h-2v4h-2v-2h-2v2h-2v-2h-2v2h-2v-4z" fill="#a5efac"/>
-</g>
-</svg>
diff --git a/editor/icons/icon_rect2.svg b/editor/icons/icon_rect2.svg
new file mode 100644
index 0000000000..05d1022e5b
--- /dev/null
+++ b/editor/icons/icon_rect2.svg
@@ -0,0 +1,3 @@
+<svg width="16" height="12" version="1.1" viewBox="0 0 16 12" xmlns="http://www.w3.org/2000/svg">
+<path d="m13 2v2h-1a3 3 0 0 0 -2.5 1.3457 3 3 0 0 0 -2.5 -1.3457 3 3 0 0 0 -3 3 3 3 0 0 0 3 3h1v-2h-1a1 1 0 0 1 -1 -1h3a3 3 0 0 0 3 3h1v-2h-1a1 1 0 0 1 -1 -1 1 1 0 0 1 1 -1h1v1a3 3 0 0 0 3 3v-2a1 1 0 0 1 -1 -1v-1h1v-2h-1v-2zm-10 2a3 3 0 0 0 -3 3v3h2v-3a1 1 0 0 1 1 -1h1v-2z" fill="#f191a5"/>
+</svg>
diff --git a/editor/icons/icon_scroll_bar.svg b/editor/icons/icon_scroll_bar.svg
deleted file mode 100644
index c58c31464d..0000000000
--- a/editor/icons/icon_scroll_bar.svg
+++ /dev/null
@@ -1,5 +0,0 @@
-<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 3c-1.1046 0-2 0.89543-2 2v6c0 1.1046 0.89543 2 2 2h10c1.1046 0 2-0.89543 2-2v-6c0-1.1046-0.89543-2-2-2h-10zm0 2h10v6h-10v-6zm1 1v4h4v-4h-4z" fill="#a5efac"/>
-</g>
-</svg>
diff --git a/editor/icons/icon_string.svg b/editor/icons/icon_string.svg
new file mode 100644
index 0000000000..6618f3b7f9
--- /dev/null
+++ b/editor/icons/icon_string.svg
@@ -0,0 +1,3 @@
+<svg width="16" height="12" version="1.1" viewBox="0 0 16 12" xmlns="http://www.w3.org/2000/svg">
+<path d="m5 2a3 3 0 0 0 -3 3v2a1 1 0 0 1 -1 1h-1v2h1a3 3 0 0 0 3 -3v-2a1 1 0 0 1 1 -1h1v-2zm2 0v5a3 3 0 0 0 3 3h1v-2h-1a1 1 0 0 1 -1 -1v-1h2v-2h-2v-2zm8 2a3 3 0 0 0 -3 3v3h2v-3a1 1 0 0 1 1 -1h1v-2z" fill="#6ba7ec"/>
+</svg>
diff --git a/editor/icons/icon_theme.svg b/editor/icons/icon_theme.svg
index 3dfb4aaa00..f44529c4cb 100644
--- a/editor/icons/icon_theme.svg
+++ b/editor/icons/icon_theme.svg
@@ -1,11 +1,11 @@
<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 1l-0.5 2h3l-0.5-2h-2zm-3.2422 1.3438l-0.65625 0.65625h1.75l-1.0938-0.65625zm8.4844 0l-1.0957 0.65625h1.752l-0.65625-0.65625z" fill="#ff7070"/>
-<path transform="translate(0 1036.4)" d="m3.1016 3l-0.75781 0.75781 0.74414 1.2422h9.8242l0.74414-1.2422-0.75781-0.75781h-1.752l-0.89844 0.53906a5 5 0 0 0 -0.68555 -0.28516l-0.0625-0.25391h-3l-0.064453 0.25781a5 5 0 0 0 -0.68945 0.2793l-0.89453-0.53711h-1.75z" fill="#ffeb70"/>
-<path transform="translate(0 1036.4)" d="m3.0879 5l0.45117 0.75195a5 5 0 0 0 -0.28516 0.68555l-2.2539 0.5625h5.2695a2 2 0 0 1 1.7305 -1 2 2 0 0 1 1.7285 1h5.2715l-2.2578-0.56445a5 5 0 0 0 -0.2793 -0.6875l0.44922-0.74805h-9.8242z" fill="#9dff70"/>
-<path transform="translate(0 1036.4)" d="m1 7v2h5.2715a2 2 0 0 1 -0.27148 -1 2 2 0 0 1 0.26953 -1h-5.2695zm8.7285 0a2 2 0 0 1 0.27148 1 2 2 0 0 1 -0.26953 1h5.2695v-2h-5.2715z" fill="#70ffb9"/>
-<path transform="translate(0 1036.4)" d="m1 9l2.2578 0.56445a5 5 0 0 0 0.2793 0.6875l-0.44922 0.74805h9.8242l-0.45117-0.75195a5 5 0 0 0 0.28516 -0.68555l2.2539-0.5625h-5.2695a2 2 0 0 1 -1.7305 1 2 2 0 0 1 -1.7285 -1h-5.2715z" fill="#70deff"/>
-<path transform="translate(0 1036.4)" d="m3.1016 13l0.65625 0.65625 1.0957-0.65625h-1.752zm3.3984 0l0.5 2h2l0.5-2h-3zm4.6484 0l1.0938 0.65625 0.65625-0.65625h-1.75z" fill="#ff70ac"/>
-<path transform="translate(0 1036.4)" d="m3.0879 11l-0.74414 1.2422 0.75781 0.75781h1.752l0.89844-0.53906a5 5 0 0 0 0.68555 0.28516l0.0625 0.25391h3l0.064453-0.25781a5 5 0 0 0 0.6875 -0.2793l0.89648 0.53711h1.75l0.75781-0.75781-0.74414-1.2422h-9.8242z" fill="#9f70ff"/>
+<g transform="translate(0 -1036.4)" stroke-width="0">
+<path transform="translate(0 1036.4)" d="m6.7246 3c-0.52985 0.78935-0.96267 1.4021-1.3945 2h5.3398c-0.43187-0.59786-0.86468-1.2107-1.3945-2h-2.5508z" fill="#ffeb70"/>
+<path transform="translate(0 1036.4)" d="m5.3301 5c-0.52617 0.72841-1.0198 1.4208-1.375 2h8.0898c-0.35516-0.57924-0.84883-1.2716-1.375-2h-5.3398z" fill="#9dff70"/>
+<path transform="translate(0 1036.4)" d="m3.9551 7c-0.41451 0.67603-0.71534 1.3082-0.85547 2h9.8008c-0.14013-0.69181-0.44096-1.324-0.85547-2h-8.0898z" fill="#70ffb9"/>
+<path transform="translate(0 1036.4)" d="m3.0996 9c-0.063989 0.3159-0.099609 0.64498-0.099609 1 0 0.34242 0.034776 0.67693 0.10156 1h9.7969c0.066786-0.32307 0.10156-0.65758 0.10156-1 0-0.35502-0.03562-0.6841-0.099609-1h-9.8008z" fill="#70deff"/>
+<path transform="translate(0 1036.4)" d="m3.1016 11c0.15381 0.74405 0.48967 1.4159 0.93555 2h7.9258c0.44588-0.5841 0.78173-1.2559 0.93555-2h-9.7969z" fill="#9f70ff"/>
+<path transform="translate(0 1036.4)" d="m4.0371 13c0.9218 1.2076 2.3612 2 3.9629 2s3.0411-0.79243 3.9629-2h-7.9258z" fill="#ff70ac"/>
+<path transform="translate(0 1036.4)" d="m8 1c-0.45196 0.75327-0.87224 1.3994-1.2754 2h2.5508c-0.40315-0.6006-0.82343-1.2467-1.2754-2z" fill="#ff7070"/>
</g>
</svg>
diff --git a/editor/icons/icon_transform.svg b/editor/icons/icon_transform.svg
new file mode 100644
index 0000000000..7645622c28
--- /dev/null
+++ b/editor/icons/icon_transform.svg
@@ -0,0 +1,4 @@
+<svg width="16" height="12" version="1.1" viewBox="0 0 16 12" xmlns="http://www.w3.org/2000/svg">
+<path d="m0 2 2 4-2 4h2l0.9082-2.1816 1.0918 2.1816h2l-2-4 2-4h-2l-0.9082 2.1816-1.0918-2.1816zm6 8h2v-2h1v-2h-1v-1c9.6e-6 -0.55228 0.44772-0.99999 1-1h1v-2h-1c-1.6569 0-3 1.3431-3 3zm4-6v6h2v-2l1 1 1-1v2h2v-6h-2l-1 2-1-2z" fill="#f6a86e"/>
+<path d="m9 2a3 3 0 0 0 -3 3v5h2v-2h1v-2h-1v-1a1 1 0 0 1 1 -1h1v-2z" fill="#fff" fill-opacity=".39216"/>
+</svg>
diff --git a/editor/icons/icon_transform_2_D.svg b/editor/icons/icon_transform_2_D.svg
new file mode 100644
index 0000000000..de05160dac
--- /dev/null
+++ b/editor/icons/icon_transform_2_D.svg
@@ -0,0 +1,4 @@
+<svg width="16" height="12" version="1.1" viewBox="0 0 16 12" xmlns="http://www.w3.org/2000/svg">
+<path d="m0 2v2h2v6h2v-6h2v-2zm7 0v2a1 1 0 0 1 1 1 1 1 0 0 1 -1 1 2 2 0 0 0 -1.7324 1 2 2 0 0 0 -0.26562 1h-0.0019531v2h7a4 4 0 0 0 3.4648 -2 4 4 0 0 0 0 -4 4 4 0 0 0 -3.4648 -2h-2v6h-3a3 3 0 0 0 2.5977 -1.5 3 3 0 0 0 0 -3 3 3 0 0 0 -2.5977 -1.5zm5 2a2 2 0 0 1 1.7324 1 2 2 0 0 1 0 2 2 2 0 0 1 -1.7324 1z" fill="#c4ec69"/>
+<path d="m7 2v2c0.55228 0 1 0.44772 1 1s-0.44772 1-1 1c-0.71466-1.326e-4 -1.3751 0.38108-1.7324 1-0.17472 0.30426-0.26633 0.64914-0.26562 1h-0.0019531v2h5v-2h-3c1.0716-1.5e-4 2.0618-0.57193 2.5977-1.5 0.5359-0.9282 0.5359-2.0718 0-3-0.53582-0.92807-1.526-1.4998-2.5977-1.5z" fill="#fff" fill-opacity=".39216"/>
+</svg>
diff --git a/editor/icons/icon_variant.svg b/editor/icons/icon_variant.svg
index 32f72b1ce6..859578243c 100644
--- a/editor/icons/icon_variant.svg
+++ b/editor/icons/icon_variant.svg
@@ -1,16 +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)">
-<g transform="translate(0,-3)" fill="#e0e0e0">
-<rect x="3" y="1044.4" width="2" height="6"/>
-<rect x="6" y="1044.4" width="2" height="6"/>
-<rect x="3" y="1044.4" width="1" height="2"/>
-<path d="m3 1044.4a3 3 0 0 0 -3 3h2a1 1 0 0 1 1 -1z"/>
-<path d="m14 1050.4a3 3 0 0 1 -3 -3h2a1 1 0 0 0 1 1z"/>
-<rect transform="scale(1,-1)" x="14" y="-1052.4" width="2" height="8"/>
-<rect transform="scale(1,-1)" x="11" y="-1047.4" width="2" height="3"/>
-<path d="m3 1050.4a3 3 0 0 1 -3 -3h2a1 1 0 0 0 1 1z"/>
-<path d="m8 1044.4a3 3 0 0 1 3 3h-2a1 1 0 0 0 -1 -1z"/>
-<rect x="9" y="1047.4" width="2" height="3"/>
-</g>
-</g>
+<svg width="16" height="12" version="1.1" viewBox="0 0 16 12" xmlns="http://www.w3.org/2000/svg">
+<path d="m3 4a3 3 0 0 0 -3 3 3 3 0 0 0 3 3h2v-6zm3 0v6h2v-4a1 1 0 0 1 1 1v3h2v-3a3 3 0 0 0 -3 -3zm5 3a3 3 0 0 0 3 3v2h2v-8h-2v4a1 1 0 0 1 -1 -1v-3h-2zm-8-1v2a1 1 0 0 1 -1 -1 1 1 0 0 1 1 -1z" fill="#69ecbd"/>
</svg>
diff --git a/editor/icons/icon_vector2.svg b/editor/icons/icon_vector2.svg
new file mode 100644
index 0000000000..9fa798df5d
--- /dev/null
+++ b/editor/icons/icon_vector2.svg
@@ -0,0 +1,4 @@
+<svg width="16" height="12" version="1.1" viewBox="0 0 16 12" xmlns="http://www.w3.org/2000/svg">
+<path d="m12 2v2h1a1 1 0 0 1 1 1 1 1 0 0 1 -1 1 2 2 0 0 0 -1.7324 1 2 2 0 0 0 -0.26562 1h-0.001953v2h5v-2h-3a3 3 0 0 0 2.5977 -1.5 3 3 0 0 0 0 -3 3 3 0 0 0 -2.5977 -1.5zm-11 2v6h2a3 3 0 0 0 3 -3v-3h-2v3a1 1 0 0 1 -1 1v-4zm5 3a3 3 0 0 0 3 3h1v-2h-1a1 1 0 0 1 -1 -1 1 1 0 0 1 1 -1h1v-2h-1a3 3 0 0 0 -3 3z" fill="#bd91f1"/>
+<path d="m12 2v2h1a1 1 0 0 1 1 1 1 1 0 0 1 -1 1 2 2 0 0 0 -1.7324 1 2 2 0 0 0 -0.26562 1h-0.001953v2h5v-2h-3a3 3 0 0 0 2.5977 -1.5 3 3 0 0 0 0 -3 3 3 0 0 0 -2.5977 -1.5z" fill="#fff" fill-opacity=".39216"/>
+</svg>
diff --git a/editor/icons/icon_vector3.svg b/editor/icons/icon_vector3.svg
new file mode 100644
index 0000000000..cf1d0d0136
--- /dev/null
+++ b/editor/icons/icon_vector3.svg
@@ -0,0 +1,4 @@
+<svg width="16" height="12" version="1.1" viewBox="0 0 16 12" xmlns="http://www.w3.org/2000/svg">
+<path d="m12 2v2h2a1 1 0 0 1 -1 1v2a1 1 0 0 1 1 1 1 1 0 0 1 -1 1h-1v2h1a3 3 0 0 0 2.5977 -1.5 3 3 0 0 0 0 -3 3 3 0 0 0 -0.36523 -0.50195 3 3 0 0 0 0.36523 -0.49805 3 3 0 0 0 0.39844 -1.5h0.003906v-2zm-11 2v6h2a3 3 0 0 0 3 -3v-3h-2v3a1 1 0 0 1 -1 1v-4zm5 3a3 3 0 0 0 3 3h1v-2h-1a1 1 0 0 1 -1 -1 1 1 0 0 1 1 -1h1v-2h-1a3 3 0 0 0 -3 3z" fill="#e286f0"/>
+<path d="m12 2v2h2a1 1 0 0 1 -1 1v2a1 1 0 0 1 1 1 1 1 0 0 1 -1 1h-1v2h1a3 3 0 0 0 2.5977 -1.5 3 3 0 0 0 0 -3 3 3 0 0 0 -0.36523 -0.50195 3 3 0 0 0 0.36523 -0.49805 3 3 0 0 0 0.39844 -1.5h0.003906v-2z" fill="#fff" fill-opacity=".39216"/>
+</svg>
diff --git a/editor/import/resource_importer_scene.cpp b/editor/import/resource_importer_scene.cpp
index ed7c6dba79..b6e4729352 100644
--- a/editor/import/resource_importer_scene.cpp
+++ b/editor/import/resource_importer_scene.cpp
@@ -515,127 +515,7 @@ Node *ResourceImporterScene::_fix_node(Node *p_node, Node *p_root, Map<Ref<Array
s->set_transform(Transform());
p_node = bv;
-#if 0
- } else if (_teststr(name, "room") && Object::cast_to<MeshInstance>(p_node)) {
- if (isroot)
- return p_node;
-
- MeshInstance *mi = Object::cast_to<MeshInstance>(p_node);
- PoolVector<Face3> faces = mi->get_faces(VisualInstance::FACES_SOLID);
-
- BSP_Tree bsptree(faces);
-
- Ref<RoomBounds> area = memnew(RoomBounds);
- //area->set_bounds(faces);
- //area->set_geometry_hint(faces);
-
- Room *room = memnew(Room);
- room->set_name(_fixstr(name, "room"));
- room->set_transform(mi->get_transform());
- room->set_room(area);
-
- p_node->replace_by(room);
- memdelete(p_node);
- p_node = room;
-
- } else if (_teststr(name, "room")) {
-
- if (isroot)
- return p_node;
-
- Spatial *dummy = Object::cast_to<Spatial>(p_node);
- ERR_FAIL_COND_V(!dummy, NULL);
-
- Room *room = memnew(Room);
- room->set_name(_fixstr(name, "room"));
- room->set_transform(dummy->get_transform());
-
- p_node->replace_by(room);
- memdelete(p_node);
- p_node = room;
-
- //room->compute_room_from_subtree();
-
- } else if (_teststr(name, "portal") && Object::cast_to<MeshInstance>(p_node)) {
-
- if (isroot)
- return p_node;
-
- MeshInstance *mi = Object::cast_to<MeshInstance>(p_node);
- PoolVector<Face3> faces = mi->get_faces(VisualInstance::FACES_SOLID);
-
- ERR_FAIL_COND_V(faces.size() == 0, NULL);
- //step 1 compute the plane
- Set<Vector3> points;
- Plane plane;
-
- Vector3 center;
-
- for (int i = 0; i < faces.size(); i++) {
-
- Face3 f = faces.get(i);
- Plane p = f.get_plane();
- plane.normal += p.normal;
- plane.d += p.d;
-
- for (int i = 0; i < 3; i++) {
-
- Vector3 v = f.vertex[i].snapped(Vector3(0.01, 0.01, 0.01));
- if (!points.has(v)) {
- points.insert(v);
- center += v;
- }
- }
- }
-
- plane.normal.normalize();
- plane.d /= faces.size();
- center /= points.size();
-
- //step 2, create points
-
- Transform t;
- t.basis.from_z(plane.normal);
- t.basis.transpose();
- t.origin = center;
-
- Vector<Point2> portal_points;
-
- for (Set<Vector3>::Element *E = points.front(); E; E = E->next()) {
-
- Vector3 local = t.xform_inv(E->get());
- portal_points.push_back(Point2(local.x, local.y));
- }
- // step 3 bubbly sort points
-
- int swaps = 0;
-
- do {
- swaps = 0;
-
- for (int i = 0; i < portal_points.size() - 1; i++) {
-
- float a = portal_points[i].angle();
- float b = portal_points[i + 1].angle();
-
- if (a > b) {
- SWAP(portal_points[i], portal_points[i + 1]);
- swaps++;
- }
- }
-
- } while (swaps);
-
- Portal *portal = memnew(Portal);
-
- portal->set_shape(portal_points);
- portal->set_transform(mi->get_transform() * t);
-
- p_node->replace_by(portal);
- memdelete(p_node);
- p_node = portal;
-#endif
} else if (Object::cast_to<MeshInstance>(p_node)) {
//last attempt, maybe collision inside the mesh data
@@ -969,15 +849,15 @@ void ResourceImporterScene::_find_meshes(Node *p_node, Map<Ref<ArrayMesh>, Trans
if (mesh.is_valid() && !meshes.has(mesh)) {
Spatial *s = mi;
- while (s->get_parent_spatial()) {
+ Transform transform;
+ while (s) {
+ transform = transform * s->get_transform();
s = s->get_parent_spatial();
}
- if (s == mi) {
- meshes[mesh] = s->get_transform();
- } else {
- meshes[mesh] = s->get_transform() * mi->get_relative_transform(s);
- }
+ meshes[mesh] = transform;
+
+ print_line("mesh transform: " + meshes[mesh]);
}
}
for (int i = 0; i < p_node->get_child_count(); i++) {
@@ -1157,6 +1037,7 @@ void ResourceImporterScene::get_import_options(List<ImportOption> *r_options, in
bool scenes_out = p_preset == PRESET_MULTIPLE_SCENES || p_preset == PRESET_MULTIPLE_SCENES_AND_MATERIALS;
bool animations_out = p_preset == PRESET_SEPARATE_ANIMATIONS || p_preset == PRESET_SEPARATE_MESHES_AND_ANIMATIONS || p_preset == PRESET_SEPARATE_MATERIALS_AND_ANIMATIONS || p_preset == PRESET_SEPARATE_MESHES_MATERIALS_AND_ANIMATIONS;
+ r_options->push_back(ImportOption(PropertyInfo(Variant::REAL, "nodes/root_scale", PROPERTY_HINT_RANGE, "0.001,1000,0.001"), 1.0));
r_options->push_back(ImportOption(PropertyInfo(Variant::STRING, "nodes/custom_script", PROPERTY_HINT_FILE, script_ext_hint), ""));
r_options->push_back(ImportOption(PropertyInfo(Variant::INT, "nodes/storage", PROPERTY_HINT_ENUM, "Single Scene,Instanced Sub-Scenes"), scenes_out ? 1 : 0));
r_options->push_back(ImportOption(PropertyInfo(Variant::INT, "materials/location", PROPERTY_HINT_ENUM, "Node,Mesh"), (meshes_out || materials_out) ? 1 : 0));
@@ -1329,6 +1210,11 @@ Error ResourceImporterScene::import(const String &p_source_file, const String &p
}
}
+ if (Object::cast_to<Spatial>(scene)) {
+ float root_scale = p_options["nodes/root_scale"];
+ Object::cast_to<Spatial>(scene)->scale(Vector3(root_scale, root_scale, root_scale));
+ }
+
scene->set_name(p_options["nodes/root_name"]);
err = OK;
diff --git a/editor/plugins/animation_player_editor_plugin.cpp b/editor/plugins/animation_player_editor_plugin.cpp
index 019e32f847..d70f41d2e0 100644
--- a/editor/plugins/animation_player_editor_plugin.cpp
+++ b/editor/plugins/animation_player_editor_plugin.cpp
@@ -1348,14 +1348,14 @@ void AnimationPlayerEditor::_prepare_onion_layers_2() {
if (SpatialEditor::get_singleton()->is_visible()) {
// 3D
spatial_edit_state = SpatialEditor::get_singleton()->get_state();
- Dictionary new_state = spatial_edit_state.copy();
+ Dictionary new_state = spatial_edit_state.duplicate();
new_state["show_grid"] = false;
new_state["show_origin"] = false;
Array orig_vp = spatial_edit_state["viewports"];
Array vp;
vp.resize(4);
for (int i = 0; i < vp.size(); i++) {
- Dictionary d = ((Dictionary)orig_vp[i]).copy();
+ Dictionary d = ((Dictionary)orig_vp[i]).duplicate();
d["use_environment"] = false;
d["doppler"] = false;
d["gizmos"] = onion.include_gizmos ? d["gizmos"] : Variant(false);
@@ -1368,7 +1368,7 @@ void AnimationPlayerEditor::_prepare_onion_layers_2() {
} else { // CanvasItemEditor
// 2D
canvas_edit_state = CanvasItemEditor::get_singleton()->get_state();
- Dictionary new_state = canvas_edit_state.copy();
+ Dictionary new_state = canvas_edit_state.duplicate();
new_state["show_grid"] = false;
new_state["show_rulers"] = false;
new_state["show_guides"] = false;
diff --git a/editor/plugins/spatial_editor_plugin.cpp b/editor/plugins/spatial_editor_plugin.cpp
index 0f27310264..59da5112ae 100644
--- a/editor/plugins/spatial_editor_plugin.cpp
+++ b/editor/plugins/spatial_editor_plugin.cpp
@@ -2219,15 +2219,9 @@ void SpatialEditorViewport::_notification(int p_what) {
viewport->set_hdr(hdr);
bool show_info = view_menu->get_popup()->is_item_checked(view_menu->get_popup()->get_item_index(VIEW_INFORMATION));
- if (show_info != info->is_visible()) {
- if (show_info)
- info->show();
- else
- info->hide();
- }
+ info_label->set_visible(show_info);
if (show_info) {
-
String text;
text += TTR("Objects Drawn") + ": " + itos(viewport->get_render_info(Viewport::RENDER_INFO_OBJECTS_IN_FRAME)) + "\n";
text += TTR("Material Changes") + ": " + itos(viewport->get_render_info(Viewport::RENDER_INFO_MATERIAL_CHANGES_IN_FRAME)) + "\n";
@@ -2235,38 +2229,19 @@ void SpatialEditorViewport::_notification(int p_what) {
text += TTR("Surface Changes") + ": " + itos(viewport->get_render_info(Viewport::RENDER_INFO_SURFACE_CHANGES_IN_FRAME)) + "\n";
text += TTR("Draw Calls") + ": " + itos(viewport->get_render_info(Viewport::RENDER_INFO_DRAW_CALLS_IN_FRAME)) + "\n";
text += TTR("Vertices") + ": " + itos(viewport->get_render_info(Viewport::RENDER_INFO_VERTICES_IN_FRAME));
-
- if (info_label->get_text() != text || surface->get_size() != prev_size) {
- info_label->set_text(text);
- Size2 ms = info->get_minimum_size();
- info->set_position(surface->get_size() - ms - Vector2(20, 20) * EDSCALE);
- }
+ info_label->set_text(text);
}
// FPS Counter.
bool show_fps = view_menu->get_popup()->is_item_checked(view_menu->get_popup()->get_item_index(VIEW_FPS));
- if (show_fps != fps->is_visible()) {
- if (show_fps)
- fps->show();
- else
- fps->hide();
- }
+ fps_label->set_visible(show_fps);
if (show_fps) {
String text;
const float temp_fps = Engine::get_singleton()->get_frames_per_second();
text += TTR("FPS") + ": " + itos(temp_fps) + " (" + String::num(1000.0f / temp_fps, 2) + " ms)";
-
- if (fps_label->get_text() != text || surface->get_size() != prev_size) {
- fps_label->set_text(text);
- Size2 ms = fps->get_size();
- Size2 size = surface->get_size();
- size.y = ms.y + 20;
- fps->set_position(size - ms - Vector2(20, 0) * EDSCALE);
- }
+ fps_label->set_text(text);
}
-
- prev_size = surface->get_size();
}
if (p_what == NOTIFICATION_ENTER_TREE) {
@@ -2275,8 +2250,8 @@ void SpatialEditorViewport::_notification(int p_what) {
surface->connect("gui_input", this, "_sinput");
surface->connect("mouse_entered", this, "_smouseenter");
surface->connect("mouse_exited", this, "_smouseexit");
- info->add_style_override("panel", get_stylebox("panel", "Panel"));
- fps->add_style_override("panel", get_stylebox("panel", "Panel"));
+ info_label->add_style_override("normal", editor->get_gui_base()->get_stylebox("Information3dViewport", "EditorStyles"));
+ fps_label->add_style_override("normal", editor->get_gui_base()->get_stylebox("Information3dViewport", "EditorStyles"));
preview_camera->set_icon(get_icon("Camera", "EditorIcons"));
_init_gizmo_instance(index);
}
@@ -2773,8 +2748,10 @@ void SpatialEditorViewport::set_can_preview(Camera *p_preview) {
if (!preview_camera->is_pressed()) {
if (p_preview) {
+ fps_label->set_anchor_and_margin(MARGIN_TOP, ANCHOR_BEGIN, 15 * EDSCALE + preview_camera->get_size().height);
preview_camera->show();
} else {
+ fps_label->set_anchor_and_margin(MARGIN_TOP, ANCHOR_BEGIN, 10 * EDSCALE);
preview_camera->hide();
}
}
@@ -3399,20 +3376,24 @@ SpatialEditorViewport::SpatialEditorViewport(SpatialEditor *p_spatial_editor, Ed
preview_node = NULL;
- info = memnew(PanelContainer);
- info->set_self_modulate(Color(1, 1, 1, 0.4));
- surface->add_child(info);
info_label = memnew(Label);
- info->add_child(info_label);
- info->hide();
+ info_label->set_anchor_and_margin(MARGIN_LEFT, ANCHOR_END, -90 * EDSCALE);
+ info_label->set_anchor_and_margin(MARGIN_TOP, ANCHOR_END, -90 * EDSCALE);
+ info_label->set_anchor_and_margin(MARGIN_RIGHT, ANCHOR_END, -10 * EDSCALE);
+ info_label->set_anchor_and_margin(MARGIN_BOTTOM, ANCHOR_END, -10 * EDSCALE);
+ info_label->set_h_grow_direction(GROW_DIRECTION_BEGIN);
+ info_label->set_v_grow_direction(GROW_DIRECTION_BEGIN);
+ surface->add_child(info_label);
+ info_label->hide();
// FPS Counter.
- fps = memnew(PanelContainer);
- fps->set_self_modulate(Color(1, 1, 1, 0.4));
- surface->add_child(fps);
fps_label = memnew(Label);
- fps->add_child(fps_label);
- fps->hide();
+ fps_label->set_anchor_and_margin(MARGIN_LEFT, ANCHOR_END, -90 * EDSCALE);
+ fps_label->set_anchor_and_margin(MARGIN_TOP, ANCHOR_BEGIN, 10 * EDSCALE);
+ fps_label->set_anchor_and_margin(MARGIN_RIGHT, ANCHOR_END, -10 * EDSCALE);
+ fps_label->set_h_grow_direction(GROW_DIRECTION_BEGIN);
+ surface->add_child(fps_label);
+ fps_label->hide();
accept = NULL;
diff --git a/editor/plugins/spatial_editor_plugin.h b/editor/plugins/spatial_editor_plugin.h
index 86b814ab8a..4aa1d9c0c1 100644
--- a/editor/plugins/spatial_editor_plugin.h
+++ b/editor/plugins/spatial_editor_plugin.h
@@ -106,7 +106,6 @@ private:
int index;
String name;
void _menu_option(int p_option);
- Size2 prev_size;
Spatial *preview_node;
AABB *preview_bounds;
@@ -136,10 +135,7 @@ private:
bool freelook_active;
real_t freelook_speed;
- PanelContainer *info;
Label *info_label;
-
- PanelContainer *fps;
Label *fps_label;
struct _RayResult {
diff --git a/editor/plugins/tile_set_editor_plugin.cpp b/editor/plugins/tile_set_editor_plugin.cpp
index ae726b69ef..5eb3435e24 100644
--- a/editor/plugins/tile_set_editor_plugin.cpp
+++ b/editor/plugins/tile_set_editor_plugin.cpp
@@ -1435,13 +1435,13 @@ bool AutotileEditorHelper::_get(const StringName &p_name, Variant &r_ret) const
return false;
String name = p_name.operator String();
+ bool v = false;
if (name == "bitmask_mode") {
- r_ret = tile_set->get(String::num(autotile_editor->get_current_tile(), 0) + "/autotile/bitmask_mode");
+ r_ret = tile_set->get(String::num(autotile_editor->get_current_tile(), 0) + "/autotile/bitmask_mode", &v);
} else if (name.left(7) == "layout/") {
- bool v;
r_ret = tile_set->get(String::num(autotile_editor->get_current_tile(), 0) + "/autotile" + name.right(6), &v);
- return v;
}
+ return v;
}
void AutotileEditorHelper::_get_property_list(List<PropertyInfo> *p_list) const {
diff --git a/editor/project_settings_editor.cpp b/editor/project_settings_editor.cpp
index 1a7b7f3575..6f8573cd70 100644
--- a/editor/project_settings_editor.cpp
+++ b/editor/project_settings_editor.cpp
@@ -1690,13 +1690,13 @@ ProjectSettingsEditor::ProjectSettingsEditor(EditorData *p_data) {
vbc->set_anchor_and_margin(MARGIN_LEFT, ANCHOR_BEGIN, 0);
vbc->set_anchor_and_margin(MARGIN_RIGHT, ANCHOR_END, 0);
- l = memnew(Label);
- vbc->add_child(l);
- l->set_text(TTR("Action:"));
-
hbc = memnew(HBoxContainer);
vbc->add_child(hbc);
+ l = memnew(Label);
+ hbc->add_child(l);
+ l->set_text(TTR("Action:"));
+
action_name = memnew(LineEdit);
action_name->set_h_size_flags(SIZE_EXPAND_FILL);
hbc->add_child(action_name);
diff --git a/editor/property_editor.cpp b/editor/property_editor.cpp
index 623b0e15ab..47feac9a12 100644
--- a/editor/property_editor.cpp
+++ b/editor/property_editor.cpp
@@ -4599,7 +4599,7 @@ SectionedPropertyEditor::SectionedPropertyEditor() {
sections->set_v_size_flags(SIZE_EXPAND_FILL);
sections->set_hide_root(true);
- left_vb->add_margin_child(TTR("Sections:"), sections, true);
+ left_vb->add_child(sections, true);
VBoxContainer *right_vb = memnew(VBoxContainer);
right_vb->set_h_size_flags(SIZE_EXPAND_FILL);
@@ -4608,7 +4608,7 @@ SectionedPropertyEditor::SectionedPropertyEditor() {
filter = memnew(SectionedPropertyEditorFilter);
editor = memnew(PropertyEditor);
editor->set_v_size_flags(SIZE_EXPAND_FILL);
- right_vb->add_margin_child(TTR("Properties:"), editor, true);
+ right_vb->add_child(editor, true);
editor->get_scene_tree()->set_column_titles_visible(false);
diff --git a/editor/property_editor.h b/editor/property_editor.h
index f684f5768d..115ce07339 100644
--- a/editor/property_editor.h
+++ b/editor/property_editor.h
@@ -314,9 +314,9 @@ public:
class SectionedPropertyEditorFilter;
-class SectionedPropertyEditor : public HBoxContainer {
+class SectionedPropertyEditor : public HSplitContainer {
- GDCLASS(SectionedPropertyEditor, HBoxContainer);
+ GDCLASS(SectionedPropertyEditor, HSplitContainer);
ObjectID obj;
diff --git a/editor/scene_tree_dock.cpp b/editor/scene_tree_dock.cpp
index 4d5d467857..6fbca5c904 100644
--- a/editor/scene_tree_dock.cpp
+++ b/editor/scene_tree_dock.cpp
@@ -1699,12 +1699,11 @@ void SceneTreeDock::_add_children_to_popup(Object *p_obj, int p_depth) {
icon = get_icon("Object", "EditorIcons");
if (menu->get_item_count() == 0) {
- menu->add_item(TTR("Sub-Resources:"));
- menu->set_item_disabled(0, true);
+ menu->add_submenu_item(TTR("Sub-Resources:"), "Sub-Resources");
}
- int index = menu->get_item_count();
- menu->add_icon_item(icon, E->get().name.capitalize(), EDIT_SUBRESOURCE_BASE + subresources.size());
- menu->set_item_h_offset(index, p_depth * 10 * EDSCALE);
+ int index = menu_subresources->get_item_count();
+ menu_subresources->add_icon_item(icon, E->get().name.capitalize(), EDIT_SUBRESOURCE_BASE + subresources.size());
+ menu_subresources->set_item_h_offset(index, p_depth * 10 * EDSCALE);
subresources.push_back(obj->get_instance_id());
_add_children_to_popup(obj, p_depth + 1);
@@ -2049,6 +2048,9 @@ SceneTreeDock::SceneTreeDock(EditorNode *p_editor, Node *p_scene_root, EditorSel
menu = memnew(PopupMenu);
add_child(menu);
menu->connect("id_pressed", this, "_tool_selected");
+ menu_subresources = memnew(PopupMenu);
+ menu_subresources->set_name("Sub-Resources");
+ menu->add_child(menu_subresources);
first_enter = true;
restore_script_editor_on_drag = false;
diff --git a/editor/scene_tree_dock.h b/editor/scene_tree_dock.h
index 41d5bda180..6a281bb7e8 100644
--- a/editor/scene_tree_dock.h
+++ b/editor/scene_tree_dock.h
@@ -119,6 +119,7 @@ class SceneTreeDock : public VBoxContainer {
TextureRect *filter_icon;
PopupMenu *menu;
+ PopupMenu *menu_subresources;
ConfirmationDialog *clear_inherit_confirm;
bool first_enter;
diff --git a/editor/settings_config_dialog.cpp b/editor/settings_config_dialog.cpp
index fccd0c51aa..2bdc824248 100644
--- a/editor/settings_config_dialog.cpp
+++ b/editor/settings_config_dialog.cpp
@@ -100,6 +100,8 @@ void EditorSettingsDialog::popup_edit_settings() {
} else {
popup_centered_ratio(0.7);
}
+
+ _focus_current_search_box();
}
void EditorSettingsDialog::_clear_search_box() {
@@ -137,13 +139,18 @@ void EditorSettingsDialog::_notification(int p_what) {
undo_redo->set_commit_notify_callback(_undo_redo_callback, this);
} break;
case NOTIFICATION_ENTER_TREE: {
- clear_button->set_icon(get_icon("Close", "EditorIcons"));
- shortcut_clear_button->set_icon(get_icon("Close", "EditorIcons"));
+ _update_icons();
} break;
case NOTIFICATION_POPUP_HIDE: {
EditorSettings::get_singleton()->set("interface/dialogs/editor_settings_bounds", get_rect());
set_process_unhandled_input(false);
} break;
+ case EditorSettings::NOTIFICATION_EDITOR_SETTINGS_CHANGED: {
+ _update_icons();
+ // Update theme colors.
+ property_editor->update_category_list();
+ _update_shortcuts();
+ } break;
}
}
@@ -179,6 +186,14 @@ void EditorSettingsDialog::_unhandled_input(const Ref<InputEvent> &p_event) {
}
}
+void EditorSettingsDialog::_update_icons() {
+
+ search_box->add_icon_override("right_icon", get_icon("Search", "EditorIcons"));
+ shortcut_search_box->add_icon_override("right_icon", get_icon("Search", "EditorIcons"));
+ clear_button->set_icon(get_icon("Close", "EditorIcons"));
+ shortcut_clear_button->set_icon(get_icon("Close", "EditorIcons"));
+}
+
void EditorSettingsDialog::_update_shortcuts() {
shortcuts->clear();
@@ -329,6 +344,26 @@ void EditorSettingsDialog::_press_a_key_confirm() {
undo_redo->commit_action();
}
+void EditorSettingsDialog::_tabs_tab_changed(int p_tab) {
+
+ _focus_current_search_box();
+}
+
+void EditorSettingsDialog::_focus_current_search_box() {
+
+ Control *tab = tabs->get_current_tab_control();
+ LineEdit *current_search_box;
+ if (tab == tab_general)
+ current_search_box = search_box;
+ else if (tab == tab_shortcuts)
+ current_search_box = shortcut_search_box;
+
+ if (current_search_box) {
+ current_search_box->grab_focus();
+ current_search_box->select_all();
+ }
+}
+
void EditorSettingsDialog::_bind_methods() {
ClassDB::bind_method(D_METHOD("_unhandled_input"), &EditorSettingsDialog::_unhandled_input);
@@ -342,6 +377,7 @@ void EditorSettingsDialog::_bind_methods() {
ClassDB::bind_method(D_METHOD("_update_shortcuts"), &EditorSettingsDialog::_update_shortcuts);
ClassDB::bind_method(D_METHOD("_press_a_key_confirm"), &EditorSettingsDialog::_press_a_key_confirm);
ClassDB::bind_method(D_METHOD("_wait_for_key"), &EditorSettingsDialog::_wait_for_key);
+ ClassDB::bind_method(D_METHOD("_tabs_tab_changed"), &EditorSettingsDialog::_tabs_tab_changed);
}
EditorSettingsDialog::EditorSettingsDialog() {
@@ -352,20 +388,19 @@ EditorSettingsDialog::EditorSettingsDialog() {
tabs = memnew(TabContainer);
tabs->set_tab_align(TabContainer::ALIGN_LEFT);
+ tabs->connect("tab_changed", this, "_tabs_tab_changed");
add_child(tabs);
//set_child_rect(tabs);
- VBoxContainer *vbc = memnew(VBoxContainer);
- tabs->add_child(vbc);
- vbc->set_name(TTR("General"));
+ // General Tab
+
+ tab_general = memnew(VBoxContainer);
+ tabs->add_child(tab_general);
+ tab_general->set_name(TTR("General"));
HBoxContainer *hbc = memnew(HBoxContainer);
hbc->set_h_size_flags(Control::SIZE_EXPAND_FILL);
- vbc->add_child(hbc);
-
- Label *l = memnew(Label);
- l->set_text(TTR("Search:") + " ");
- hbc->add_child(l);
+ tab_general->add_child(hbc);
search_box = memnew(LineEdit);
search_box->set_h_size_flags(Control::SIZE_EXPAND_FILL);
@@ -381,20 +416,18 @@ EditorSettingsDialog::EditorSettingsDialog() {
property_editor->register_search_box(search_box);
property_editor->set_v_size_flags(Control::SIZE_EXPAND_FILL);
property_editor->get_property_editor()->set_undo_redo(undo_redo);
- vbc->add_child(property_editor);
+ tab_general->add_child(property_editor);
property_editor->get_property_editor()->connect("property_edited", this, "_settings_property_edited");
- vbc = memnew(VBoxContainer);
- tabs->add_child(vbc);
- vbc->set_name(TTR("Shortcuts"));
+ // Shortcuts Tab
+
+ tab_shortcuts = memnew(VBoxContainer);
+ tabs->add_child(tab_shortcuts);
+ tab_shortcuts->set_name(TTR("Shortcuts"));
hbc = memnew(HBoxContainer);
hbc->set_h_size_flags(Control::SIZE_EXPAND_FILL);
- vbc->add_child(hbc);
-
- l = memnew(Label);
- l->set_text(TTR("Search:") + " ");
- hbc->add_child(l);
+ tab_shortcuts->add_child(hbc);
shortcut_search_box = memnew(LineEdit);
shortcut_search_box->set_h_size_flags(Control::SIZE_EXPAND_FILL);
@@ -406,7 +439,8 @@ EditorSettingsDialog::EditorSettingsDialog() {
shortcut_clear_button->connect("pressed", this, "_clear_shortcut_search_box");
shortcuts = memnew(Tree);
- vbc->add_margin_child(TTR("Shortcut List:"), shortcuts, true);
+ tab_shortcuts->add_child(shortcuts, true);
+ shortcuts->set_v_size_flags(SIZE_EXPAND_FILL);
shortcuts->set_columns(2);
shortcuts->set_hide_root(true);
//shortcuts->set_hide_folding(true);
@@ -419,7 +453,7 @@ EditorSettingsDialog::EditorSettingsDialog() {
press_a_key->set_focus_mode(FOCUS_ALL);
add_child(press_a_key);
- l = memnew(Label);
+ Label *l = memnew(Label);
l->set_text(TTR("Press a Key.."));
l->set_anchors_and_margins_preset(Control::PRESET_WIDE);
l->set_align(Label::ALIGN_CENTER);
diff --git a/editor/settings_config_dialog.h b/editor/settings_config_dialog.h
index a03b15c06d..64b8833821 100644
--- a/editor/settings_config_dialog.h
+++ b/editor/settings_config_dialog.h
@@ -41,6 +41,8 @@ class EditorSettingsDialog : public AcceptDialog {
bool updating;
TabContainer *tabs;
+ Control *tab_general;
+ Control *tab_shortcuts;
LineEdit *search_box;
LineEdit *shortcut_search_box;
@@ -68,10 +70,14 @@ class EditorSettingsDialog : public AcceptDialog {
void _unhandled_input(const Ref<InputEvent> &p_event);
void _notification(int p_what);
+ void _update_icons();
void _press_a_key_confirm();
void _wait_for_key(const Ref<InputEvent> &p_event);
+ void _tabs_tab_changed(int p_tab);
+ void _focus_current_search_box();
+
void _clear_shortcut_search_box();
void _clear_search_box();
diff --git a/editor/spatial_editor_gizmos.cpp b/editor/spatial_editor_gizmos.cpp
index f0e8d438fa..5359f9894c 100644
--- a/editor/spatial_editor_gizmos.cpp
+++ b/editor/spatial_editor_gizmos.cpp
@@ -1529,6 +1529,8 @@ SkeletonSpatialGizmo::SkeletonSpatialGizmo(Skeleton *p_skel) {
skel = p_skel;
set_spatial_node(p_skel);
}
+
+// FIXME: Kept as reference for reimplementation in 3.1+
#if 0
void RoomSpatialGizmo::redraw() {
diff --git a/modules/gdnative/SCsub b/modules/gdnative/SCsub
index fd11c8d094..4e73ebfb9d 100644
--- a/modules/gdnative/SCsub
+++ b/modules/gdnative/SCsub
@@ -3,12 +3,12 @@
Import('env')
gdn_env = env.Clone()
-
-gdn_env.add_source_files(env.modules_sources, "gd_native_library_editor.cpp")
gdn_env.add_source_files(env.modules_sources, "gdnative.cpp")
gdn_env.add_source_files(env.modules_sources, "register_types.cpp")
gdn_env.add_source_files(env.modules_sources, "gdnative/*.cpp")
gdn_env.add_source_files(env.modules_sources, "nativescript/*.cpp")
+gdn_env.add_source_files(env.modules_sources, "gdnative_library_singleton_editor.cpp")
+gdn_env.add_source_files(env.modules_sources, "gdnative_library_editor_plugin.cpp")
gdn_env.Append(CPPPATH=['#modules/gdnative/include/'])
diff --git a/modules/gdnative/gdnative_library_editor_plugin.cpp b/modules/gdnative/gdnative_library_editor_plugin.cpp
new file mode 100644
index 0000000000..1e638ab702
--- /dev/null
+++ b/modules/gdnative/gdnative_library_editor_plugin.cpp
@@ -0,0 +1,423 @@
+/*************************************************************************/
+/* gdnative_library_editor_plugin.cpp */
+/*************************************************************************/
+/* This file is part of: */
+/* GODOT ENGINE */
+/* https://godotengine.org */
+/*************************************************************************/
+/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
+/* */
+/* Permission is hereby granted, free of charge, to any person obtaining */
+/* a copy of this software and associated documentation files (the */
+/* "Software"), to deal in the Software without restriction, including */
+/* without limitation the rights to use, copy, modify, merge, publish, */
+/* distribute, sublicense, and/or sell copies of the Software, and to */
+/* permit persons to whom the Software is furnished to do so, subject to */
+/* the following conditions: */
+/* */
+/* The above copyright notice and this permission notice shall be */
+/* included in all copies or substantial portions of the Software. */
+/* */
+/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */
+/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */
+/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/
+/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */
+/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */
+/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
+/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
+/*************************************************************************/
+
+#ifdef TOOLS_ENABLED
+#include "gdnative_library_editor_plugin.h"
+#include "gdnative.h"
+
+void GDNativeLibraryEditor::edit(Ref<GDNativeLibrary> p_library) {
+ library = p_library;
+ Ref<ConfigFile> config = p_library->get_config_file();
+
+ for (Map<String, NativePlatformConfig>::Element *E = platforms.front(); E; E = E->next()) {
+ for (List<String>::Element *it = E->value().entries.front(); it; it = it->next()) {
+
+ String target = E->key() + "." + it->get();
+ TargetConfig ecfg;
+ ecfg.library = config->get_value("entry", target, "");
+ ecfg.dependencies = config->get_value("dependencies", target, Array());
+ entry_configs[target] = ecfg;
+ }
+ }
+
+ _update_tree();
+}
+
+void GDNativeLibraryEditor::_bind_methods() {
+
+ ClassDB::bind_method("_on_item_button", &GDNativeLibraryEditor::_on_item_button);
+ ClassDB::bind_method("_on_library_selected", &GDNativeLibraryEditor::_on_library_selected);
+ ClassDB::bind_method("_on_dependencies_selected", &GDNativeLibraryEditor::_on_dependencies_selected);
+ ClassDB::bind_method("_on_filter_selected", &GDNativeLibraryEditor::_on_filter_selected);
+ ClassDB::bind_method("_on_item_collapsed", &GDNativeLibraryEditor::_on_item_collapsed);
+ ClassDB::bind_method("_on_item_activated", &GDNativeLibraryEditor::_on_item_activated);
+ ClassDB::bind_method("_on_create_new_entry", &GDNativeLibraryEditor::_on_create_new_entry);
+}
+
+void GDNativeLibraryEditor::_update_tree() {
+
+ tree->clear();
+ TreeItem *root = tree->create_item();
+
+ for (Map<String, NativePlatformConfig>::Element *E = platforms.front(); E; E = E->next()) {
+
+ if (showing_platform != E->key() && showing_platform != "All")
+ continue;
+
+ TreeItem *platform = tree->create_item(root);
+ platform->set_text(0, E->get().name);
+ platform->set_metadata(0, E->get().library_extension);
+
+ platform->set_custom_bg_color(0, get_color("prop_category", "Editor"));
+ platform->set_custom_bg_color(1, get_color("prop_category", "Editor"));
+ platform->set_custom_bg_color(2, get_color("prop_category", "Editor"));
+ platform->set_selectable(0, false);
+ platform->set_expand_right(0, true);
+
+ for (List<String>::Element *it = E->value().entries.front(); it; it = it->next()) {
+
+ String target = E->key() + "." + it->get();
+ TreeItem *bit = tree->create_item(platform);
+
+ bit->set_text(0, it->get());
+ bit->set_metadata(0, target);
+ bit->set_selectable(0, false);
+ bit->set_custom_bg_color(0, get_color("prop_subsection", "Editor"));
+
+ bit->add_button(1, get_icon("Folder", "EditorIcons"), BUTTON_SELECT_LIBRARY, false, TTR("Select the dynamic library for this entry"));
+ String file = entry_configs[target].library;
+ if (!file.empty()) {
+ bit->add_button(1, get_icon("Clear", "EditorIcons"), BUTTON_CLEAR_LIBRARY, false, TTR("Clear"));
+ }
+ bit->set_text(1, file);
+
+ bit->add_button(2, get_icon("Folder", "EditorIcons"), BUTTON_SELECT_DEPENDENCES, false, TTR("Select dependencies of the library for this entry"));
+ Array files = entry_configs[target].dependencies;
+ if (files.size()) {
+ bit->add_button(2, get_icon("Clear", "EditorIcons"), BUTTON_CLEAR_DEPENDENCES, false, TTR("Clear"));
+ }
+ bit->set_text(2, Variant(files));
+
+ bit->add_button(3, get_icon("MoveUp", "EditorIcons"), BUTTON_MOVE_UP, false, TTR("Move Up"));
+ bit->add_button(3, get_icon("MoveDown", "EditorIcons"), BUTTON_MOVE_DOWN, false, TTR("Move Down"));
+ bit->add_button(3, get_icon("Remove", "EditorIcons"), BUTTON_ERASE_ENTRY, false, TTR("Remove current entry"));
+ }
+
+ TreeItem *new_arch = tree->create_item(platform);
+ new_arch->set_text(0, TTR("Double click to create a new entry"));
+ new_arch->set_text_align(0, TreeItem::ALIGN_CENTER);
+ new_arch->set_custom_color(0, get_color("accent_color", "Editor"));
+ new_arch->set_expand_right(0, true);
+ new_arch->set_metadata(1, E->key());
+
+ platform->set_collapsed(collapsed_items.find(E->get().name) != NULL);
+ }
+}
+
+void GDNativeLibraryEditor::_on_item_button(Object *item, int column, int id) {
+
+ String target = Object::cast_to<TreeItem>(item)->get_metadata(0);
+ String platform = target.substr(0, target.find("."));
+ String entry = target.substr(platform.length() + 1, target.length());
+ String section = (id == BUTTON_SELECT_DEPENDENCES || id == BUTTON_CLEAR_DEPENDENCES) ? "dependencies" : "entry";
+
+ if (id == BUTTON_SELECT_LIBRARY || id == BUTTON_SELECT_DEPENDENCES) {
+
+ EditorFileDialog::Mode mode = EditorFileDialog::MODE_OPEN_FILE;
+ if (id == BUTTON_SELECT_DEPENDENCES)
+ mode = EditorFileDialog::MODE_OPEN_FILES;
+
+ file_dialog->set_meta("target", target);
+ file_dialog->set_meta("section", section);
+ file_dialog->clear_filters();
+ file_dialog->add_filter(Object::cast_to<TreeItem>(item)->get_parent()->get_metadata(0));
+ file_dialog->set_mode(mode);
+ file_dialog->popup_centered_ratio();
+
+ } else if (id == BUTTON_CLEAR_LIBRARY) {
+ _set_target_value(section, target, "");
+ } else if (id == BUTTON_CLEAR_DEPENDENCES) {
+ _set_target_value(section, target, Array());
+ } else if (id == BUTTON_ERASE_ENTRY) {
+ _erase_entry(platform, entry);
+ } else if (id == BUTTON_MOVE_UP || id == BUTTON_MOVE_DOWN) {
+ _move_entry(platform, entry, id);
+ }
+}
+
+void GDNativeLibraryEditor::_on_library_selected(const String &file) {
+
+ _set_target_value(file_dialog->get_meta("section"), file_dialog->get_meta("target"), file);
+}
+
+void GDNativeLibraryEditor::_on_dependencies_selected(const PoolStringArray &files) {
+
+ _set_target_value(file_dialog->get_meta("section"), file_dialog->get_meta("target"), files);
+}
+
+void GDNativeLibraryEditor::_on_filter_selected(int id) {
+
+ showing_platform = filter->get_item_metadata(id);
+ _update_tree();
+}
+
+void GDNativeLibraryEditor::_on_item_collapsed(Object *p_item) {
+
+ TreeItem *item = Object::cast_to<TreeItem>(p_item);
+ String name = item->get_text(0);
+
+ if (item->is_collapsed()) {
+ collapsed_items.insert(name);
+ } else if (Set<String>::Element *e = collapsed_items.find(name)) {
+ collapsed_items.erase(e);
+ }
+}
+
+void GDNativeLibraryEditor::_on_item_activated() {
+
+ TreeItem *item = tree->get_selected();
+ if (item && tree->get_selected_column() == 0 && item->get_metadata(0).get_type() == Variant::NIL) {
+ new_architecture_dialog->set_meta("platform", item->get_metadata(1));
+ new_architecture_dialog->popup_centered();
+ }
+}
+
+void GDNativeLibraryEditor::_on_create_new_entry() {
+
+ String platform = new_architecture_dialog->get_meta("platform");
+ String entry = new_architecture_input->get_text().strip_edges();
+ if (!entry.empty()) {
+ platforms[platform].entries.push_back(entry);
+ _update_tree();
+ }
+}
+
+void GDNativeLibraryEditor::_set_target_value(const String &section, const String &target, Variant file) {
+ if (section == "entry")
+ entry_configs[target].library = file;
+ else if (section == "dependencies")
+ entry_configs[target].dependencies = file;
+ _translate_to_config_file();
+ _update_tree();
+}
+
+void GDNativeLibraryEditor::_erase_entry(const String &platform, const String &entry) {
+
+ if (platforms.has(platform)) {
+ if (List<String>::Element *E = platforms[platform].entries.find(entry)) {
+
+ String target = platform + "." + entry;
+ Ref<ConfigFile> config = library->get_config_file();
+
+ platforms[platform].entries.erase(E);
+ _set_target_value("entry", target, "");
+ _set_target_value("dependencies", target, Array());
+ _translate_to_config_file();
+ _update_tree();
+ }
+ }
+}
+
+void GDNativeLibraryEditor::_move_entry(const String &platform, const String &entry, int dir) {
+ if (List<String>::Element *E = platforms[platform].entries.find(entry)) {
+ if (E->prev() && dir == BUTTON_MOVE_UP) {
+ platforms[platform].entries.insert_before(E->prev(), E->get());
+ platforms[platform].entries.erase(E);
+ } else if (E->next() && dir == BUTTON_MOVE_DOWN) {
+ platforms[platform].entries.insert_after(E->next(), E->get());
+ platforms[platform].entries.erase(E);
+ }
+ _translate_to_config_file();
+ _update_tree();
+ }
+}
+
+void GDNativeLibraryEditor::_translate_to_config_file() {
+
+ if (!library.is_null()) {
+
+ Ref<ConfigFile> config = library->get_config_file();
+ config->erase_section("entry");
+ config->erase_section("dependencies");
+
+ for (Map<String, NativePlatformConfig>::Element *E = platforms.front(); E; E = E->next()) {
+ for (List<String>::Element *it = E->value().entries.front(); it; it = it->next()) {
+
+ String target = E->key() + "." + it->get();
+ if (entry_configs[target].library.empty() && entry_configs[target].dependencies.empty())
+ continue;
+
+ config->set_value("entry", target, entry_configs[target].library);
+ config->set_value("dependencies", target, entry_configs[target].dependencies);
+ }
+ }
+
+ library->_change_notify();
+ }
+}
+
+GDNativeLibraryEditor::GDNativeLibraryEditor() {
+
+ showing_platform = "All";
+
+ { // Define platforms
+ NativePlatformConfig platform_windows;
+ platform_windows.name = "Windows";
+ platform_windows.entries.push_back("64");
+ platform_windows.entries.push_back("32");
+ platform_windows.library_extension = "*.dll";
+ platforms["Windows"] = platform_windows;
+
+ NativePlatformConfig platform_linux;
+ platform_linux.name = "Linux/X11";
+ platform_linux.entries.push_back("64");
+ platform_linux.entries.push_back("32");
+ platform_linux.library_extension = "*.so";
+ platforms["X11"] = platform_linux;
+
+ NativePlatformConfig platform_osx;
+ platform_osx.name = "Mac OSX";
+ platform_osx.entries.push_back("64");
+ platform_osx.entries.push_back("32");
+ platform_osx.library_extension = "*.dylib";
+ platforms["OSX"] = platform_osx;
+
+ NativePlatformConfig platform_haiku;
+ platform_haiku.name = "Haiku";
+ platform_haiku.entries.push_back("64");
+ platform_haiku.entries.push_back("32");
+ platform_haiku.library_extension = "*.so";
+ platforms["Haiku"] = platform_haiku;
+
+ NativePlatformConfig platform_uwp;
+ platform_uwp.name = "Windows Universal";
+ platform_uwp.entries.push_back("arm");
+ platform_uwp.entries.push_back("x86");
+ platform_uwp.entries.push_back("x64");
+ platform_uwp.library_extension = "*.dll";
+ platforms["UWP"] = platform_uwp;
+
+ NativePlatformConfig platform_android;
+ platform_android.name = "Android";
+ platform_android.entries.push_back("armeabi-v7a");
+ platform_android.entries.push_back("arm64-v8a");
+ platform_android.entries.push_back("x86");
+ platform_android.entries.push_back("x86_64");
+ platform_android.library_extension = "*.so";
+ platforms["Android"] = platform_android;
+
+ // TODO: Javascript platform is not supported yet
+ // NativePlatformConfig platform_html5;
+ // platform_html5.name = "HTML5";
+ // platform_html5.library_extension = "*.wasm";
+ // platforms["Javascript"] = platform_html5;
+
+ NativePlatformConfig platform_ios;
+ platform_ios.name = "iOS";
+ platform_ios.entries.push_back("armv7");
+ platform_ios.entries.push_back("arm64");
+ platform_ios.library_extension = "*.dylib";
+ platforms["iOS"] = platform_ios;
+ }
+
+ VBoxContainer *container = memnew(VBoxContainer);
+ add_child(container);
+ container->set_anchors_and_margins_preset(PRESET_WIDE);
+
+ HBoxContainer *hbox = memnew(HBoxContainer);
+ container->add_child(hbox);
+ Label *label = memnew(Label);
+ label->set_text(TTR("Platform:"));
+ hbox->add_child(label);
+ filter = memnew(OptionButton);
+ hbox->add_child(filter);
+ filter->set_h_size_flags(SIZE_EXPAND_FILL);
+
+ int idx = 0;
+ filter->add_item(TTR("All"), idx);
+ filter->set_item_metadata(idx, "All");
+ idx += 1;
+ for (Map<String, NativePlatformConfig>::Element *E = platforms.front(); E; E = E->next()) {
+ filter->add_item(E->get().name, idx);
+ filter->set_item_metadata(idx, E->key());
+ idx += 1;
+ }
+ filter->connect("item_selected", this, "_on_filter_selected");
+
+ tree = memnew(Tree);
+ container->add_child(tree);
+ tree->set_v_size_flags(SIZE_EXPAND_FILL);
+ tree->set_hide_root(true);
+ tree->set_column_titles_visible(true);
+ tree->set_columns(4);
+ tree->set_column_expand(0, false);
+ tree->set_column_min_width(0, int(200 * EDSCALE));
+ tree->set_column_title(0, TTR("Platform"));
+ tree->set_column_title(1, TTR("Dynamic Library"));
+ tree->set_column_title(2, TTR("Dependencies"));
+ tree->set_column_expand(3, false);
+ tree->set_column_min_width(3, int(110 * EDSCALE));
+ tree->connect("button_pressed", this, "_on_item_button");
+ tree->connect("item_collapsed", this, "_on_item_collapsed");
+ tree->connect("item_activated", this, "_on_item_activated");
+
+ file_dialog = memnew(EditorFileDialog);
+ file_dialog->set_access(EditorFileDialog::ACCESS_RESOURCES);
+ file_dialog->set_resizable(true);
+ add_child(file_dialog);
+ file_dialog->connect("file_selected", this, "_on_library_selected");
+ file_dialog->connect("files_selected", this, "_on_dependencies_selected");
+
+ new_architecture_dialog = memnew(ConfirmationDialog);
+ add_child(new_architecture_dialog);
+ new_architecture_dialog->set_title(TTR("Add an architecture entry"));
+ new_architecture_input = memnew(LineEdit);
+ new_architecture_dialog->add_child(new_architecture_input);
+ new_architecture_dialog->set_custom_minimum_size(Vector2(300, 80) * EDSCALE);
+ new_architecture_input->set_anchors_and_margins_preset(PRESET_HCENTER_WIDE, PRESET_MODE_MINSIZE, 5 * EDSCALE);
+ new_architecture_dialog->get_ok()->connect("pressed", this, "_on_create_new_entry");
+}
+
+void GDNativeLibraryEditorPlugin::edit(Object *p_node) {
+
+ if (Object::cast_to<GDNativeLibrary>(p_node)) {
+ library_editor->edit(Object::cast_to<GDNativeLibrary>(p_node));
+ library_editor->show();
+ } else
+ library_editor->hide();
+}
+
+bool GDNativeLibraryEditorPlugin::handles(Object *p_node) const {
+
+ return p_node->is_class("GDNativeLibrary");
+}
+
+void GDNativeLibraryEditorPlugin::make_visible(bool p_visible) {
+
+ if (p_visible) {
+ button->show();
+ EditorNode::get_singleton()->make_bottom_panel_item_visible(library_editor);
+
+ } else {
+ if (library_editor->is_visible_in_tree())
+ EditorNode::get_singleton()->hide_bottom_panel();
+ button->hide();
+ }
+}
+
+GDNativeLibraryEditorPlugin::GDNativeLibraryEditorPlugin(EditorNode *p_node) {
+
+ library_editor = memnew(GDNativeLibraryEditor);
+ library_editor->set_custom_minimum_size(Size2(0, 250 * EDSCALE));
+ button = p_node->add_bottom_panel_item(TTR("GDNativeLibrary"), library_editor);
+ button->hide();
+}
+
+#endif
diff --git a/modules/gdnative/gdnative_library_editor_plugin.h b/modules/gdnative/gdnative_library_editor_plugin.h
new file mode 100644
index 0000000000..1fa6a0c945
--- /dev/null
+++ b/modules/gdnative/gdnative_library_editor_plugin.h
@@ -0,0 +1,113 @@
+/*************************************************************************/
+/* gdnative_library_editor_plugin.h */
+/*************************************************************************/
+/* This file is part of: */
+/* GODOT ENGINE */
+/* https://godotengine.org */
+/*************************************************************************/
+/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
+/* */
+/* Permission is hereby granted, free of charge, to any person obtaining */
+/* a copy of this software and associated documentation files (the */
+/* "Software"), to deal in the Software without restriction, including */
+/* without limitation the rights to use, copy, modify, merge, publish, */
+/* distribute, sublicense, and/or sell copies of the Software, and to */
+/* permit persons to whom the Software is furnished to do so, subject to */
+/* the following conditions: */
+/* */
+/* The above copyright notice and this permission notice shall be */
+/* included in all copies or substantial portions of the Software. */
+/* */
+/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */
+/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */
+/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/
+/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */
+/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */
+/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
+/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
+/*************************************************************************/
+#ifndef GDNATIVE_LIBRARY_EDITOR_PLUGIN_H
+#define GDNATIVE_LIBRARY_EDITOR_PLUGIN_H
+
+#ifdef TOOLS_ENABLED
+#include "editor/editor_node.h"
+#include "gdnative.h"
+
+class GDNativeLibraryEditor : public Control {
+
+ GDCLASS(GDNativeLibraryEditor, Control);
+
+ struct NativePlatformConfig {
+ String name;
+ String library_extension;
+ List<String> entries;
+ };
+
+ struct TargetConfig {
+ String library;
+ Array dependencies;
+ };
+
+ enum ItemButton {
+ BUTTON_SELECT_LIBRARY,
+ BUTTON_CLEAR_LIBRARY,
+ BUTTON_SELECT_DEPENDENCES,
+ BUTTON_CLEAR_DEPENDENCES,
+ BUTTON_ERASE_ENTRY,
+ BUTTON_MOVE_UP,
+ BUTTON_MOVE_DOWN,
+ };
+
+ Tree *tree;
+ OptionButton *filter;
+ EditorFileDialog *file_dialog;
+ ConfirmationDialog *new_architecture_dialog;
+ LineEdit *new_architecture_input;
+ Set<String> collapsed_items;
+
+ String showing_platform;
+ Ref<GDNativeLibrary> library;
+ Map<String, NativePlatformConfig> platforms;
+ Map<String, TargetConfig> entry_configs;
+
+protected:
+ static void _bind_methods();
+ void _update_tree();
+ void _on_item_button(Object *item, int column, int id);
+ void _on_library_selected(const String &file);
+ void _on_dependencies_selected(const PoolStringArray &files);
+ void _on_filter_selected(int id);
+ void _on_item_collapsed(Object *item);
+ void _on_item_activated();
+ void _on_create_new_entry();
+ void _set_target_value(const String &section, const String &target, Variant file);
+ void _erase_entry(const String &platform, const String &entry);
+ void _move_entry(const String &platform, const String &entry, int dir);
+ void _translate_to_config_file();
+
+public:
+ void edit(Ref<GDNativeLibrary> p_library);
+
+ GDNativeLibraryEditor();
+};
+
+class GDNativeLibraryEditorPlugin : public EditorPlugin {
+
+ GDCLASS(GDNativeLibraryEditorPlugin, EditorPlugin);
+
+ GDNativeLibraryEditor *library_editor;
+ EditorNode *editor;
+ Button *button;
+
+public:
+ virtual String get_name() const { return "GDNativeLibrary"; }
+ bool has_main_screen() const { return false; }
+ virtual void edit(Object *p_node);
+ virtual bool handles(Object *p_node) const;
+ virtual void make_visible(bool p_visible);
+
+ GDNativeLibraryEditorPlugin(EditorNode *p_node);
+};
+#endif
+#endif // GDNATIVE_LIBRARY_EDITOR_PLUGIN_H
diff --git a/modules/gdnative/gd_native_library_editor.cpp b/modules/gdnative/gdnative_library_singleton_editor.cpp
index fda5dcdcad..2ad497fcad 100644
--- a/modules/gdnative/gd_native_library_editor.cpp
+++ b/modules/gdnative/gdnative_library_singleton_editor.cpp
@@ -1,5 +1,5 @@
/*************************************************************************/
-/* gd_native_library_editor.cpp */
+/* gdnative_library_singleton_editor.cpp */
/*************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
@@ -28,11 +28,10 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
#ifdef TOOLS_ENABLED
-#include "gd_native_library_editor.h"
-
+#include "gdnative_library_singleton_editor.h"
#include "gdnative.h"
-void GDNativeLibraryEditor::_find_gdnative_singletons(EditorFileSystemDirectory *p_dir, const Set<String> &enabled_list) {
+void GDNativeLibrarySingletonEditor::_find_gdnative_singletons(EditorFileSystemDirectory *p_dir, const Set<String> &enabled_list) {
// check children
@@ -65,7 +64,7 @@ void GDNativeLibraryEditor::_find_gdnative_singletons(EditorFileSystemDirectory
}
}
-void GDNativeLibraryEditor::_update_libraries() {
+void GDNativeLibrarySingletonEditor::_update_libraries() {
updating = true;
libraries->clear();
@@ -88,7 +87,7 @@ void GDNativeLibraryEditor::_update_libraries() {
updating = false;
}
-void GDNativeLibraryEditor::_item_edited() {
+void GDNativeLibrarySingletonEditor::_item_edited() {
if (updating)
return;
@@ -119,7 +118,7 @@ void GDNativeLibraryEditor::_item_edited() {
}
}
-void GDNativeLibraryEditor::_notification(int p_what) {
+void GDNativeLibrarySingletonEditor::_notification(int p_what) {
if (p_what == NOTIFICATION_VISIBILITY_CHANGED) {
if (is_visible_in_tree()) {
@@ -128,12 +127,12 @@ void GDNativeLibraryEditor::_notification(int p_what) {
}
}
-void GDNativeLibraryEditor::_bind_methods() {
+void GDNativeLibrarySingletonEditor::_bind_methods() {
- ClassDB::bind_method(D_METHOD("_item_edited"), &GDNativeLibraryEditor::_item_edited);
+ ClassDB::bind_method(D_METHOD("_item_edited"), &GDNativeLibrarySingletonEditor::_item_edited);
}
-GDNativeLibraryEditor::GDNativeLibraryEditor() {
+GDNativeLibrarySingletonEditor::GDNativeLibrarySingletonEditor() {
libraries = memnew(Tree);
libraries->set_columns(2);
libraries->set_column_titles_visible(true);
diff --git a/modules/gdnative/gd_native_library_editor.h b/modules/gdnative/gdnative_library_singleton_editor.h
index a11c4620dd..ee1a32c5a5 100644
--- a/modules/gdnative/gd_native_library_editor.h
+++ b/modules/gdnative/gdnative_library_singleton_editor.h
@@ -1,5 +1,5 @@
/*************************************************************************/
-/* gd_native_library_editor.h */
+/* gdnative_library_singleton_editor.h */
/*************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
@@ -34,7 +34,7 @@
#include "editor/editor_file_system.h"
#include "editor/project_settings_editor.h"
-class GDNativeLibraryEditor : public VBoxContainer {
+class GDNativeLibrarySingletonEditor : public VBoxContainer {
Tree *libraries;
bool updating;
@@ -48,7 +48,7 @@ protected:
static void _bind_methods();
public:
- GDNativeLibraryEditor();
+ GDNativeLibrarySingletonEditor();
};
#endif
diff --git a/modules/gdnative/register_types.cpp b/modules/gdnative/register_types.cpp
index 1cb35ec006..bd9bae5294 100644
--- a/modules/gdnative/register_types.cpp
+++ b/modules/gdnative/register_types.cpp
@@ -45,7 +45,8 @@
#ifdef TOOLS_ENABLED
#include "editor/editor_node.h"
-#include "gd_native_library_editor.h"
+#include "gdnative_library_editor_plugin.h"
+#include "gdnative_library_singleton_editor.h"
// Class used to discover singleton gdnative files
static void actual_discoverer_handler();
@@ -267,7 +268,7 @@ void GDNativeExportPlugin::_export_file(const String &p_path, const String &p_ty
static void editor_init_callback() {
- GDNativeLibraryEditor *library_editor = memnew(GDNativeLibraryEditor);
+ GDNativeLibrarySingletonEditor *library_editor = memnew(GDNativeLibrarySingletonEditor);
library_editor->set_name(TTR("GDNative"));
ProjectSettingsEditor::get_singleton()->get_tabs()->add_child(library_editor);
@@ -278,6 +279,8 @@ static void editor_init_callback() {
export_plugin.instance();
EditorExport::get_singleton()->add_export_plugin(export_plugin);
+
+ EditorNode::get_singleton()->add_editor_plugin(memnew(GDNativeLibraryEditorPlugin(EditorNode::get_singleton())));
}
#endif
diff --git a/modules/gdscript/gdscript_function.cpp b/modules/gdscript/gdscript_function.cpp
index ee23f0ea0f..d6352f1e6e 100644
--- a/modules/gdscript/gdscript_function.cpp
+++ b/modules/gdscript/gdscript_function.cpp
@@ -1257,6 +1257,8 @@ Variant GDScriptFunction::call(GDScriptInstance *p_instance, const Variant **p_a
exit_ok = true;
OPCODE_BREAK;
}
+
+// Enable for debugging
#if 0
default: {
diff --git a/modules/gridmap/doc_classes/GridMap.xml b/modules/gridmap/doc_classes/GridMap.xml
index 8c862b52e8..e9bb90631d 100644
--- a/modules/gridmap/doc_classes/GridMap.xml
+++ b/modules/gridmap/doc_classes/GridMap.xml
@@ -21,6 +21,26 @@
Clear all cells.
</description>
</method>
+ <method name="clear_baked_meshes">
+ <return type="void">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="get_bake_mesh_instance">
+ <return type="RID">
+ </return>
+ <argument index="0" name="idx" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="get_bake_meshes">
+ <return type="Array">
+ </return>
+ <description>
+ </description>
+ </method>
<method name="get_cell_item" qualifiers="const">
<return type="int">
</return>
@@ -103,6 +123,16 @@
Array of [Vector3] with the non empty cell coordinates in the grid map.
</description>
</method>
+ <method name="make_baked_meshes">
+ <return type="void">
+ </return>
+ <argument index="0" name="gen_lightmap_uv" type="bool" default="false">
+ </argument>
+ <argument index="1" name="lightmap_uv_texel_size" type="float" default="0.1">
+ </argument>
+ <description>
+ </description>
+ </method>
<method name="map_to_world" qualifiers="const">
<return type="Vector3">
</return>
diff --git a/modules/gridmap/grid_map.cpp b/modules/gridmap/grid_map.cpp
index bebf8bcf8f..1860176f0c 100644
--- a/modules/gridmap/grid_map.cpp
+++ b/modules/gridmap/grid_map.cpp
@@ -101,6 +101,27 @@ bool GridMap::_set(const StringName &p_name, const Variant &p_value) {
}
}
_recreate_octant_data();
+ } else if (name == "baked_meshes") {
+
+ clear_baked_meshes();
+
+ Array meshes = p_value;
+
+ for (int i = 0; i < meshes.size(); i++) {
+ BakedMesh bm;
+ bm.mesh = meshes[i];
+ ERR_CONTINUE(!bm.mesh.is_valid());
+ bm.instance = VS::get_singleton()->instance_create();
+ VS::get_singleton()->get_singleton()->instance_set_base(bm.instance, bm.mesh->get_rid());
+ VS::get_singleton()->instance_attach_object_instance_id(bm.instance, get_instance_id());
+ if (is_inside_tree()) {
+ VS::get_singleton()->instance_set_scenario(bm.instance, get_world()->get_scenario());
+ VS::get_singleton()->instance_set_transform(bm.instance, get_global_transform());
+ }
+ baked_meshes.push_back(bm);
+ }
+
+ _recreate_octant_data();
} else
return false;
@@ -145,6 +166,15 @@ bool GridMap::_get(const StringName &p_name, Variant &r_ret) const {
d["cells"] = cells;
r_ret = d;
+ } else if (name == "baked_meshes") {
+
+ Array ret;
+ ret.resize(baked_meshes.size());
+ for (int i = 0; i < baked_meshes.size(); i++) {
+ ret.push_back(baked_meshes[i].mesh);
+ }
+ r_ret = ret;
+
} else
return false;
@@ -161,6 +191,9 @@ void GridMap::_get_property_list(List<PropertyInfo> *p_list) const {
p_list->push_back(PropertyInfo(Variant::BOOL, "cell_center_y"));
p_list->push_back(PropertyInfo(Variant::BOOL, "cell_center_z"));
p_list->push_back(PropertyInfo(Variant::REAL, "cell_scale"));
+ if (baked_meshes.size()) {
+ p_list->push_back(PropertyInfo(Variant::ARRAY, "baked_meshes", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_STORAGE));
+ }
p_list->push_back(PropertyInfo(Variant::DICTIONARY, "data", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_STORAGE));
}
@@ -235,6 +268,12 @@ bool GridMap::get_center_z() const {
void GridMap::set_cell_item(int p_x, int p_y, int p_z, int p_item, int p_rot) {
+ if (baked_meshes.size() && !recreating_octants) {
+ //if you set a cell item, baked meshes go good bye
+ clear_baked_meshes();
+ _recreate_octant_data();
+ }
+
ERR_FAIL_INDEX(ABS(p_x), 1 << 20);
ERR_FAIL_INDEX(ABS(p_y), 1 << 20);
ERR_FAIL_INDEX(ABS(p_z), 1 << 20);
@@ -477,41 +516,44 @@ bool GridMap::_octant_update(const OctantKey &p_key) {
}
}
- //update multimeshes
- for (Map<int, List<Pair<Transform, IndexKey> > >::Element *E = multimesh_items.front(); E; E = E->next()) {
- Octant::MultimeshInstance mmi;
+ //update multimeshes, only if not baked
+ if (baked_meshes.size() == 0) {
- RID mm = VS::get_singleton()->multimesh_create();
- VS::get_singleton()->multimesh_allocate(mm, E->get().size(), VS::MULTIMESH_TRANSFORM_3D, VS::MULTIMESH_COLOR_NONE);
- VS::get_singleton()->multimesh_set_mesh(mm, theme->get_item_mesh(E->key())->get_rid());
+ for (Map<int, List<Pair<Transform, IndexKey> > >::Element *E = multimesh_items.front(); E; E = E->next()) {
+ Octant::MultimeshInstance mmi;
- int idx = 0;
- for (List<Pair<Transform, IndexKey> >::Element *F = E->get().front(); F; F = F->next()) {
- VS::get_singleton()->multimesh_instance_set_transform(mm, idx, F->get().first);
+ RID mm = VS::get_singleton()->multimesh_create();
+ VS::get_singleton()->multimesh_allocate(mm, E->get().size(), VS::MULTIMESH_TRANSFORM_3D, VS::MULTIMESH_COLOR_NONE);
+ VS::get_singleton()->multimesh_set_mesh(mm, theme->get_item_mesh(E->key())->get_rid());
+
+ int idx = 0;
+ for (List<Pair<Transform, IndexKey> >::Element *F = E->get().front(); F; F = F->next()) {
+ VS::get_singleton()->multimesh_instance_set_transform(mm, idx, F->get().first);
#ifdef TOOLS_ENABLED
- Octant::MultimeshInstance::Item it;
- it.index = idx;
- it.transform = F->get().first;
- it.key = F->get().second;
- mmi.items.push_back(it);
+ Octant::MultimeshInstance::Item it;
+ it.index = idx;
+ it.transform = F->get().first;
+ it.key = F->get().second;
+ mmi.items.push_back(it);
#endif
- idx++;
- }
+ idx++;
+ }
- RID instance = VS::get_singleton()->instance_create();
- VS::get_singleton()->instance_set_base(instance, mm);
+ RID instance = VS::get_singleton()->instance_create();
+ VS::get_singleton()->instance_set_base(instance, mm);
- if (is_inside_tree()) {
- VS::get_singleton()->instance_set_scenario(instance, get_world()->get_scenario());
- VS::get_singleton()->instance_set_transform(instance, get_global_transform());
- }
+ if (is_inside_tree()) {
+ VS::get_singleton()->instance_set_scenario(instance, get_world()->get_scenario());
+ VS::get_singleton()->instance_set_transform(instance, get_global_transform());
+ }
- mmi.multimesh = mm;
- mmi.instance = instance;
+ mmi.multimesh = mm;
+ mmi.instance = instance;
- g.multimesh_instances.push_back(mmi);
+ g.multimesh_instances.push_back(mmi);
+ }
}
if (col_debug.size()) {
@@ -642,6 +684,11 @@ void GridMap::_notification(int p_what) {
_octant_enter_world(E->key());
}
+ for (int i = 0; i < baked_meshes.size(); i++) {
+ VS::get_singleton()->instance_set_scenario(baked_meshes[i].instance, get_world()->get_scenario());
+ VS::get_singleton()->instance_set_transform(baked_meshes[i].instance, get_global_transform());
+ }
+
} break;
case NOTIFICATION_TRANSFORM_CHANGED: {
@@ -655,6 +702,10 @@ void GridMap::_notification(int p_what) {
last_transform = new_xform;
+ for (int i = 0; i < baked_meshes.size(); i++) {
+ VS::get_singleton()->instance_set_transform(baked_meshes[i].instance, get_global_transform());
+ }
+
} break;
case NOTIFICATION_EXIT_WORLD: {
@@ -667,6 +718,9 @@ void GridMap::_notification(int p_what) {
//_queue_octants_dirty(MAP_DIRTY_INSTANCES|MAP_DIRTY_TRANSFORMS);
//_update_octants_callback();
//_update_area_instances();
+ for (int i = 0; i < baked_meshes.size(); i++) {
+ VS::get_singleton()->instance_set_scenario(baked_meshes[i].instance, RID());
+ }
} break;
case NOTIFICATION_VISIBILITY_CHANGED: {
@@ -701,12 +755,14 @@ void GridMap::_queue_octants_dirty() {
void GridMap::_recreate_octant_data() {
+ recreating_octants = true;
Map<IndexKey, Cell> cell_copy = cell_map;
_clear_internal();
for (Map<IndexKey, Cell>::Element *E = cell_copy.front(); E; E = E->next()) {
set_cell_item(E->key().x, E->key().y, E->key().z, E->get().item, E->get().rot);
}
+ recreating_octants = false;
}
void GridMap::_clear_internal() {
@@ -726,6 +782,7 @@ void GridMap::_clear_internal() {
void GridMap::clear() {
_clear_internal();
+ clear_baked_meshes();
}
void GridMap::resource_changed(const RES &p_res) {
@@ -791,6 +848,11 @@ void GridMap::_bind_methods() {
ClassDB::bind_method(D_METHOD("get_used_cells"), &GridMap::get_used_cells);
ClassDB::bind_method(D_METHOD("get_meshes"), &GridMap::get_meshes);
+ ClassDB::bind_method(D_METHOD("get_bake_meshes"), &GridMap::get_bake_meshes);
+ ClassDB::bind_method(D_METHOD("get_bake_mesh_instance", "idx"), &GridMap::get_bake_mesh_instance);
+
+ ClassDB::bind_method(D_METHOD("clear_baked_meshes"), &GridMap::clear_baked_meshes);
+ ClassDB::bind_method(D_METHOD("make_baked_meshes", "gen_lightmap_uv", "lightmap_uv_texel_size"), &GridMap::make_baked_meshes, DEFVAL(false), DEFVAL(0.1));
BIND_CONSTANT(INVALID_CELL_ITEM);
}
@@ -883,10 +945,129 @@ Vector3 GridMap::_get_offset() const {
cell_size.z * 0.5 * int(center_z));
}
+void GridMap::clear_baked_meshes() {
+
+ for (int i = 0; i < baked_meshes.size(); i++) {
+ VS::get_singleton()->free(baked_meshes[i].instance);
+ }
+ baked_meshes.clear();
+
+ _recreate_octant_data();
+}
+
+void GridMap::make_baked_meshes(bool p_gen_lightmap_uv, float p_lightmap_uv_texel_size) {
+
+ if (!theme.is_valid())
+ return;
+
+ //generate
+ Map<OctantKey, Map<Ref<Material>, Ref<SurfaceTool> > > surface_map;
+
+ for (Map<IndexKey, Cell>::Element *E = cell_map.front(); E; E = E->next()) {
+
+ IndexKey key = E->key();
+
+ int item = E->get().item;
+ if (!theme->has_item(item))
+ continue;
+
+ Ref<Mesh> mesh = theme->get_item_mesh(item);
+ if (!mesh.is_valid())
+ continue;
+
+ Vector3 cellpos = Vector3(key.x, key.y, key.z);
+ Vector3 ofs = _get_offset();
+
+ Transform xform;
+
+ xform.basis.set_orthogonal_index(E->get().rot);
+ xform.set_origin(cellpos * cell_size + ofs);
+ xform.basis.scale(Vector3(cell_scale, cell_scale, cell_scale));
+
+ OctantKey ok;
+ ok.x = key.x / octant_size;
+ ok.y = key.y / octant_size;
+ ok.z = key.z / octant_size;
+
+ if (!surface_map.has(ok)) {
+ surface_map[ok] = Map<Ref<Material>, Ref<SurfaceTool> >();
+ }
+
+ Map<Ref<Material>, Ref<SurfaceTool> > &mat_map = surface_map[ok];
+
+ for (int i = 0; i < mesh->get_surface_count(); i++) {
+
+ if (mesh->surface_get_primitive_type(i) != Mesh::PRIMITIVE_TRIANGLES)
+ continue;
+
+ Ref<Material> surf_mat = mesh->surface_get_material(i);
+ if (!mat_map.has(surf_mat)) {
+ Ref<SurfaceTool> st;
+ st.instance();
+ st->begin(Mesh::PRIMITIVE_TRIANGLES);
+ st->set_material(surf_mat);
+ mat_map[surf_mat] = st;
+ }
+
+ mat_map[surf_mat]->append_from(mesh, i, xform);
+ }
+ }
+
+ int ofs = 0;
+
+ for (Map<OctantKey, Map<Ref<Material>, Ref<SurfaceTool> > >::Element *E = surface_map.front(); E; E = E->next()) {
+
+ print_line("generating mesh " + itos(ofs++) + "/" + itos(surface_map.size()));
+ Ref<ArrayMesh> mesh;
+ mesh.instance();
+ for (Map<Ref<Material>, Ref<SurfaceTool> >::Element *F = E->get().front(); F; F = F->next()) {
+ F->get()->commit(mesh);
+ }
+
+ BakedMesh bm;
+ bm.mesh = mesh;
+ bm.instance = VS::get_singleton()->instance_create();
+ VS::get_singleton()->get_singleton()->instance_set_base(bm.instance, bm.mesh->get_rid());
+ VS::get_singleton()->instance_attach_object_instance_id(bm.instance, get_instance_id());
+ if (is_inside_tree()) {
+ VS::get_singleton()->instance_set_scenario(bm.instance, get_world()->get_scenario());
+ VS::get_singleton()->instance_set_transform(bm.instance, get_global_transform());
+ }
+
+ if (p_gen_lightmap_uv) {
+ mesh->lightmap_unwrap(get_global_transform(), p_lightmap_uv_texel_size);
+ }
+ baked_meshes.push_back(bm);
+ }
+
+ _recreate_octant_data();
+}
+
+Array GridMap::get_bake_meshes() {
+
+ if (!baked_meshes.size()) {
+ make_baked_meshes(true);
+ }
+
+ Array arr;
+ for (int i = 0; i < baked_meshes.size(); i++) {
+ arr.push_back(baked_meshes[i].mesh);
+ arr.push_back(Transform());
+ }
+
+ return arr;
+}
+
+RID GridMap::get_bake_mesh_instance(int p_idx) {
+
+ ERR_FAIL_INDEX_V(p_idx, baked_meshes.size(), RID());
+ return baked_meshes[p_idx].instance;
+}
+
GridMap::GridMap() {
cell_size = Vector3(2, 2, 2);
- octant_size = 4;
+ octant_size = 8;
awaiting_update = false;
_in_tree = false;
center_x = true;
@@ -901,6 +1082,7 @@ GridMap::GridMap() {
navigation = NULL;
set_notify_transform(true);
+ recreating_octants = false;
}
GridMap::~GridMap() {
diff --git a/modules/gridmap/grid_map.h b/modules/gridmap/grid_map.h
index ab66bf123e..241ac7a434 100644
--- a/modules/gridmap/grid_map.h
+++ b/modules/gridmap/grid_map.h
@@ -148,6 +148,9 @@ class GridMap : public Spatial {
bool clip;
bool clip_above;
int clip_floor;
+
+ bool recreating_octants;
+
Vector3::Axis clip_axis;
Ref<MeshLibrary> theme;
@@ -188,9 +191,11 @@ class GridMap : public Spatial {
struct BakedMesh {
Ref<Mesh> mesh;
- Transform transform;
+ RID instance;
};
+ Vector<BakedMesh> baked_meshes;
+
protected:
bool _set(const StringName &p_name, const Variant &p_value);
bool _get(const StringName &p_name, Variant &r_ret) const;
@@ -237,8 +242,14 @@ public:
Array get_meshes();
+ void clear_baked_meshes();
+ void make_baked_meshes(bool p_gen_lightmap_uv = false, float p_lightmap_uv_texel_size = 0.1);
+
void clear();
+ Array get_bake_meshes();
+ RID get_bake_mesh_instance(int p_idx);
+
GridMap();
~GridMap();
};
diff --git a/modules/stb_vorbis/audio_stream_ogg_vorbis.cpp b/modules/stb_vorbis/audio_stream_ogg_vorbis.cpp
index 5c252bda86..6f5bbba8d1 100644
--- a/modules/stb_vorbis/audio_stream_ogg_vorbis.cpp
+++ b/modules/stb_vorbis/audio_stream_ogg_vorbis.cpp
@@ -42,12 +42,17 @@ void AudioStreamPlaybackOGGVorbis::_mix_internal(AudioFrame *p_buffer, int p_fra
int todo = p_frames;
- while (todo && active) {
+ int start_buffer = 0;
- int mixed = stb_vorbis_get_samples_float_interleaved(ogg_stream, 2, (float *)p_buffer, todo * 2);
+ while (todo && active) {
+ float *buffer = (float *)p_buffer;
+ if (start_buffer > 0) {
+ buffer = (buffer + start_buffer * 2);
+ }
+ int mixed = stb_vorbis_get_samples_float_interleaved(ogg_stream, 2, buffer, todo * 2);
if (vorbis_stream->channels == 1 && mixed > 0) {
//mix mono to stereo
- for (int i = 0; i < mixed; i++) {
+ for (int i = start_buffer; i < mixed; i++) {
p_buffer[i].r = p_buffer[i].l;
}
}
@@ -60,11 +65,14 @@ void AudioStreamPlaybackOGGVorbis::_mix_internal(AudioFrame *p_buffer, int p_fra
//loop
seek(vorbis_stream->loop_offset);
loops++;
+ // we still have buffer to fill, start from this element in the next iteration.
+ start_buffer = p_frames - todo;
} else {
- for (int i = mixed; i < p_frames; i++) {
+ for (int i = p_frames - todo; i < p_frames; i++) {
p_buffer[i] = AudioFrame(0, 0);
}
active = false;
+ todo = 0;
}
}
}
diff --git a/modules/visual_script/visual_script_editor.cpp b/modules/visual_script/visual_script_editor.cpp
index 6c58de8a5a..faf3aecbd4 100644
--- a/modules/visual_script/visual_script_editor.cpp
+++ b/modules/visual_script/visual_script_editor.cpp
@@ -228,7 +228,7 @@ protected:
if (String(p_name) == "type") {
- Dictionary dc = d.copy();
+ Dictionary dc = d.duplicate();
dc["type"] = p_value;
undo_redo->create_action(TTR("Set Variable Type"));
undo_redo->add_do_method(script.ptr(), "set_variable_info", var, dc);
@@ -241,7 +241,7 @@ protected:
if (String(p_name) == "hint") {
- Dictionary dc = d.copy();
+ Dictionary dc = d.duplicate();
dc["hint"] = p_value;
undo_redo->create_action(TTR("Set Variable Type"));
undo_redo->add_do_method(script.ptr(), "set_variable_info", var, dc);
@@ -254,7 +254,7 @@ protected:
if (String(p_name) == "hint_string") {
- Dictionary dc = d.copy();
+ Dictionary dc = d.duplicate();
dc["hint_string"] = p_value;
undo_redo->create_action(TTR("Set Variable Type"));
undo_redo->add_do_method(script.ptr(), "set_variable_info", var, dc);
@@ -480,33 +480,33 @@ void VisualScriptEditor::_update_graph(int p_only_id) {
select_func_text->hide();
Ref<Texture> type_icons[Variant::VARIANT_MAX] = {
- Control::get_icon("MiniVariant", "EditorIcons"),
- Control::get_icon("MiniBoolean", "EditorIcons"),
- Control::get_icon("MiniInteger", "EditorIcons"),
- Control::get_icon("MiniFloat", "EditorIcons"),
- Control::get_icon("MiniString", "EditorIcons"),
- Control::get_icon("MiniVector2", "EditorIcons"),
- Control::get_icon("MiniRect2", "EditorIcons"),
- Control::get_icon("MiniVector3", "EditorIcons"),
- Control::get_icon("MiniTransform2D", "EditorIcons"),
- Control::get_icon("MiniPlane", "EditorIcons"),
- Control::get_icon("MiniQuat", "EditorIcons"),
- Control::get_icon("MiniAabb", "EditorIcons"),
- Control::get_icon("MiniBasis", "EditorIcons"),
- Control::get_icon("MiniTransform", "EditorIcons"),
- Control::get_icon("MiniColor", "EditorIcons"),
- Control::get_icon("MiniPath", "EditorIcons"),
- Control::get_icon("MiniRid", "EditorIcons"),
+ Control::get_icon("Variant", "EditorIcons"),
+ Control::get_icon("bool", "EditorIcons"),
+ Control::get_icon("int", "EditorIcons"),
+ Control::get_icon("float", "EditorIcons"),
+ Control::get_icon("String", "EditorIcons"),
+ Control::get_icon("Vector2", "EditorIcons"),
+ Control::get_icon("Rect2", "EditorIcons"),
+ Control::get_icon("Vector3", "EditorIcons"),
+ Control::get_icon("Transform2D", "EditorIcons"),
+ Control::get_icon("Plane", "EditorIcons"),
+ Control::get_icon("Quat", "EditorIcons"),
+ Control::get_icon("AABB", "EditorIcons"),
+ Control::get_icon("Basis", "EditorIcons"),
+ Control::get_icon("Transform", "EditorIcons"),
+ Control::get_icon("Color", "EditorIcons"),
+ Control::get_icon("NodePath", "EditorIcons"),
+ Control::get_icon("RID", "EditorIcons"),
Control::get_icon("MiniObject", "EditorIcons"),
- Control::get_icon("MiniDictionary", "EditorIcons"),
- Control::get_icon("MiniArray", "EditorIcons"),
- Control::get_icon("MiniRawArray", "EditorIcons"),
- Control::get_icon("MiniIntArray", "EditorIcons"),
- Control::get_icon("MiniFloatArray", "EditorIcons"),
- Control::get_icon("MiniStringArray", "EditorIcons"),
- Control::get_icon("MiniVector2Array", "EditorIcons"),
- Control::get_icon("MiniVector3Array", "EditorIcons"),
- Control::get_icon("MiniColorArray", "EditorIcons")
+ Control::get_icon("Dictionary", "EditorIcons"),
+ Control::get_icon("Array", "EditorIcons"),
+ Control::get_icon("PoolByteArray", "EditorIcons"),
+ Control::get_icon("PoolIntArray", "EditorIcons"),
+ Control::get_icon("PoolRealArray", "EditorIcons"),
+ Control::get_icon("PoolStringArray", "EditorIcons"),
+ Control::get_icon("PoolVector2Array", "EditorIcons"),
+ Control::get_icon("PoolVector3Array", "EditorIcons"),
+ Control::get_icon("PoolColorArray", "EditorIcons")
};
Ref<Texture> seq_port = Control::get_icon("VisualShaderPort", "EditorIcons");
@@ -774,33 +774,33 @@ void VisualScriptEditor::_update_members() {
variables->set_custom_color(0, Control::get_color("mono_color", "Editor"));
Ref<Texture> type_icons[Variant::VARIANT_MAX] = {
- Control::get_icon("MiniVariant", "EditorIcons"),
- Control::get_icon("MiniBoolean", "EditorIcons"),
- Control::get_icon("MiniInteger", "EditorIcons"),
- Control::get_icon("MiniFloat", "EditorIcons"),
- Control::get_icon("MiniString", "EditorIcons"),
- Control::get_icon("MiniVector2", "EditorIcons"),
- Control::get_icon("MiniRect2", "EditorIcons"),
- Control::get_icon("MiniVector3", "EditorIcons"),
- Control::get_icon("MiniMatrix32", "EditorIcons"),
- Control::get_icon("MiniPlane", "EditorIcons"),
- Control::get_icon("MiniQuat", "EditorIcons"),
- Control::get_icon("MiniAabb", "EditorIcons"),
- Control::get_icon("MiniMatrix3", "EditorIcons"),
- Control::get_icon("MiniTransform", "EditorIcons"),
- Control::get_icon("MiniColor", "EditorIcons"),
- Control::get_icon("MiniPath", "EditorIcons"),
- Control::get_icon("MiniRid", "EditorIcons"),
+ Control::get_icon("Variant", "EditorIcons"),
+ Control::get_icon("bool", "EditorIcons"),
+ Control::get_icon("int", "EditorIcons"),
+ Control::get_icon("float", "EditorIcons"),
+ Control::get_icon("String", "EditorIcons"),
+ Control::get_icon("Vector2", "EditorIcons"),
+ Control::get_icon("Rect2", "EditorIcons"),
+ Control::get_icon("Vector3", "EditorIcons"),
+ Control::get_icon("Transform2D", "EditorIcons"),
+ Control::get_icon("Plane", "EditorIcons"),
+ Control::get_icon("Quat", "EditorIcons"),
+ Control::get_icon("AABB", "EditorIcons"),
+ Control::get_icon("Basis", "EditorIcons"),
+ Control::get_icon("Transform", "EditorIcons"),
+ Control::get_icon("Color", "EditorIcons"),
+ Control::get_icon("NodePath", "EditorIcons"),
+ Control::get_icon("RID", "EditorIcons"),
Control::get_icon("MiniObject", "EditorIcons"),
- Control::get_icon("MiniDictionary", "EditorIcons"),
- Control::get_icon("MiniArray", "EditorIcons"),
- Control::get_icon("MiniRawArray", "EditorIcons"),
- Control::get_icon("MiniIntArray", "EditorIcons"),
- Control::get_icon("MiniFloatArray", "EditorIcons"),
- Control::get_icon("MiniStringArray", "EditorIcons"),
- Control::get_icon("MiniVector2Array", "EditorIcons"),
- Control::get_icon("MiniVector3Array", "EditorIcons"),
- Control::get_icon("MiniColorArray", "EditorIcons")
+ Control::get_icon("Dictionary", "EditorIcons"),
+ Control::get_icon("Array", "EditorIcons"),
+ Control::get_icon("PoolByteArray", "EditorIcons"),
+ Control::get_icon("PoolIntArray", "EditorIcons"),
+ Control::get_icon("PoolRealArray", "EditorIcons"),
+ Control::get_icon("PoolStringArray", "EditorIcons"),
+ Control::get_icon("PoolVector2Array", "EditorIcons"),
+ Control::get_icon("PoolVector3Array", "EditorIcons"),
+ Control::get_icon("PoolColorArray", "EditorIcons")
};
List<StringName> var_names;
diff --git a/modules/visual_script/visual_script_flow_control.cpp b/modules/visual_script/visual_script_flow_control.cpp
index a38266acc0..147761783a 100644
--- a/modules/visual_script/visual_script_flow_control.cpp
+++ b/modules/visual_script/visual_script_flow_control.cpp
@@ -731,921 +731,6 @@ void VisualScriptSwitch::_bind_methods() {
VisualScriptSwitch::VisualScriptSwitch() {
}
- //////////////////////////////////////////
- ////////////////EVENT ACTION FILTER///////////
- //////////////////////////////////////////
-
-#if 0
-int VisualScriptInputFilter::get_output_sequence_port_count() const {
-
- return filters.size();
-}
-
-bool VisualScriptInputFilter::has_input_sequence_port() const {
-
- return true;
-}
-
-int VisualScriptInputFilter::get_input_value_port_count() const {
-
- return 1;
-}
-int VisualScriptInputFilter::get_output_value_port_count() const {
-
- return 1;
-}
-
-String VisualScriptInputFilter::get_output_sequence_port_text(int p_port) const {
-
- String text;
-
- switch (filters[p_port].type) {
- case Ref<InputEvent>::NONE: {
- text = "None";
- } break;
- case Ref<InputEvent>::KEY: {
-
- InputEventKey k = filters[p_port].key;
-
- if (k->get_scancode() == 0 && k.unicode == 0) {
- text = "No Key";
- } else {
- if (k->get_scancode() != 0) {
- text = "KeyCode: " + keycode_get_string(k->get_scancode());
- } else if (k.unicode != 0) {
- text = "Uniode: " + String::chr(k.unicode);
- }
-
- if (k->is_pressed())
- text += ", Pressed";
- else
- text += ", Released";
-
- if (k.echo)
- text += ", Echo";
- if (k->get_alt())
- text = "Alt+" + text;
- if (k->get_shift())
- text = "Shift+" + text;
- if (k->get_control())
- text = "Ctrl+" + text;
- if (k->get_metakey())
- text = "Meta+" + text;
- }
-
- } break;
- case Ref<InputEvent>::MOUSE_MOTION: {
- InputEventMouseMotion mm = filters[p_port].mouse_motion;
- text = "Mouse Motion";
-
- String b = "Left,Right,Middle,WheelUp,WheelDown,WheelLeft,WheelRight";
-
- for (int i = 0; i < 7; i++) {
- if (mm->get_button_mask() & (1 << i)) {
- text = b.get_slice(",", i) + "+" + text;
- }
- }
- if (mm->get_alt())
- text = "Alt+" + text;
- if (mm->get_shift())
- text = "Shift+" + text;
- if (mm->get_control())
- text = "Ctrl+" + text;
- if (mm->get_metakey())
- text = "Meta+" + text;
- } break;
- case Ref<InputEvent>::MOUSE_BUTTON: {
-
- InputEventMouseButton mb = filters[p_port].mouse_button;
-
- String b = "Any,Left,Right,Middle,WheelUp,WheelDown,WheelLeft,WheelRight";
-
- text = b.get_slice(",", mb->get_button_index()) + " Mouse Button";
-
- if (mb->is_pressed())
- text += ", Pressed";
- else
- text += ", Released";
-
- if (mb.doubleclick)
- text += ", DblClick";
- if (mb->get_alt())
- text = "Alt+" + text;
- if (mb->get_shift())
- text = "Shift+" + text;
- if (mb->get_control())
- text = "Ctrl+" + text;
- if (mb->get_metakey())
- text = "Meta+" + text;
-
- } break;
- case Ref<InputEvent>::JOYPAD_MOTION: {
-
- InputEventJoypadMotion jm = filters[p_port].joy_motion;
-
- text = "JoyMotion Axis " + itos(jm.axis >> 1);
- if (jm.axis & 1)
- text += " > " + rtos(jm.axis_value);
- else
- text += " < " + rtos(-jm.axis_value);
-
- } break;
- case Ref<InputEvent>::JOYPAD_BUTTON: {
- InputEventJoypadButton jb = filters[p_port].joy_button;
-
- text = "JoyButton " + itos(jb->get_button_index());
- if (jb->is_pressed())
- text += ", Pressed";
- else
- text += ", Released";
- } break;
- case Ref<InputEvent>::SCREEN_TOUCH: {
- InputEventScreenTouch sd = filters[p_port].screen_touch;
-
- text = "Touch Finger " + itos(sd.index);
- if (sd->is_pressed())
- text += ", Pressed";
- else
- text += ", Released";
- } break;
- case Ref<InputEvent>::SCREEN_DRAG: {
- InputEventScreenDrag sd = filters[p_port].screen_drag;
- text = "Drag Finger " + itos(sd.index);
- } break;
- case Ref<InputEvent>::ACTION: {
-
- List<PropertyInfo> pinfo;
- ProjectSettings::get_singleton()->get_property_list(&pinfo);
- int index = 1;
-
- text = "No Action";
- for (List<PropertyInfo>::Element *E = pinfo.front(); E; E = E->next()) {
- const PropertyInfo &pi = E->get();
-
- if (!pi.name.begins_with("input/"))
- continue;
-
- if (filters[p_port].action.action == index) {
- text = "Action " + pi.name.substr(pi.name.find("/") + 1, pi.name.length());
- break;
- }
- index++;
- }
-
- if (filters[p_port].action->is_pressed())
- text += ", Pressed";
- else
- text += ", Released";
-
- } break;
- }
-
- return text + " - " + itos(p_port);
-}
-
-PropertyInfo VisualScriptInputFilter::get_input_value_port_info(int p_idx) const {
-
- return PropertyInfo(Variant::INPUT_EVENT, "event");
-}
-
-PropertyInfo VisualScriptInputFilter::get_output_value_port_info(int p_idx) const {
-
- return PropertyInfo(Variant::INPUT_EVENT, "");
-}
-
-String VisualScriptInputFilter::get_caption() const {
-
- return "InputFilter";
-}
-
-String VisualScriptInputFilter::get_text() const {
-
- return "";
-}
-
-bool VisualScriptInputFilter::_set(const StringName &p_name, const Variant &p_value) {
-
- if (p_name == "filter_count") {
- filters.resize(p_value);
- _change_notify();
- ports_changed_notify();
- return true;
- }
-
- if (String(p_name).begins_with("filter_")) {
-
- int idx = String(p_name).replace_first("filters_", "").get_slice("/", 0).to_int();
-
- ERR_FAIL_INDEX_V(idx, filters.size(), false);
-
- String what = String(p_name).get_slice("/", 1);
-
- if (what == "type") {
- filters[idx] = Ref<InputEvent>();
- filters[idx].type = Ref<InputEvent>::Type(int(p_value));
- if (filters[idx].type == Ref<InputEvent>::JOYPAD_MOTION) {
- filters[idx].joy_motion.axis_value = 0.5; //for threshold
- } else if (filters[idx].type == Ref<InputEvent>::KEY) {
- filters[idx]->is_pressed() = true; //put these as true to make it more user friendly
- } else if (filters[idx].type == Ref<InputEvent>::MOUSE_BUTTON) {
- filters[idx]->is_pressed() = true;
- } else if (filters[idx].type == Ref<InputEvent>::JOYPAD_BUTTON) {
- filters[idx].joy_button->is_pressed() = true;
- } else if (filters[idx].type == Ref<InputEvent>::SCREEN_TOUCH) {
- filters[idx].screen_touch->is_pressed() = true;
- } else if (filters[idx].type == Ref<InputEvent>::ACTION) {
- filters[idx].action->is_pressed() = true;
- }
- _change_notify();
- ports_changed_notify();
-
- return true;
- }
- if (what == "device") {
- filters[idx].device = p_value;
- ports_changed_notify();
- return true;
- }
-
- switch (filters[idx].type) {
-
- case Ref<InputEvent>::KEY: {
-
- if (what == "scancode") {
- String sc = p_value;
- if (sc == String()) {
- filters[idx]->get_scancode() = 0;
- } else {
- filters[idx]->get_scancode() = find_keycode(p_value);
- }
-
- } else if (what == "unicode") {
-
- String uc = p_value;
-
- if (uc == String()) {
- filters[idx].key.unicode = 0;
- } else {
- filters[idx].key.unicode = uc[0];
- }
-
- } else if (what == "pressed") {
-
- filters[idx]->is_pressed() = p_value;
- } else if (what == "echo") {
-
- filters[idx]->is_echo() = p_value;
-
- } else if (what == "mod_alt") {
- filters[idx]->get_alt() = p_value;
-
- } else if (what == "mod_shift") {
- filters[idx]->get_shift() = p_value;
-
- } else if (what == "mod_ctrl") {
- filters[idx]->get_control() = p_value;
-
- } else if (what == "mod_meta") {
- filters[idx]->get_metakey() = p_value;
- } else {
- return false;
- }
- ports_changed_notify();
-
- return true;
- } break;
- case Ref<InputEvent>::MOUSE_MOTION: {
-
- if (what == "button_mask") {
- filters[idx]->get_button_mask() = p_value;
-
- } else if (what == "mod_alt") {
- filters[idx].mouse_motion->get_alt() = p_value;
-
- } else if (what == "mod_shift") {
- filters[idx].mouse_motion->get_shift() = p_value;
-
- } else if (what == "mod_ctrl") {
- filters[idx].mouse_motion->get_control() = p_value;
-
- } else if (what == "mod_meta") {
- filters[idx].mouse_motion->get_metakey() = p_value;
- } else {
- return false;
- }
-
- ports_changed_notify();
- return true;
-
- } break;
- case Ref<InputEvent>::MOUSE_BUTTON: {
-
- if (what == "button_index") {
- filters[idx]->get_button_index() = p_value;
- } else if (what == "pressed") {
- filters[idx]->is_pressed() = p_value;
- } else if (what == "doubleclicked") {
- filters[idx].mouse_button.doubleclick = p_value;
-
- } else if (what == "mod_alt") {
- filters[idx].mouse_button->get_alt() = p_value;
-
- } else if (what == "mod_shift") {
- filters[idx].mouse_button->get_shift() = p_value;
-
- } else if (what == "mod_ctrl") {
- filters[idx].mouse_button->get_control() = p_value;
-
- } else if (what == "mod_meta") {
- filters[idx].mouse_button->get_metakey() = p_value;
- } else {
- return false;
- }
- ports_changed_notify();
- return true;
-
- } break;
- case Ref<InputEvent>::JOYPAD_MOTION: {
-
- if (what == "axis") {
- filters[idx].joy_motion.axis = int(p_value) << 1 | filters[idx].joy_motion.axis;
- } else if (what == "mode") {
- filters[idx].joy_motion.axis |= int(p_value);
- } else if (what == "threshold") {
- filters[idx].joy_motion.axis_value = p_value;
- } else {
- return false;
- }
- ports_changed_notify();
- return true;
-
- } break;
- case Ref<InputEvent>::JOYPAD_BUTTON: {
-
- if (what == "button_index") {
- filters[idx].joy_button->get_button_index() = p_value;
- } else if (what == "pressed") {
- filters[idx].joy_button->is_pressed() = p_value;
- } else {
- return false;
- }
- ports_changed_notify();
- return true;
-
- } break;
- case Ref<InputEvent>::SCREEN_TOUCH: {
-
- if (what == "finger_index") {
- filters[idx].screen_touch.index = p_value;
- } else if (what == "pressed") {
- filters[idx].screen_touch->is_pressed() = p_value;
- } else {
- return false;
- }
- ports_changed_notify();
- return true;
- } break;
- case Ref<InputEvent>::SCREEN_DRAG: {
- if (what == "finger_index") {
- filters[idx].screen_drag.index = p_value;
- } else {
- return false;
- }
- ports_changed_notify();
- return true;
- } break;
- case Ref<InputEvent>::ACTION: {
-
- if (what == "action_name") {
-
- List<PropertyInfo> pinfo;
- ProjectSettings::get_singleton()->get_property_list(&pinfo);
- int index = 1;
-
- for (List<PropertyInfo>::Element *E = pinfo.front(); E; E = E->next()) {
- const PropertyInfo &pi = E->get();
-
- if (!pi.name.begins_with("input/"))
- continue;
-
- String name = pi.name.substr(pi.name.find("/") + 1, pi.name.length());
- if (name == String(p_value)) {
-
- filters[idx].action.action = index;
- ports_changed_notify();
- return true;
- }
-
- index++;
- }
-
- filters[idx].action.action = 0;
- ports_changed_notify();
-
- return false;
-
- } else if (what == "pressed") {
-
- filters[idx].action->is_pressed() = p_value;
- ports_changed_notify();
- return true;
- }
-
- } break;
- }
- }
- return false;
-}
-
-bool VisualScriptInputFilter::_get(const StringName &p_name, Variant &r_ret) const {
-
- if (p_name == "filter_count") {
- r_ret = filters.size();
- return true;
- }
-
- if (String(p_name).begins_with("filter_")) {
-
- int idx = String(p_name).replace_first("filters_", "").get_slice("/", 0).to_int();
-
- ERR_FAIL_INDEX_V(idx, filters.size(), false);
-
- String what = String(p_name).get_slice("/", 1);
-
- if (what == "type") {
- r_ret = filters[idx].type;
- return true;
- }
- if (what == "device") {
- r_ret = filters[idx].device;
- return true;
- }
-
- switch (filters[idx].type) {
-
- case Ref<InputEvent>::KEY: {
-
- if (what == "scancode") {
- if (filters[idx]->get_scancode() == 0)
- r_ret = String();
- else {
-
- r_ret = keycode_get_string(filters[idx]->get_scancode());
- }
-
- } else if (what == "unicode") {
-
- if (filters[idx].key.unicode == 0) {
- r_ret = String();
- } else {
- CharType str[2] = { (CharType)filters[idx].key.unicode, 0 };
- r_ret = String(str);
- }
-
- } else if (what == "pressed") {
-
- r_ret = filters[idx]->is_pressed();
- } else if (what == "echo") {
-
- r_ret = filters[idx]->is_echo();
-
- } else if (what == "mod_alt") {
- r_ret = filters[idx]->get_alt();
-
- } else if (what == "mod_shift") {
- r_ret = filters[idx]->get_shift();
-
- } else if (what == "mod_ctrl") {
- r_ret = filters[idx]->get_control();
-
- } else if (what == "mod_meta") {
- r_ret = filters[idx]->get_metakey();
- } else {
- return false;
- }
-
- return true;
- } break;
- case Ref<InputEvent>::MOUSE_MOTION: {
-
- if (what == "button_mask") {
- r_ret = filters[idx]->get_button_mask();
-
- } else if (what == "mod_alt") {
- r_ret = filters[idx].mouse_motion->get_alt();
-
- } else if (what == "mod_shift") {
- r_ret = filters[idx].mouse_motion->get_shift();
-
- } else if (what == "mod_ctrl") {
- r_ret = filters[idx].mouse_motion->get_control();
-
- } else if (what == "mod_meta") {
- r_ret = filters[idx].mouse_motion->get_metakey();
- } else {
- return false;
- }
-
- return true;
-
- } break;
- case Ref<InputEvent>::MOUSE_BUTTON: {
-
- if (what == "button_index") {
- r_ret = filters[idx]->get_button_index();
- } else if (what == "pressed") {
- r_ret = filters[idx]->is_pressed();
- } else if (what == "doubleclicked") {
- r_ret = filters[idx].mouse_button.doubleclick;
-
- } else if (what == "mod_alt") {
- r_ret = filters[idx].mouse_button->get_alt();
-
- } else if (what == "mod_shift") {
- r_ret = filters[idx].mouse_button->get_shift();
-
- } else if (what == "mod_ctrl") {
- r_ret = filters[idx].mouse_button->get_control();
-
- } else if (what == "mod_meta") {
- r_ret = filters[idx].mouse_button->get_metakey();
- } else {
- return false;
- }
- return true;
-
- } break;
- case Ref<InputEvent>::JOYPAD_MOTION: {
-
- if (what == "axis_index") {
- r_ret = filters[idx].joy_motion.axis >> 1;
- } else if (what == "mode") {
- r_ret = filters[idx].joy_motion.axis & 1;
- } else if (what == "threshold") {
- r_ret = filters[idx].joy_motion.axis_value;
- } else {
- return false;
- }
- return true;
-
- } break;
- case Ref<InputEvent>::JOYPAD_BUTTON: {
-
- if (what == "button_index") {
- r_ret = filters[idx].joy_button->get_button_index();
- } else if (what == "pressed") {
- r_ret = filters[idx].joy_button->is_pressed();
- } else {
- return false;
- }
- return true;
-
- } break;
- case Ref<InputEvent>::SCREEN_TOUCH: {
-
- if (what == "finger_index") {
- r_ret = filters[idx].screen_touch.index;
- } else if (what == "pressed") {
- r_ret = filters[idx].screen_touch->is_pressed();
- } else {
- return false;
- }
- return true;
- } break;
- case Ref<InputEvent>::SCREEN_DRAG: {
- if (what == "finger_index") {
- r_ret = filters[idx].screen_drag.index;
- } else {
- return false;
- }
- return true;
- } break;
- case Ref<InputEvent>::ACTION: {
-
- if (what == "action_name") {
-
- List<PropertyInfo> pinfo;
- ProjectSettings::get_singleton()->get_property_list(&pinfo);
- int index = 1;
-
- for (List<PropertyInfo>::Element *E = pinfo.front(); E; E = E->next()) {
- const PropertyInfo &pi = E->get();
-
- if (!pi.name.begins_with("input/"))
- continue;
-
- if (filters[idx].action.action == index) {
- r_ret = pi.name.substr(pi.name.find("/") + 1, pi.name.length());
- return true;
- }
- index++;
- }
-
- r_ret = "None"; //no index
- return false;
-
- } else if (what == "pressed") {
-
- r_ret = filters[idx].action->is_pressed();
- return true;
- }
-
- } break;
- }
- }
- return false;
-}
-
-static const char *event_type_names[Ref<InputEvent>::TYPE_MAX] = {
- "None",
- "Key",
- "MouseMotion",
- "MouseButton",
- "JoypadMotion",
- "JoypadButton",
- "ScreenTouch",
- "ScreenDrag",
- "Action"
-};
-
-void VisualScriptInputFilter::_get_property_list(List<PropertyInfo> *p_list) const {
-
- p_list->push_back(PropertyInfo(Variant::INT, "filter_count", PROPERTY_HINT_RANGE, "0,64"));
-
- String et;
- for (int i = 0; i < Ref<InputEvent>::TYPE_MAX; i++) {
- if (i > 0)
- et += ",";
-
- et += event_type_names[i];
- }
-
- String kc;
- String actions;
-
- for (int i = 0; i < filters.size(); i++) {
-
- String base = "filter_" + itos(i) + "/";
- p_list->push_back(PropertyInfo(Variant::INT, base + "type", PROPERTY_HINT_ENUM, et));
- p_list->push_back(PropertyInfo(Variant::INT, base + "device"));
- switch (filters[i].type) {
-
- case Ref<InputEvent>::NONE: {
-
- } break;
- case Ref<InputEvent>::KEY: {
- if (kc == String()) {
- int kcc = keycode_get_count();
- kc = "None";
- for (int i = 0; i < kcc; i++) {
- kc += ",";
- kc += String(keycode_get_name_by_index(i));
- }
- }
- p_list->push_back(PropertyInfo(Variant::STRING, base + "scancode", PROPERTY_HINT_ENUM, kc));
- p_list->push_back(PropertyInfo(Variant::STRING, base + "unicode"));
- p_list->push_back(PropertyInfo(Variant::BOOL, base + "pressed"));
- p_list->push_back(PropertyInfo(Variant::BOOL, base + "echo"));
- p_list->push_back(PropertyInfo(Variant::BOOL, base + "mod_alt"));
- p_list->push_back(PropertyInfo(Variant::BOOL, base + "mod_shift"));
- p_list->push_back(PropertyInfo(Variant::BOOL, base + "mod_ctrl"));
- p_list->push_back(PropertyInfo(Variant::BOOL, base + "mod_meta"));
-
- } break;
- case Ref<InputEvent>::MOUSE_MOTION: {
- p_list->push_back(PropertyInfo(Variant::INT, base + "button_mask", PROPERTY_HINT_FLAGS, "Left,Right,Middle,WheelUp,WheelDown,WheelLeft,WheelRight"));
- p_list->push_back(PropertyInfo(Variant::BOOL, base + "mod_alt"));
- p_list->push_back(PropertyInfo(Variant::BOOL, base + "mod_shift"));
- p_list->push_back(PropertyInfo(Variant::BOOL, base + "mod_ctrl"));
- p_list->push_back(PropertyInfo(Variant::BOOL, base + "mod_meta"));
-
- } break;
- case Ref<InputEvent>::MOUSE_BUTTON: {
- p_list->push_back(PropertyInfo(Variant::INT, base + "button_index", PROPERTY_HINT_ENUM, "Any,Left,Right,Middle,WheelUp,WheelDown,WheelLeft,WheelRight"));
- p_list->push_back(PropertyInfo(Variant::BOOL, base + "pressed"));
- p_list->push_back(PropertyInfo(Variant::BOOL, base + "doubleclicked"));
- p_list->push_back(PropertyInfo(Variant::BOOL, base + "mod_alt"));
- p_list->push_back(PropertyInfo(Variant::BOOL, base + "mod_shift"));
- p_list->push_back(PropertyInfo(Variant::BOOL, base + "mod_ctrl"));
- p_list->push_back(PropertyInfo(Variant::BOOL, base + "mod_meta"));
-
- } break;
- case Ref<InputEvent>::JOYPAD_MOTION: {
-
- p_list->push_back(PropertyInfo(Variant::INT, base + "axis_index"));
- p_list->push_back(PropertyInfo(Variant::INT, base + "mode", PROPERTY_HINT_ENUM, "Min,Max"));
- p_list->push_back(PropertyInfo(Variant::REAL, base + "threshold", PROPERTY_HINT_RANGE, "0,1,0.01"));
- } break;
- case Ref<InputEvent>::JOYPAD_BUTTON: {
- p_list->push_back(PropertyInfo(Variant::INT, base + "button_index"));
- p_list->push_back(PropertyInfo(Variant::BOOL, base + "pressed"));
-
- } break;
- case Ref<InputEvent>::SCREEN_TOUCH: {
- p_list->push_back(PropertyInfo(Variant::INT, base + "finger_index"));
- p_list->push_back(PropertyInfo(Variant::BOOL, base + "pressed"));
-
- } break;
- case Ref<InputEvent>::SCREEN_DRAG: {
- p_list->push_back(PropertyInfo(Variant::INT, base + "finger_index"));
- } break;
- case Ref<InputEvent>::ACTION: {
-
- if (actions == String()) {
-
- actions = "None";
-
- List<PropertyInfo> pinfo;
- ProjectSettings::get_singleton()->get_property_list(&pinfo);
- Vector<String> al;
-
- for (List<PropertyInfo>::Element *E = pinfo.front(); E; E = E->next()) {
- const PropertyInfo &pi = E->get();
-
- if (!pi.name.begins_with("input/"))
- continue;
-
- String name = pi.name.substr(pi.name.find("/") + 1, pi.name.length());
-
- al.push_back(name);
- }
-
- for (int i = 0; i < al.size(); i++) {
- actions += ",";
- actions += al[i];
- }
- }
-
- p_list->push_back(PropertyInfo(Variant::STRING, base + "action_name", PROPERTY_HINT_ENUM, actions));
- p_list->push_back(PropertyInfo(Variant::BOOL, base + "pressed"));
-
- } break;
- }
- }
-}
-
-class VisualScriptNodeInstanceInputFilter : public VisualScriptNodeInstance {
-public:
- VisualScriptInstance *instance;
- Vector<Ref<InputEvent>> filters;
-
- //virtual int get_working_memory_size() const { return 0; }
- //virtual bool is_output_port_unsequenced(int p_idx) const { return false; }
- //virtual bool get_output_port_unsequenced(int p_idx,Variant* r_value,Variant* p_working_mem,String &r_error) const { return false; }
-
- virtual int step(const Variant **p_inputs, Variant **p_outputs, StartMode p_start_mode, Variant *p_working_mem, Variant::CallError &r_error, String &r_error_str) {
-
- if (p_inputs[0]->get_type() != Variant::INPUT_EVENT) {
- r_error_str = "Input value not of type event";
- r_error.error = Variant::CallError::CALL_ERROR_INVALID_METHOD;
- return 0;
- }
-
- Ref<InputEvent> event = *p_inputs[0];
-
- for (int i = 0; i < filters.size(); i++) {
-
- const Ref<InputEvent> &ie = filters[i];
- if (ie.type != event.type)
- continue;
-
- bool match = false;
-
- switch (ie.type) {
-
- case Ref<InputEvent>::NONE: {
-
- match = true;
- } break;
- case Ref<InputEvent>::KEY: {
-
- InputEventKey k = ie.key;
- InputEventKey k2 = event.key;
-
- if (k->get_scancode() == 0 && k.unicode == 0 && k2->get_scancode() == 0 && k2.unicode == 0) {
- match = true;
-
- } else {
-
- if ((k->get_scancode() != 0 && k->get_scancode() == k2->get_scancode()) || (k.unicode != 0 && k.unicode == k2.unicode)) {
- //key valid
-
- if (
- k->is_pressed() == k2->is_pressed() &&
- k.echo == k2.echo &&
- k.mod == k2.mod) {
- match = true;
- }
- }
- }
-
- } break;
- case Ref<InputEvent>::MOUSE_MOTION: {
- InputEventMouseMotion mm = ie.mouse_motion;
- InputEventMouseMotion mm2 = event.mouse_motion;
-
- if (mm->get_button_mask() == mm2->get_button_mask() &&
- mm.mod == mm2.mod) {
- match = true;
- }
-
- } break;
- case Ref<InputEvent>::MOUSE_BUTTON: {
-
- InputEventMouseButton mb = ie.mouse_button;
- InputEventMouseButton mb2 = event.mouse_button;
-
- if (mb->get_button_index() == mb2->get_button_index() &&
- mb->is_pressed() == mb2->is_pressed() &&
- mb.doubleclick == mb2.doubleclick &&
- mb.mod == mb2.mod) {
- match = true;
- }
-
- } break;
- case Ref<InputEvent>::JOYPAD_MOTION: {
-
- InputEventJoypadMotion jm = ie.joy_motion;
- InputEventJoypadMotion jm2 = event.joy_motion;
-
- int axis = jm.axis >> 1;
-
- if (axis == jm2.axis) {
-
- if (jm.axis & 1) {
- //greater
- if (jm2.axis_value > jm.axis_value) {
- match = true;
- }
- } else {
- //less
- if (jm2.axis_value < -jm.axis_value) {
- match = true;
- }
- }
- }
-
- } break;
- case Ref<InputEvent>::JOYPAD_BUTTON: {
- InputEventJoypadButton jb = ie.joy_button;
- InputEventJoypadButton jb2 = event.joy_button;
-
- if (jb->get_button_index() == jb2->get_button_index() &&
- jb->is_pressed() == jb2->is_pressed()) {
- match = true;
- }
- } break;
- case Ref<InputEvent>::SCREEN_TOUCH: {
- InputEventScreenTouch st = ie.screen_touch;
- InputEventScreenTouch st2 = event.screen_touch;
-
- if (st.index == st2.index &&
- st->is_pressed() == st2->is_pressed()) {
- match = true;
- }
-
- } break;
- case Ref<InputEvent>::SCREEN_DRAG: {
- InputEventScreenDrag sd = ie.screen_drag;
- InputEventScreenDrag sd2 = event.screen_drag;
-
- if (sd.index == sd2.index) {
- match = true;
- }
- } break;
- case Ref<InputEvent>::ACTION: {
-
- InputEventAction ia = ie.action;
- InputEventAction ia2 = event.action;
-
- if (ia.action == ia2.action &&
- ia->is_pressed() == ia2->is_pressed()) {
- match = true;
- }
- } break;
- }
-
- *p_outputs[0] = event;
-
- if (match)
- return i; //go through match output
- }
-
- return STEP_NO_ADVANCE_BIT; //none found, don't advance
- }
-};
-
-VisualScriptNodeInstance *VisualScriptInputFilter::instance(VisualScriptInstance *p_instance) {
-
- VisualScriptNodeInstanceInputFilter *instance = memnew(VisualScriptNodeInstanceInputFilter);
- instance->instance = p_instance;
- instance->filters = filters;
- return instance;
-}
-
-VisualScriptInputFilter::VisualScriptInputFilter() {
-}
-#endif
//////////////////////////////////////////
////////////////TYPE CAST///////////
//////////////////////////////////////////
diff --git a/modules/visual_script/visual_script_flow_control.h b/modules/visual_script/visual_script_flow_control.h
index 380eb76c45..4766bbef6b 100644
--- a/modules/visual_script/visual_script_flow_control.h
+++ b/modules/visual_script/visual_script_flow_control.h
@@ -228,40 +228,6 @@ public:
VisualScriptSwitch();
};
-#if 0
-class VisualScriptInputFilter : public VisualScriptNode {
-
- GDCLASS(VisualScriptInputFilter, VisualScriptNode)
-
- Vector<Ref<InputEvent>> filters;
-
-protected:
- bool _set(const StringName &p_name, const Variant &p_value);
- bool _get(const StringName &p_name, Variant &r_ret) const;
- void _get_property_list(List<PropertyInfo> *p_list) const;
-
-public:
- virtual int get_output_sequence_port_count() const;
- virtual bool has_input_sequence_port() const;
-
- virtual String get_output_sequence_port_text(int p_port) const;
-
- virtual int get_input_value_port_count() const;
- virtual int get_output_value_port_count() const;
-
- virtual PropertyInfo get_input_value_port_info(int p_idx) const;
- virtual PropertyInfo get_output_value_port_info(int p_idx) const;
-
- virtual String get_caption() const;
- virtual String get_text() const;
- virtual String get_category() const { return "flow_control"; }
-
- virtual VisualScriptNodeInstance *instance(VisualScriptInstance *p_instance);
-
- VisualScriptInputFilter();
-};
-#endif
-
class VisualScriptTypeCast : public VisualScriptNode {
GDCLASS(VisualScriptTypeCast, VisualScriptNode)
diff --git a/platform/android/detect.py b/platform/android/detect.py
index bc67f6e6dc..892b1b6a85 100644
--- a/platform/android/detect.py
+++ b/platform/android/detect.py
@@ -277,7 +277,7 @@ def get_ndk_version(path):
try:
with open(prop_file_path) as prop_file:
for line in prop_file:
- key_value = map(lambda x: string.strip(x), line.split("="))
+ key_value = list(map(lambda x: x.strip(), line.split("=")))
if key_value[0] == "Pkg.Revision":
return key_value[1]
except:
diff --git a/platform/android/export/export.cpp b/platform/android/export/export.cpp
index 6ca687d057..d4c079cfc6 100644
--- a/platform/android/export/export.cpp
+++ b/platform/android/export/export.cpp
@@ -352,10 +352,11 @@ class EditorExportAndroid : public EditorExportPlatform {
ea->device_lock->unlock();
}
+ uint64_t sleep = OS::get_singleton()->get_power_state() == OS::POWERSTATE_ON_BATTERY ? 1000 : 100;
uint64_t wait = 3000000;
uint64_t time = OS::get_singleton()->get_ticks_usec();
while (OS::get_singleton()->get_ticks_usec() - time < wait) {
- OS::get_singleton()->delay_usec(1000);
+ OS::get_singleton()->delay_usec(1000 * sleep);
if (ea->quit_request)
break;
}
diff --git a/platform/android/godot_android.cpp b/platform/android/godot_android.cpp
index f9bcbadc24..8c4a4726ae 100644
--- a/platform/android/godot_android.cpp
+++ b/platform/android/godot_android.cpp
@@ -927,7 +927,6 @@ JNIEXPORT void JNICALL Java_org_godotengine_godot_Godot_registerMethod(JNIEnv *e
int stringCount = env->GetArrayLength(args);
- print_line("Singl: " + singname + " Method: " + mname + " RetVal: " + retval);
for (int i = 0; i < stringCount; i++) {
jstring string = (jstring)env->GetObjectArrayElement(args, i);
@@ -939,7 +938,6 @@ JNIEXPORT void JNICALL Java_org_godotengine_godot_Godot_registerMethod(JNIEnv *e
cs += ")";
cs += get_jni_sig(retval);
jclass cls = env->GetObjectClass(s->get_instance());
- print_line("METHOD: " + mname + " sig: " + cs);
jmethodID mid = env->GetMethodID(cls, mname.ascii().get_data(), cs.ascii().get_data());
if (!mid) {
diff --git a/platform/android/java_glue.cpp b/platform/android/java_glue.cpp
index 40dfe6d909..1e28ef4c6a 100644
--- a/platform/android/java_glue.cpp
+++ b/platform/android/java_glue.cpp
@@ -241,7 +241,6 @@ Variant _jobject_to_variant(JNIEnv *env, jobject obj) {
String name = _get_class_name(env, c, &array);
//print_line("name is " + name + ", array "+Variant(array));
- print_line("ARGNAME: " + name);
if (name == "java.lang.String") {
return String::utf8(env->GetStringUTFChars((jstring)obj, NULL));
@@ -936,13 +935,7 @@ JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_setup(JNIEnv *env, jo
}
__android_log_print(ANDROID_LOG_INFO, "godot", "CMDLINE LEN %i - APK EXPANSION %i\n", cmdlen, int(use_apk_expansion));
-#if 0
- char *args[]={"-test","render",NULL};
- __android_log_print(ANDROID_LOG_INFO,"godot","pre asdasd setup...");
- Error err = Main::setup("apk",2,args,false);
-#else
Error err = Main::setup("apk", cmdlen, (char **)cmdline, false);
-#endif
if (cmdline) {
free(cmdline);
}
@@ -1519,7 +1512,6 @@ JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_method(JNIEnv *env, j
int stringCount = env->GetArrayLength(args);
- print_line("Singl: " + singname + " Method: " + mname + " RetVal: " + retval);
for (int i = 0; i < stringCount; i++) {
jstring string = (jstring)env->GetObjectArrayElement(args, i);
@@ -1531,7 +1523,6 @@ JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_method(JNIEnv *env, j
cs += ")";
cs += get_jni_sig(retval);
jclass cls = env->GetObjectClass(s->get_instance());
- print_line("METHOD: " + mname + " sig: " + cs);
jmethodID mid = env->GetMethodID(cls, mname.ascii().get_data(), cs.ascii().get_data());
if (!mid) {
diff --git a/platform/windows/detect.py b/platform/windows/detect.py
index 01eb50e69c..564359d743 100644
--- a/platform/windows/detect.py
+++ b/platform/windows/detect.py
@@ -188,6 +188,9 @@ def configure(env):
else:
VC_PATH = ""
+ if (env["use_lto"]):
+ env.Append(CCFLAGS=['/GL'])
+ env.Append(LINKFLAGS=['/LTCG'])
if (env["openmp"]):
env.Append(CPPFLAGS=['/openmp'])
diff --git a/scene/3d/baked_lightmap.cpp b/scene/3d/baked_lightmap.cpp
index 3d9bb73181..754dcd9a6c 100644
--- a/scene/3d/baked_lightmap.cpp
+++ b/scene/3d/baked_lightmap.cpp
@@ -55,12 +55,13 @@ float BakedLightmapData::get_energy() const {
return energy;
}
-void BakedLightmapData::add_user(const NodePath &p_path, const Ref<Texture> &p_lightmap) {
+void BakedLightmapData::add_user(const NodePath &p_path, const Ref<Texture> &p_lightmap, int p_instance) {
ERR_FAIL_COND(p_lightmap.is_null());
User user;
user.path = p_path;
user.lightmap = p_lightmap;
+ user.instance_index = p_instance;
users.push_back(user);
}
@@ -79,16 +80,22 @@ Ref<Texture> BakedLightmapData::get_user_lightmap(int p_user) const {
return users[p_user].lightmap;
}
+int BakedLightmapData::get_user_instance(int p_user) const {
+
+ ERR_FAIL_INDEX_V(p_user, users.size(), -1);
+ return users[p_user].instance_index;
+}
+
void BakedLightmapData::clear_users() {
users.clear();
}
void BakedLightmapData::_set_user_data(const Array &p_data) {
- ERR_FAIL_COND(p_data.size() & 1);
+ ERR_FAIL_COND((p_data.size() % 3) != 0);
- for (int i = 0; i < p_data.size(); i += 2) {
- add_user(p_data[i], p_data[i + 1]);
+ for (int i = 0; i < p_data.size(); i += 3) {
+ add_user(p_data[i], p_data[i + 1], p_data[i + 2]);
}
}
@@ -98,6 +105,7 @@ Array BakedLightmapData::_get_user_data() const {
for (int i = 0; i < users.size(); i++) {
ret.push_back(users[i].path);
ret.push_back(users[i].lightmap);
+ ret.push_back(users[i].instance_index);
}
return ret;
}
@@ -125,7 +133,7 @@ void BakedLightmapData::_bind_methods() {
ClassDB::bind_method(D_METHOD("set_energy", "energy"), &BakedLightmapData::set_energy);
ClassDB::bind_method(D_METHOD("get_energy"), &BakedLightmapData::get_energy);
- ClassDB::bind_method(D_METHOD("add_user", "path", "lightmap"), &BakedLightmapData::add_user);
+ ClassDB::bind_method(D_METHOD("add_user", "path", "lightmap", "instance"), &BakedLightmapData::add_user);
ClassDB::bind_method(D_METHOD("get_user_count"), &BakedLightmapData::get_user_count);
ClassDB::bind_method(D_METHOD("get_user_path", "user_idx"), &BakedLightmapData::get_user_path);
ClassDB::bind_method(D_METHOD("get_user_lightmap", "user_idx"), &BakedLightmapData::get_user_lightmap);
@@ -209,6 +217,7 @@ void BakedLightmap::_find_meshes_and_lights(Node *p_at_node, List<PlotMesh> &plo
pm.local_xform = xf;
pm.mesh = mesh;
pm.path = get_path_to(mi);
+ pm.instance_idx = -1;
for (int i = 0; i < mesh->get_surface_count(); i++) {
pm.instance_materials.push_back(mi->get_surface_material(i));
}
@@ -219,6 +228,26 @@ void BakedLightmap::_find_meshes_and_lights(Node *p_at_node, List<PlotMesh> &plo
}
}
+ Spatial *s = Object::cast_to<Spatial>(p_at_node);
+
+ if (!mi && s) {
+ Array meshes = p_at_node->call("get_bake_meshes");
+ if (meshes.size() && (meshes.size() & 1) == 0) {
+ Transform xf = get_global_transform().affine_inverse() * s->get_global_transform();
+ for (int i = 0; i < meshes.size(); i += 2) {
+ PlotMesh pm;
+ Transform mesh_xf = meshes[i + 1];
+ pm.local_xform = xf * mesh_xf;
+ pm.mesh = meshes[i];
+ pm.instance_idx = i / 2;
+ if (!pm.mesh.is_valid())
+ continue;
+ pm.path = get_path_to(s);
+ plot_meshes.push_back(pm);
+ }
+ }
+ }
+
Light *light = Object::cast_to<Light>(p_at_node);
if (light && light->get_bake_mode() != Light::BAKE_DISABLED) {
@@ -298,7 +327,7 @@ BakedLightmap::BakeError BakedLightmap::bake(Node *p_from_node, bool p_create_vi
Ref<BakedLightmapData> new_light_data;
new_light_data.instance();
- static const int subdiv_value[SUBDIV_MAX] = { 8, 9, 10, 11, 12, 13 };
+ static const int subdiv_value[SUBDIV_MAX] = { 8, 9, 10, 11 };
VoxelLightBaker baker;
@@ -477,7 +506,7 @@ BakedLightmap::BakeError BakedLightmap::bake(Node *p_from_node, bool p_create_vi
if (set_path) {
tex->set_path(image_path);
}
- new_light_data->add_user(E->get().path, tex);
+ new_light_data->add_user(E->get().path, tex, E->get().instance_idx);
}
}
@@ -547,12 +576,21 @@ void BakedLightmap::_assign_lightmaps() {
ERR_FAIL_COND(!light_data.is_valid());
for (int i = 0; i < light_data->get_user_count(); i++) {
- Node *node = get_node(light_data->get_user_path(i));
- VisualInstance *vi = Object::cast_to<VisualInstance>(node);
- ERR_CONTINUE(!vi);
Ref<Texture> lightmap = light_data->get_user_lightmap(i);
ERR_CONTINUE(!lightmap.is_valid());
- VS::get_singleton()->instance_set_use_lightmap(vi->get_instance(), get_instance(), lightmap->get_rid());
+
+ Node *node = get_node(light_data->get_user_path(i));
+ int instance_idx = light_data->get_user_instance(i);
+ if (instance_idx >= 0) {
+ RID instance = node->call("get_bake_mesh_instance", instance_idx);
+ if (instance.is_valid()) {
+ VS::get_singleton()->instance_set_use_lightmap(instance, get_instance(), lightmap->get_rid());
+ }
+ } else {
+ VisualInstance *vi = Object::cast_to<VisualInstance>(node);
+ ERR_CONTINUE(!vi);
+ VS::get_singleton()->instance_set_use_lightmap(vi->get_instance(), get_instance(), lightmap->get_rid());
+ }
}
}
@@ -560,9 +598,17 @@ void BakedLightmap::_clear_lightmaps() {
ERR_FAIL_COND(!light_data.is_valid());
for (int i = 0; i < light_data->get_user_count(); i++) {
Node *node = get_node(light_data->get_user_path(i));
- VisualInstance *vi = Object::cast_to<VisualInstance>(node);
- ERR_CONTINUE(!vi);
- VS::get_singleton()->instance_set_use_lightmap(vi->get_instance(), RID(), RID());
+ int instance_idx = light_data->get_user_instance(i);
+ if (instance_idx >= 0) {
+ RID instance = node->call("get_bake_mesh_instance", instance_idx);
+ if (instance.is_valid()) {
+ VS::get_singleton()->instance_set_use_lightmap(instance, get_instance(), RID());
+ }
+ } else {
+ VisualInstance *vi = Object::cast_to<VisualInstance>(node);
+ ERR_CONTINUE(!vi);
+ VS::get_singleton()->instance_set_use_lightmap(vi->get_instance(), get_instance(), RID());
+ }
}
}
@@ -678,7 +724,7 @@ void BakedLightmap::_bind_methods() {
ClassDB::bind_method(D_METHOD("debug_bake"), &BakedLightmap::_debug_bake);
ClassDB::set_method_flags(get_class_static(), _scs_create("debug_bake"), METHOD_FLAGS_DEFAULT | METHOD_FLAG_EDITOR);
- ADD_PROPERTY(PropertyInfo(Variant::INT, "bake_subdiv", PROPERTY_HINT_ENUM, "128,256,512,1024,2048,4096"), "set_bake_subdiv", "get_bake_subdiv");
+ ADD_PROPERTY(PropertyInfo(Variant::INT, "bake_subdiv", PROPERTY_HINT_ENUM, "128,256,512,1024"), "set_bake_subdiv", "get_bake_subdiv");
ADD_PROPERTY(PropertyInfo(Variant::INT, "capture_subdiv", PROPERTY_HINT_ENUM, "128,256,512"), "set_capture_subdiv", "get_capture_subdiv");
ADD_PROPERTY(PropertyInfo(Variant::INT, "bake_quality", PROPERTY_HINT_ENUM, "Low,Medium,High"), "set_bake_quality", "get_bake_quality");
ADD_PROPERTY(PropertyInfo(Variant::INT, "bake_mode", PROPERTY_HINT_ENUM, "ConeTrace,RayTrace"), "set_bake_mode", "get_bake_mode");
@@ -693,8 +739,6 @@ void BakedLightmap::_bind_methods() {
BIND_ENUM_CONSTANT(SUBDIV_256);
BIND_ENUM_CONSTANT(SUBDIV_512);
BIND_ENUM_CONSTANT(SUBDIV_1024);
- BIND_ENUM_CONSTANT(SUBDIV_2048);
- BIND_ENUM_CONSTANT(SUBDIV_4096);
BIND_ENUM_CONSTANT(SUBDIV_MAX);
BIND_ENUM_CONSTANT(BAKE_QUALITY_LOW);
@@ -702,6 +746,12 @@ void BakedLightmap::_bind_methods() {
BIND_ENUM_CONSTANT(BAKE_QUALITY_HIGH);
BIND_ENUM_CONSTANT(BAKE_MODE_CONE_TRACE);
BIND_ENUM_CONSTANT(BAKE_MODE_RAY_TRACE);
+
+ BIND_ENUM_CONSTANT(BAKE_ERROR_OK);
+ BIND_ENUM_CONSTANT(BAKE_ERROR_NO_SAVE_PATH);
+ BIND_ENUM_CONSTANT(BAKE_ERROR_NO_MESHES);
+ BIND_ENUM_CONSTANT(BAKE_ERROR_CANT_CREATE_IMAGE);
+ BIND_ENUM_CONSTANT(BAKE_ERROR_USER_ABORTED);
}
BakedLightmap::BakedLightmap() {
diff --git a/scene/3d/baked_lightmap.h b/scene/3d/baked_lightmap.h
index 5595ec1e61..9e15f1bb10 100644
--- a/scene/3d/baked_lightmap.h
+++ b/scene/3d/baked_lightmap.h
@@ -18,6 +18,7 @@ class BakedLightmapData : public Resource {
NodePath path;
Ref<Texture> lightmap;
+ int instance_index;
};
Vector<User> users;
@@ -44,10 +45,11 @@ public:
void set_energy(float p_energy);
float get_energy() const;
- void add_user(const NodePath &p_path, const Ref<Texture> &p_lightmap);
+ void add_user(const NodePath &p_path, const Ref<Texture> &p_lightmap, int p_instance = -1);
int get_user_count() const;
NodePath get_user_path(int p_user) const;
Ref<Texture> get_user_lightmap(int p_user) const;
+ int get_user_instance(int p_user) const;
void clear_users();
virtual RID get_rid() const;
@@ -64,8 +66,6 @@ public:
SUBDIV_256,
SUBDIV_512,
SUBDIV_1024,
- SUBDIV_2048,
- SUBDIV_4096,
SUBDIV_MAX
};
@@ -113,6 +113,7 @@ private:
Ref<Mesh> mesh;
Transform local_xform;
NodePath path;
+ int instance_idx;
};
struct PlotLight {
diff --git a/scene/3d/portal.h b/scene/3d/portal.h
index 4ea208a718..a3a7956286 100644
--- a/scene/3d/portal.h
+++ b/scene/3d/portal.h
@@ -39,7 +39,8 @@
If a portal is placed next (very close to) a similar, opposing portal, they automatically connect,
otherwise, a portal connects to the parent room
*/
-//this will be redone and replaced by area portals, left for reference since a new class with this name will have to exist and want to reuse the gizmos
+// FIXME: This will be redone and replaced by area portals, left for reference
+// since a new class with this name will have to exist and want to reuse the gizmos
#if 0
class Portal : public VisualInstance {
diff --git a/scene/3d/room_instance.h b/scene/3d/room_instance.h
index 3069ea2eba..2b2f80a0c6 100644
--- a/scene/3d/room_instance.h
+++ b/scene/3d/room_instance.h
@@ -44,7 +44,7 @@
*/
-//this will be removed, left for reference
+// FIXME: this will be removed, left for reference
#if 0
class Room : public VisualInstance {
diff --git a/scene/3d/sprite_3d.cpp b/scene/3d/sprite_3d.cpp
index 18ebc22c8b..2ecc445663 100644
--- a/scene/3d/sprite_3d.cpp
+++ b/scene/3d/sprite_3d.cpp
@@ -294,6 +294,7 @@ SpriteBase3D::SpriteBase3D() {
for (int i = 0; i < FLAG_MAX; i++)
flags[i] = i == FLAG_TRANSPARENT || i == FLAG_DOUBLE_SIDED;
+ alpha_cut = ALPHA_CUT_DISABLED;
axis = Vector3::AXIS_Z;
pixel_size = 0.01;
modulate = Color(1, 1, 1, 1);
diff --git a/scene/3d/voxel_light_baker.cpp b/scene/3d/voxel_light_baker.cpp
index 98dc1590d8..96ac5e8a05 100644
--- a/scene/3d/voxel_light_baker.cpp
+++ b/scene/3d/voxel_light_baker.cpp
@@ -833,11 +833,13 @@ void VoxelLightBaker::plot_light_directional(const Vector3 &p_direction, const C
}
}
- for (int i = 0; i < 6; i++) {
- float s = MAX(0.0, aniso_normal[i].dot(-light_axis)); //light depending on normal for direct
- light->direct_accum[i][0] += light_energy.x * s;
- light->direct_accum[i][1] += light_energy.y * s;
- light->direct_accum[i][2] += light_energy.z * s;
+ if (p_direct) {
+ for (int i = 0; i < 6; i++) {
+ float s = MAX(0.0, aniso_normal[i].dot(-light_axis)); //light depending on normal for direct
+ light->direct_accum[i][0] += light_energy.x * s;
+ light->direct_accum[i][1] += light_energy.y * s;
+ light->direct_accum[i][2] += light_energy.z * s;
+ }
}
success_count++;
}
@@ -897,17 +899,7 @@ void VoxelLightBaker::plot_light_omni(const Vector3 &p_pos, const Color &p_color
float dt = CLAMP((d + distance_adv) / local_radius, 0, 1);
att *= powf(1.0 - dt, p_attenutation);
}
-#if 0
- if (light_cache.type == VS::LIGHT_SPOT) {
- float angle = Math::rad2deg(acos(light_axis.dot(spot_axis)));
- if (angle > light_cache.spot_angle)
- continue;
-
- float d = CLAMP(angle / light_cache.spot_angle, 1, 0);
- att *= powf(1.0 - d, light_cache.spot_attenuation);
- }
-#endif
clip_planes = 0;
for (int c = 0; c < 3; c++) {
@@ -972,11 +964,13 @@ void VoxelLightBaker::plot_light_omni(const Vector3 &p_pos, const Color &p_color
}
}
- for (int i = 0; i < 6; i++) {
- float s = MAX(0.0, aniso_normal[i].dot(-light_axis)); //light depending on normal for direct
- light->direct_accum[i][0] += light_energy.x * s * att;
- light->direct_accum[i][1] += light_energy.y * s * att;
- light->direct_accum[i][2] += light_energy.z * s * att;
+ if (p_direct) {
+ for (int i = 0; i < 6; i++) {
+ float s = MAX(0.0, aniso_normal[i].dot(-light_axis)); //light depending on normal for direct
+ light->direct_accum[i][0] += light_energy.x * s * att;
+ light->direct_accum[i][1] += light_energy.y * s * att;
+ light->direct_accum[i][2] += light_energy.z * s * att;
+ }
}
}
@@ -1041,17 +1035,7 @@ void VoxelLightBaker::plot_light_spot(const Vector3 &p_pos, const Vector3 &p_axi
float dt = CLAMP((d + distance_adv) / local_radius, 0, 1);
att *= powf(1.0 - dt, p_attenutation);
}
-#if 0
- if (light_cache.type == VS::LIGHT_SPOT) {
-
- float angle = Math::rad2deg(acos(light_axis.dot(spot_axis)));
- if (angle > light_cache.spot_angle)
- continue;
- float d = CLAMP(angle / light_cache.spot_angle, 1, 0);
- att *= powf(1.0 - d, light_cache.spot_attenuation);
- }
-#endif
clip_planes = 0;
for (int c = 0; c < 3; c++) {
@@ -1115,11 +1099,13 @@ void VoxelLightBaker::plot_light_spot(const Vector3 &p_pos, const Vector3 &p_axi
}
}
- for (int i = 0; i < 6; i++) {
- float s = MAX(0.0, aniso_normal[i].dot(-light_axis)); //light depending on normal for direct
- light->direct_accum[i][0] += light_energy.x * s * att;
- light->direct_accum[i][1] += light_energy.y * s * att;
- light->direct_accum[i][2] += light_energy.z * s * att;
+ if (p_direct) {
+ for (int i = 0; i < 6; i++) {
+ float s = MAX(0.0, aniso_normal[i].dot(-light_axis)); //light depending on normal for direct
+ light->direct_accum[i][0] += light_energy.x * s * att;
+ light->direct_accum[i][1] += light_energy.y * s * att;
+ light->direct_accum[i][2] += light_energy.z * s * att;
+ }
}
}
@@ -1614,6 +1600,18 @@ Vector3 VoxelLightBaker::_compute_pixel_light_at_pos(const Vector3 &p_pos, const
return accum;
}
+uint32_t xorshiftstate[] = { 123 }; // anything non-zero will do here
+
+_ALWAYS_INLINE_ uint32_t xorshift32() {
+ /* Algorithm "xor" from p. 4 of Marsaglia, "Xorshift RNGs" */
+ uint32_t x = xorshiftstate[0];
+ x ^= x << 13;
+ x ^= x >> 17;
+ x ^= x << 5;
+ xorshiftstate[0] = x;
+ return x;
+}
+
Vector3 VoxelLightBaker::_compute_ray_trace_at_pos(const Vector3 &p_pos, const Vector3 &p_normal) {
int samples_per_quality[3] = { 48, 128, 512 };
@@ -1638,9 +1636,9 @@ Vector3 VoxelLightBaker::_compute_ray_trace_at_pos(const Vector3 &p_pos, const V
for (int i = 0; i < samples; i++) {
- float random_angle1 = (((Math::rand() % 65535) / 65535.0) * 2.0 - 1.0) * spread;
+ float random_angle1 = (((xorshift32() % 65535) / 65535.0) * 2.0 - 1.0) * spread;
Vector3 axis(0, sin(random_angle1), cos(random_angle1));
- float random_angle2 = ((Math::rand() % 65535) / 65535.0) * Math_PI * 2.0;
+ float random_angle2 = ((xorshift32() % 65535) / 65535.0) * Math_PI * 2.0;
Basis rot(Vector3(0, 0, 1), random_angle2);
axis = rot.xform(axis);
@@ -1692,7 +1690,7 @@ Vector3 VoxelLightBaker::_compute_ray_trace_at_pos(const Vector3 &p_pos, const V
}
cell = bc->childs[child];
- if (cell == CHILD_EMPTY)
+ if (unlikely(cell == CHILD_EMPTY))
break;
half >>= 1;
@@ -1701,12 +1699,12 @@ Vector3 VoxelLightBaker::_compute_ray_trace_at_pos(const Vector3 &p_pos, const V
pos += advance;
}
- if (cell != CHILD_EMPTY) {
+ if (unlikely(cell != CHILD_EMPTY)) {
for (int i = 0; i < 6; i++) {
//anisotropic read light
float amount = direction.dot(aniso_normal[i]);
- if (amount < 0)
- amount = 0;
+ if (amount <= 0)
+ continue;
accum.x += light[cell].accum[i][0] * amount;
accum.y += light[cell].accum[i][1] * amount;
accum.z += light[cell].accum[i][2] * amount;
@@ -1781,7 +1779,7 @@ Error VoxelLightBaker::make_lightmap(const Transform &p_xform, Ref<Mesh> &p_mesh
//print_line("bake line " + itos(i) + " / " + itos(height));
#ifdef _OPENMP
-#pragma omp parallel for
+#pragma omp parallel for schedule(dynamic, 1)
#endif
for (int j = 0; j < width; j++) {
@@ -1878,12 +1876,14 @@ Error VoxelLightBaker::make_lightmap(const Transform &p_xform, Ref<Mesh> &p_mesh
LightMap *lightmap_ptr = lightmap.ptrw();
const Cell *cells = bake_cells.ptr();
const Light *light = bake_light.ptr();
-
+#ifdef _OPENMP
+#pragma omp parallel
+#endif
for (int i = 0; i < height; i++) {
//print_line("bake line " + itos(i) + " / " + itos(height));
#ifdef _OPENMP
-#pragma omp parallel for
+#pragma omp parallel for schedule(dynamic, 1)
#endif
for (int j = 0; j < width; j++) {
@@ -2002,6 +2002,7 @@ Error VoxelLightBaker::make_lightmap(const Transform &p_xform, Ref<Mesh> &p_mesh
}
}
+// Enable for debugging
#if 0
{
PoolVector<uint8_t> img;
diff --git a/scene/gui/control.cpp b/scene/gui/control.cpp
index 81d2b6731f..b34abf5a46 100644
--- a/scene/gui/control.cpp
+++ b/scene/gui/control.cpp
@@ -2835,7 +2835,7 @@ void Control::_bind_methods() {
ADD_PROPERTYNZ(PropertyInfo(Variant::REAL, "rect_rotation", PROPERTY_HINT_RANGE, "-1080,1080,0.01"), "set_rotation_degrees", "get_rotation_degrees");
ADD_PROPERTYNO(PropertyInfo(Variant::VECTOR2, "rect_scale"), "set_scale", "get_scale");
ADD_PROPERTYNO(PropertyInfo(Variant::VECTOR2, "rect_pivot_offset"), "set_pivot_offset", "get_pivot_offset");
- ADD_PROPERTYNO(PropertyInfo(Variant::BOOL, "rect_clip_content"), "set_clip_contents", "is_clipping_contents");
+ ADD_PROPERTYNZ(PropertyInfo(Variant::BOOL, "rect_clip_content"), "set_clip_contents", "is_clipping_contents");
ADD_GROUP("Hint", "hint_");
ADD_PROPERTYNZ(PropertyInfo(Variant::STRING, "hint_tooltip", PROPERTY_HINT_MULTILINE_TEXT), "set_tooltip", "_get_tooltip");
diff --git a/scene/gui/line_edit.cpp b/scene/gui/line_edit.cpp
index 85ae6d6241..cebbb2193d 100644
--- a/scene/gui/line_edit.cpp
+++ b/scene/gui/line_edit.cpp
@@ -85,7 +85,7 @@ void LineEdit::_gui_input(Ref<InputEvent> p_event) {
if ((cursor_pos < selection.begin) || (cursor_pos > selection.end) || !selection.enabled) {
- selection_clear();
+ deselect();
selection.cursor_start = cursor_pos;
selection.creating = true;
} else if (selection.enabled) {
@@ -99,7 +99,7 @@ void LineEdit::_gui_input(Ref<InputEvent> p_event) {
} else {
if ((!selection.creating) && (!selection.doubleclick)) {
- selection_clear();
+ deselect();
}
selection.creating = false;
selection.doubleclick = false;
@@ -175,7 +175,7 @@ void LineEdit::_gui_input(Ref<InputEvent> p_event) {
if (editable) {
- selection_clear();
+ deselect();
text = text.substr(cursor_pos, text.length() - cursor_pos);
Ref<Font> font = get_font("font");
@@ -204,7 +204,7 @@ void LineEdit::_gui_input(Ref<InputEvent> p_event) {
if (editable) {
- selection_clear();
+ deselect();
text = text.substr(0, cursor_pos);
_text_changed();
}
@@ -827,7 +827,7 @@ void LineEdit::shift_selection_check_pre(bool p_shift) {
selection.cursor_start = cursor_pos;
}
if (!p_shift)
- selection_clear();
+ deselect();
}
void LineEdit::shift_selection_check_post(bool p_shift) {
@@ -880,13 +880,6 @@ void LineEdit::set_cursor_at_pixel_pos(int p_x) {
}
set_cursor_position(ofs);
-
- /*
- int new_cursor_pos=p_x;
- int charwidth=draw_area->get_font_char_width(' ',0);
- new_cursor_pos=( ( (new_cursor_pos-2)+ (charwidth/2) ) /charwidth );
- if (new_cursor_pos>(int)text.length()) new_cursor_pos=text.length();
- set_cursor_position(window_pos+new_cursor_pos); */
}
bool LineEdit::cursor_get_blink_enabled() const {
@@ -941,11 +934,6 @@ void LineEdit::delete_char() {
set_cursor_position(get_cursor_position() - 1);
- if (cursor_pos == window_pos) {
-
- //set_window_pos(cursor_pos-get_window_length());
- }
-
_text_changed();
}
@@ -1143,7 +1131,7 @@ Size2 LineEdit::get_minimum_size() const {
/* selection */
-void LineEdit::selection_clear() {
+void LineEdit::deselect() {
selection.begin = 0;
selection.end = 0;
@@ -1159,7 +1147,7 @@ void LineEdit::selection_delete() {
if (selection.enabled)
delete_text(selection.begin, selection.end);
- selection_clear();
+ deselect();
}
void LineEdit::set_max_length(int p_max_length) {
@@ -1224,7 +1212,7 @@ bool LineEdit::is_secret() const {
void LineEdit::select(int p_from, int p_to) {
if (p_from == 0 && p_to == 0) {
- selection_clear();
+ deselect();
return;
}
@@ -1383,7 +1371,9 @@ void LineEdit::_bind_methods() {
ClassDB::bind_method(D_METHOD("_gui_input"), &LineEdit::_gui_input);
ClassDB::bind_method(D_METHOD("clear"), &LineEdit::clear);
+ ClassDB::bind_method(D_METHOD("select", "from", "to"), &LineEdit::select, DEFVAL(0), DEFVAL(-1));
ClassDB::bind_method(D_METHOD("select_all"), &LineEdit::select_all);
+ ClassDB::bind_method(D_METHOD("deselect"), &LineEdit::deselect);
ClassDB::bind_method(D_METHOD("set_text", "text"), &LineEdit::set_text);
ClassDB::bind_method(D_METHOD("get_text"), &LineEdit::get_text);
ClassDB::bind_method(D_METHOD("set_placeholder", "text"), &LineEdit::set_placeholder);
@@ -1405,7 +1395,6 @@ void LineEdit::_bind_methods() {
ClassDB::bind_method(D_METHOD("is_editable"), &LineEdit::is_editable);
ClassDB::bind_method(D_METHOD("set_secret", "enabled"), &LineEdit::set_secret);
ClassDB::bind_method(D_METHOD("is_secret"), &LineEdit::is_secret);
- ClassDB::bind_method(D_METHOD("select", "from", "to"), &LineEdit::select, DEFVAL(0), DEFVAL(-1));
ClassDB::bind_method(D_METHOD("menu_option", "option"), &LineEdit::menu_option);
ClassDB::bind_method(D_METHOD("get_menu"), &LineEdit::get_menu);
ClassDB::bind_method(D_METHOD("set_context_menu_enabled", "enable"), &LineEdit::set_context_menu_enabled);
@@ -1457,7 +1446,7 @@ LineEdit::LineEdit() {
pass = false;
placeholder_alpha = 0.6;
- selection_clear();
+ deselect();
set_focus_mode(FOCUS_ALL);
editable = true;
set_default_cursor_shape(CURSOR_IBEAM);
diff --git a/scene/gui/line_edit.h b/scene/gui/line_edit.h
index c3a299c2f5..5ca4ca15df 100644
--- a/scene/gui/line_edit.h
+++ b/scene/gui/line_edit.h
@@ -119,7 +119,6 @@ private:
void shift_selection_check_pre(bool);
void shift_selection_check_post(bool);
- void selection_clear();
void selection_fill_at_cursor();
void selection_delete();
void set_window_pos(int p_pos);
@@ -155,7 +154,9 @@ public:
bool is_context_menu_enabled();
PopupMenu *get_menu() const;
+ void select(int p_from = 0, int p_to = -1);
void select_all();
+ void deselect();
void delete_char();
void delete_text(int p_from_column, int p_to_column);
@@ -190,8 +191,6 @@ public:
void set_secret(bool p_secret);
bool is_secret() const;
- void select(int p_from = 0, int p_to = -1);
-
virtual Size2 get_minimum_size() const;
void set_expand_to_text_length(bool p_enabled);
diff --git a/scene/gui/popup_menu.cpp b/scene/gui/popup_menu.cpp
index 698676cc39..d598104cf5 100644
--- a/scene/gui/popup_menu.cpp
+++ b/scene/gui/popup_menu.cpp
@@ -202,7 +202,11 @@ void PopupMenu::_gui_input(const Ref<InputEvent> &p_event) {
case KEY_DOWN: {
- for (int i = mouse_over + 1; i < items.size(); i++) {
+ int search_from = mouse_over + 1;
+ if (search_from >= items.size())
+ search_from = 0;
+
+ for (int i = search_from; i < items.size(); i++) {
if (i < 0 || i >= items.size())
continue;
@@ -211,18 +215,17 @@ void PopupMenu::_gui_input(const Ref<InputEvent> &p_event) {
mouse_over = i;
update();
-
- if (items[i].submenu != "" && submenu_over != i) {
- submenu_over = i;
- submenu_timer->start();
- }
break;
}
}
} break;
case KEY_UP: {
- for (int i = mouse_over - 1; i >= 0; i--) {
+ int search_from = mouse_over - 1;
+ if (search_from < 0)
+ search_from = items.size() - 1;
+
+ for (int i = search_from; i >= 0; i--) {
if (i < 0 || i >= items.size())
continue;
@@ -231,20 +234,40 @@ void PopupMenu::_gui_input(const Ref<InputEvent> &p_event) {
mouse_over = i;
update();
-
- if (items[i].submenu != "" && submenu_over != i) {
- submenu_over = i;
- submenu_timer->start();
- }
break;
}
}
} break;
+
+ case KEY_LEFT: {
+
+ Node *n = get_parent();
+ if (!n)
+ break;
+
+ PopupMenu *pm = Object::cast_to<PopupMenu>(n);
+ if (!pm)
+ break;
+
+ hide();
+ } break;
+
+ case KEY_RIGHT: {
+
+ if (mouse_over >= 0 && mouse_over < items.size() && !items[mouse_over].separator && items[mouse_over].submenu != "" && submenu_over != mouse_over)
+ _activate_submenu(mouse_over);
+ } break;
+
case KEY_ENTER:
case KEY_KP_ENTER: {
if (mouse_over >= 0 && mouse_over < items.size() && !items[mouse_over].separator) {
+ if (items[mouse_over].submenu != "" && submenu_over != mouse_over) {
+ _activate_submenu(mouse_over);
+ break;
+ }
+
activate_item(mouse_over);
}
} break;
diff --git a/scene/gui/text_edit.cpp b/scene/gui/text_edit.cpp
index 83aee5ca30..07f1bdf8e5 100644
--- a/scene/gui/text_edit.cpp
+++ b/scene/gui/text_edit.cpp
@@ -4084,7 +4084,7 @@ void TextEdit::cut() {
backspace_at_cursor();
update();
cursor_set_line(cursor.line + 1);
- cut_copy_line = true;
+ cut_copy_line = clipboard;
} else {
@@ -4098,7 +4098,7 @@ void TextEdit::cut() {
selection.active = false;
selection.selecting_mode = Selection::MODE_NONE;
update();
- cut_copy_line = false;
+ cut_copy_line = "";
}
}
@@ -4107,11 +4107,11 @@ void TextEdit::copy() {
if (!selection.active) {
String clipboard = _base_get_text(cursor.line, 0, cursor.line, text[cursor.line].length());
OS::get_singleton()->set_clipboard(clipboard);
- cut_copy_line = true;
+ cut_copy_line = clipboard;
} else {
String clipboard = _base_get_text(selection.from_line, selection.from_column, selection.to_line, selection.to_column);
OS::get_singleton()->set_clipboard(clipboard);
- cut_copy_line = false;
+ cut_copy_line = "";
}
}
@@ -4127,7 +4127,7 @@ void TextEdit::paste() {
cursor_set_line(selection.from_line);
cursor_set_column(selection.from_column);
- } else if (cut_copy_line) {
+ } else if (!cut_copy_line.empty() && cut_copy_line == clipboard) {
cursor_set_column(0);
String ins = "\n";
diff --git a/scene/gui/text_edit.h b/scene/gui/text_edit.h
index edef28cc25..836d5c7388 100644
--- a/scene/gui/text_edit.h
+++ b/scene/gui/text_edit.h
@@ -270,7 +270,7 @@ class TextEdit : public Control {
bool brace_matching_enabled;
bool highlight_current_line;
bool auto_indent;
- bool cut_copy_line;
+ String cut_copy_line;
bool insert_mode;
bool select_identifiers_enabled;
diff --git a/scene/main/node.cpp b/scene/main/node.cpp
index af7a6bddd9..de1ab9959a 100644
--- a/scene/main/node.cpp
+++ b/scene/main/node.cpp
@@ -2162,7 +2162,7 @@ Node *Node::_duplicate(int p_flags, Map<const Node *, Node *> *r_duplimap) const
Variant value = N->get()->get(name);
// Duplicate dictionaries and arrays, mainly needed for __meta__
if (value.get_type() == Variant::DICTIONARY) {
- value = Dictionary(value).copy();
+ value = Dictionary(value).duplicate();
} else if (value.get_type() == Variant::ARRAY) {
value = Array(value).duplicate();
}
@@ -2303,7 +2303,7 @@ void Node::_duplicate_and_reown(Node *p_new_parent, const Map<Node *, Node *> &p
Variant value = get(name);
// Duplicate dictionaries and arrays, mainly needed for __meta__
if (value.get_type() == Variant::DICTIONARY) {
- value = Dictionary(value).copy();
+ value = Dictionary(value).duplicate();
} else if (value.get_type() == Variant::ARRAY) {
value = Array(value).duplicate();
}
diff --git a/scene/register_scene_types.cpp b/scene/register_scene_types.cpp
index 9715e1d6a0..246283edcc 100644
--- a/scene/register_scene_types.cpp
+++ b/scene/register_scene_types.cpp
@@ -268,11 +268,11 @@ void register_scene_types() {
ClassDB::register_class<Control>();
ClassDB::register_class<Button>();
ClassDB::register_class<Label>();
- ClassDB::register_class<ScrollBar>();
+ ClassDB::register_virtual_class<ScrollBar>();
ClassDB::register_class<HScrollBar>();
ClassDB::register_class<VScrollBar>();
ClassDB::register_class<ProgressBar>();
- ClassDB::register_class<Slider>();
+ ClassDB::register_virtual_class<Slider>();
ClassDB::register_class<HSlider>();
ClassDB::register_class<VSlider>();
ClassDB::register_class<Popup>();
@@ -283,7 +283,7 @@ void register_scene_types() {
ClassDB::register_class<ToolButton>();
ClassDB::register_class<LinkButton>();
ClassDB::register_class<Panel>();
- ClassDB::register_class<Range>();
+ ClassDB::register_virtual_class<Range>();
OS::get_singleton()->yield(); //may take time to init
diff --git a/scene/resources/mesh.cpp b/scene/resources/mesh.cpp
index bb33962be6..bf5f7bf039 100644
--- a/scene/resources/mesh.cpp
+++ b/scene/resources/mesh.cpp
@@ -1111,13 +1111,14 @@ Error ArrayMesh::lightmap_unwrap(const Transform &p_base_transform, float p_texe
for (int j = 0; j < vc; j++) {
Vector3 v = p_base_transform.xform(r[j]);
+ Vector3 n = p_base_transform.basis.xform(rn[j]).normalized();
vertices[(j + vertex_ofs) * 3 + 0] = v.x;
vertices[(j + vertex_ofs) * 3 + 1] = v.y;
vertices[(j + vertex_ofs) * 3 + 2] = v.z;
- normals[(j + vertex_ofs) * 3 + 0] = rn[j].x;
- normals[(j + vertex_ofs) * 3 + 1] = rn[j].y;
- normals[(j + vertex_ofs) * 3 + 2] = rn[j].z;
+ normals[(j + vertex_ofs) * 3 + 0] = n.x;
+ normals[(j + vertex_ofs) * 3 + 1] = n.y;
+ normals[(j + vertex_ofs) * 3 + 2] = n.z;
uv_index[j + vertex_ofs] = Pair<int, int>(i, j);
}
diff --git a/scene/resources/room.h b/scene/resources/room.h
index aadee858c2..0e021cfcf7 100644
--- a/scene/resources/room.h
+++ b/scene/resources/room.h
@@ -36,7 +36,7 @@
@author Juan Linietsky <reduzio@gmail.com>
*/
-//left for reference but will be removed when portals are reimplemented using Area
+// FIXME: left for reference but will be removed when portals are reimplemented using Area
#if 0
class RoomBounds : public Resource {
diff --git a/servers/visual/shader_language.cpp b/servers/visual/shader_language.cpp
index c69bbb9343..834505df9a 100644
--- a/servers/visual/shader_language.cpp
+++ b/servers/visual/shader_language.cpp
@@ -1897,62 +1897,6 @@ bool ShaderLanguage::_validate_function_call(BlockNode *p_block, OperatorNode *p
return false;
}
-#if 0
- if (found_builtin) {
-
- if (p_func->op==OP_CONSTRUCT && all_const) {
-
-
- Vector<float> cdata;
- for(int i=0;i<argcount;i++) {
-
- Variant v = static_cast<ConstantNode*>(p_func->arguments[i+1])->value;
- switch(v.get_type()) {
-
- case Variant::REAL: cdata.push_back(v); break;
- case Variant::INT: cdata.push_back(v); break;
- case Variant::VECTOR2: { Vector2 v2=v; cdata.push_back(v2.x); cdata.push_back(v2.y); } break;
- case Variant::VECTOR3: { Vector3 v3=v; cdata.push_back(v3.x); cdata.push_back(v3.y); cdata.push_back(v3.z);} break;
- case Variant::PLANE: { Plane v4=v; cdata.push_back(v4.normal.x); cdata.push_back(v4.normal.y); cdata.push_back(v4.normal.z); cdata.push_back(v4.d); } break;
- default: ERR_FAIL_V(NULL);
-
- }
-
- }
-
- ConstantNode *cn = parser.create_node<ConstantNode>(p_func->parent);
- Variant data;
- switch(p_func->return_cache) {
- case TYPE_FLOAT: data = cdata[0]; break;
- case TYPE_VEC2:
- if (cdata.size()==1)
- data = Vector2(cdata[0],cdata[0]);
- else
- data = Vector2(cdata[0],cdata[1]);
-
- break;
- case TYPE_VEC3:
- if (cdata.size()==1)
- data = Vector3(cdata[0],cdata[0],cdata[0]);
- else
- data = Vector3(cdata[0],cdata[1],cdata[2]);
- break;
- case TYPE_VEC4:
- if (cdata.size()==1)
- data = Plane(cdata[0],cdata[0],cdata[0],cdata[0]);
- else
- data = Plane(cdata[0],cdata[1],cdata[2],cdata[3]);
- break;
- }
-
- cn->datatype=p_func->return_cache;
- cn->value=data;
- return cn;
-
- }
- return p_func;
- }
-#endif
// try existing functions..
StringName exclude_function;
@@ -3426,7 +3370,7 @@ Error ShaderLanguage::_parse_block(BlockNode *p_block, const Map<StringName, Bui
}
BlockNode *block = alloc_node<BlockNode>();
- block->parent_block = p_block;
+ block->parent_block = init_block;
cf->blocks.push_back(block);
p_block->statements.push_back(cf);
diff --git a/servers/visual/visual_server_canvas.cpp b/servers/visual/visual_server_canvas.cpp
index 0fed9cc961..532546c5fa 100644
--- a/servers/visual/visual_server_canvas.cpp
+++ b/servers/visual/visual_server_canvas.cpp
@@ -499,7 +499,6 @@ void VisualServerCanvas::canvas_item_add_multiline(RID p_item, const Vector<Poin
pline->antialiased = false; //todo
pline->multiline = true;
- // if (p_width <= 1) {
pline->lines = p_points;
pline->line_colors = p_colors;
if (pline->line_colors.size() == 0) {
@@ -507,66 +506,7 @@ void VisualServerCanvas::canvas_item_add_multiline(RID p_item, const Vector<Poin
} else if (pline->line_colors.size() > 1 && pline->line_colors.size() != pline->lines.size()) {
pline->line_colors.resize(1);
}
-#if 0
-//width not yet
- } else {
- //make a trianglestrip for drawing the line...
- Vector2 prev_t;
- pline->triangles.resize(p_points.size() * 2);
- if (p_antialiased) {
- pline->lines.resize(p_points.size() * 2);
- }
- if (p_colors.size() == 0) {
- pline->triangle_colors.push_back(Color(1, 1, 1, 1));
- if (p_antialiased) {
- pline->line_colors.push_back(Color(1, 1, 1, 1));
- }
- }
- if (p_colors.size() == 1) {
- pline->triangle_colors = p_colors;
- pline->line_colors = p_colors;
- } else {
- pline->triangle_colors.resize(pline->triangles.size());
- pline->line_colors.resize(pline->lines.size());
- }
-
- for (int i = 0; i < p_points.size(); i++) {
-
- Vector2 t;
- if (i == p_points.size() - 1) {
- t = prev_t;
- } else {
- t = (p_points[i + 1] - p_points[i]).normalized().tangent();
- if (i == 0) {
- prev_t = t;
- }
- }
-
- Vector2 tangent = ((t + prev_t).normalized()) * p_width * 0.5;
-
- if (p_antialiased) {
- pline->lines[i] = p_points[i] + tangent;
- pline->lines[p_points.size() * 2 - i - 1] = p_points[i] - tangent;
- if (pline->line_colors.size() > 1) {
- pline->line_colors[i] = p_colors[i];
- pline->line_colors[p_points.size() * 2 - i - 1] = p_colors[i];
- }
- }
-
- pline->triangles[i * 2 + 0] = p_points[i] + tangent;
- pline->triangles[i * 2 + 1] = p_points[i] - tangent;
-
- if (pline->triangle_colors.size() > 1) {
-
- pline->triangle_colors[i * 2 + 0] = p_colors[i];
- pline->triangle_colors[i * 2 + 1] = p_colors[i];
- }
-
- prev_t = t;
- }
- }
-#endif
canvas_item->rect_dirty = true;
canvas_item->commands.push_back(pline);
}
diff --git a/servers/visual/visual_server_scene.h b/servers/visual/visual_server_scene.h
index 4b0c4af09d..689e06de93 100644
--- a/servers/visual/visual_server_scene.h
+++ b/servers/visual/visual_server_scene.h
@@ -69,34 +69,6 @@ public:
Portal() { enabled=true; disable_distance=50; disable_color=Color(); connect_range=0.8; }
};
-
- struct BakedLight {
-
- Rasterizer::BakedLightData data;
- PoolVector<int> sampler;
- AABB octree_aabb;
- Size2i octree_tex_size;
- Size2i light_tex_size;
-
- };
-
- struct BakedLightSampler {
-
- float params[BAKED_LIGHT_SAMPLER_MAX];
- int resolution;
- Vector<Vector3> dp_cache;
-
- BakedLightSampler() {
- params[BAKED_LIGHT_SAMPLER_STRENGTH]=1.0;
- params[BAKED_LIGHT_SAMPLER_ATTENUATION]=1.0;
- params[BAKED_LIGHT_SAMPLER_RADIUS]=1.0;
- params[BAKED_LIGHT_SAMPLER_DETAIL_RATIO]=0.1;
- resolution=16;
- }
- };
-
- void _update_baked_light_sampler_dp_cache(BakedLightSampler * blsamp);
-
#endif
/* CAMERA API */