diff options
-rw-r--r-- | doc/classes/AnimationTreePlayer.xml | 35 | ||||
-rw-r--r-- | drivers/windows/file_access_windows.cpp | 39 | ||||
-rw-r--r-- | editor/editor_node.cpp | 4 | ||||
-rw-r--r-- | editor/editor_settings.cpp | 1 | ||||
-rw-r--r-- | modules/gdnative/gdnative/string.cpp | 6 | ||||
-rw-r--r-- | modules/mono/csharp_script.cpp | 6 | ||||
-rw-r--r-- | modules/mono/editor/monodevelop_instance.cpp | 2 | ||||
-rw-r--r-- | modules/mono/glue/cs_files/DebuggingUtils.cs | 6 | ||||
-rw-r--r-- | modules/mono/mono_gd/gd_mono_utils.cpp | 24 | ||||
-rw-r--r-- | modules/mono/mono_gd/gd_mono_utils.h | 8 | ||||
-rw-r--r-- | scene/3d/proximity_group.cpp | 2 | ||||
-rw-r--r-- | scene/animation/animation_player.cpp | 4 | ||||
-rw-r--r-- | scene/resources/material.cpp | 2 | ||||
-rw-r--r-- | servers/arvr_server.cpp | 8 |
14 files changed, 106 insertions, 41 deletions
diff --git a/doc/classes/AnimationTreePlayer.xml b/doc/classes/AnimationTreePlayer.xml index ecd1f81951..33224e92bd 100644 --- a/doc/classes/AnimationTreePlayer.xml +++ b/doc/classes/AnimationTreePlayer.xml @@ -1,10 +1,11 @@ <?xml version="1.0" encoding="UTF-8" ?> <class name="AnimationTreePlayer" inherits="Node" category="Core" version="3.0-beta"> <brief_description> - Animation Player that uses a node graph for the blending. + Animation Player that uses a node graph for blending Animations. </brief_description> <description> A node graph tool for blending multiple animations bound to an [AnimationPlayer]. Especially useful for animating characters or other skeleton-based rigs. It can combine several animations to form a desired pose. + It takes [Animation]s from an [AnimationPlayer] node and mixes them depending on the graph. </description> <tutorials> </tutorials> @@ -37,7 +38,7 @@ <argument index="0" name="id" type="String"> </argument> <description> - Returns the [AnimationPlayer]'s animation bound to the [code]AnimationTreePlayer[/code]'s animation node with name [code]id[/code]. + Returns the [AnimationPlayer]'s [Animation] bound to the [code]AnimationTreePlayer[/code]'s animation node with name [code]id[/code]. </description> </method> <method name="animation_node_get_master_animation" qualifiers="const"> @@ -46,7 +47,7 @@ <argument index="0" name="id" type="String"> </argument> <description> - Returns the name of the [member master_player]'s animation bound to this animation node. + Returns the name of the [member master_player]'s [Animation] bound to this animation node. </description> </method> <method name="animation_node_set_animation"> @@ -57,7 +58,7 @@ <argument index="1" name="animation" type="Animation"> </argument> <description> - Binds a new animation from the [member master_player] to the [code]AnimationTreePlayer[/code]'s animation node with name [code]id[/code]. + Binds a new [Animation] from the [member master_player] to the [code]AnimationTreePlayer[/code]'s animation node with name [code]id[/code]. </description> </method> <method name="animation_node_set_filter_path"> @@ -81,7 +82,7 @@ <argument index="1" name="source" type="String"> </argument> <description> - Binds the animation named [code]source[/code] from [member master_player] to the animation node [code]id[/code]. Recalculates caches. + Binds the [Animation] named [code]source[/code] from [member master_player] to the animation node [code]id[/code]. Recalculates caches. </description> </method> <method name="are_nodes_connected" qualifiers="const"> @@ -115,6 +116,10 @@ </argument> <description> Sets the blend amount of a Blend2 node given its name and value. + A Blend2 Node blends two animations with the amount between 0 and 1. + At 0, Output is input a. + Towards 1, the influence of a gets lessened, the influence of b gets raised. + At 1, Output is input b. </description> </method> <method name="blend2_node_set_filter_path"> @@ -148,6 +153,12 @@ </argument> <description> Sets the blend amount of a Blend3 node given its name and value. + A Blend3 Node blends three animations with the amount between -1 and 1. + At -1, Output is input b-. + From -1 to 0, the influence of b- gets lessened, the influence of a gets raised and the influence of b+ is 0. + At 0, Output is input a. + From 0 to 1, the influence of a gets lessened, the influence of b+ gets raised and the influence of b+ is 0. + At 1, Output is input b+. </description> </method> <method name="blend4_node_get_amount" qualifiers="const"> @@ -168,6 +179,8 @@ </argument> <description> Sets the blend amount of a Blend4 node given its name and value. + A Blend4 Node blends two pairs of animations. + The two pairs are blended like blend2 and then added together. </description> </method> <method name="connect_nodes"> @@ -198,7 +211,7 @@ <return type="PoolStringArray"> </return> <description> - Returns a PoolStringArray containing the name of all nodes. + Returns a [PoolStringArray] containing the name of all nodes. </description> </method> <method name="mix_node_get_amount" qualifiers="const"> @@ -219,6 +232,7 @@ </argument> <description> Sets mix amount of a Mix node given its name and value. + A Mix node adds input b to input a by a the amount given by ratio. </description> </method> <method name="node_exists" qualifiers="const"> @@ -450,7 +464,7 @@ <return type="void"> </return> <description> - Resets this AnimationTreePlayer. + Resets this [code]AnimationTreePlayer[/code]. </description> </method> <method name="timescale_node_get_scale" qualifiers="const"> @@ -471,6 +485,8 @@ </argument> <description> Sets the time scale of the TimeScale node with name [code]id[/code] to [code]scale[/code]. + The timescale node is used to speed [Animation]s up if the scale is above 1 or slow them down if it is below 1. + If applied after a blend or mix, affects all input animations to that blend or mix. </description> </method> <method name="timeseek_node_seek"> @@ -482,6 +498,7 @@ </argument> <description> Sets the time seek value of the TimeSeek node with name [code]id[/code] to [code]seconds[/code] + This functions as a seek in the [Animation] or the blend or mix of [Animation]s input in it. </description> </method> <method name="transition_node_delete_input"> @@ -510,7 +527,7 @@ <argument index="0" name="id" type="String"> </argument> <description> - Returns the number of inputs for the transition node with name [code]id[/code]. + Returns the number of inputs for the transition node with name [code]id[/code]. You can add inputs by rightclicking on the transition node. </description> </method> <method name="transition_node_get_xfade_time" qualifiers="const"> @@ -586,9 +603,11 @@ </member> <member name="base_path" type="NodePath" setter="set_base_path" getter="get_base_path"> The node from which to relatively access other nodes. Default value: [code]".."[/code]. + It accesses the Bones, so it should point to the same Node the AnimationPlayer would point its Root Node at. </member> <member name="master_player" type="NodePath" setter="set_master_player" getter="get_master_player"> The path to the [AnimationPlayer] from which this [code]AnimationTreePlayer[/code] binds animations to animation nodes. + Once set, Animation nodes can be added to the AnimationTreePlayer. </member> <member name="playback_process_mode" type="int" setter="set_animation_process_mode" getter="get_animation_process_mode" enum="AnimationTreePlayer.AnimationProcessMode"> The thread in which to update animations. Default value: [enum ANIMATION_PROCESS_IDLE]. diff --git a/drivers/windows/file_access_windows.cpp b/drivers/windows/file_access_windows.cpp index dbffac8ebd..832d75b17d 100644 --- a/drivers/windows/file_access_windows.cpp +++ b/drivers/windows/file_access_windows.cpp @@ -31,6 +31,7 @@ #ifdef WINDOWS_ENABLED #include "file_access_windows.h" +#include "os/os.h" #include "shlwapi.h" #include <windows.h> @@ -115,25 +116,35 @@ void FileAccessWindows::close() { //_wunlink(save_path.c_str()); //unlink if exists //int rename_error = _wrename((save_path+".tmp").c_str(),save_path.c_str()); - bool rename_error; + bool rename_error = true; + int attempts = 4; + while (rename_error && attempts) { + // This workaround of trying multiple times is added to deal with paranoid Windows + // antiviruses that love reading just written files even if they are not executable, thus + // locking the file and preventing renaming from happening. #ifdef UWP_ENABLED - // UWP has no PathFileExists, so we check attributes instead - DWORD fileAttr; + // UWP has no PathFileExists, so we check attributes instead + DWORD fileAttr; - fileAttr = GetFileAttributesW(save_path.c_str()); - if (INVALID_FILE_ATTRIBUTES == fileAttr) { + fileAttr = GetFileAttributesW(save_path.c_str()); + if (INVALID_FILE_ATTRIBUTES == fileAttr) { #else - if (!PathFileExistsW(save_path.c_str())) { + if (!PathFileExistsW(save_path.c_str())) { #endif - //creating new file - rename_error = _wrename((save_path + ".tmp").c_str(), save_path.c_str()) != 0; - } else { - //atomic replace for existing file - rename_error = !ReplaceFileW(save_path.c_str(), (save_path + ".tmp").c_str(), NULL, 2 | 4, NULL, NULL); - } - if (rename_error && close_fail_notify) { - close_fail_notify(save_path); + //creating new file + rename_error = _wrename((save_path + ".tmp").c_str(), save_path.c_str()) != 0; + } else { + //atomic replace for existing file + rename_error = !ReplaceFileW(save_path.c_str(), (save_path + ".tmp").c_str(), NULL, 2 | 4, NULL, NULL); + } + if (rename_error && close_fail_notify) { + close_fail_notify(save_path); + } + if (rename_error) { + attempts--; + OS::get_singleton()->delay_usec(1000000); //wait 100msec and try again + } } save_path = ""; diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp index 2b62faf218..621364d901 100644 --- a/editor/editor_node.cpp +++ b/editor/editor_node.cpp @@ -4749,13 +4749,13 @@ EditorNode::EditorNode() { scene_distraction = false; script_distraction = false; - FileAccess::set_backup_save(true); - TranslationServer::get_singleton()->set_enabled(false); // load settings if (!EditorSettings::get_singleton()) EditorSettings::create(); + FileAccess::set_backup_save(EDITOR_GET("filesystem/on_save/safe_save_on_backup_then_rename")); + { int dpi_mode = EditorSettings::get_singleton()->get("interface/editor/hidpi_mode"); if (dpi_mode == 0) { diff --git a/editor/editor_settings.cpp b/editor/editor_settings.cpp index 86000d7744..122034eaa3 100644 --- a/editor/editor_settings.cpp +++ b/editor/editor_settings.cpp @@ -513,6 +513,7 @@ void EditorSettings::_load_defaults(Ref<ConfigFile> p_extra_config) { _initial_set("filesystem/resources/auto_reload_modified_images", true); _initial_set("filesystem/import/automatic_reimport_on_sources_changed", true); + _initial_set("filesystem/on_save/safe_save_on_backup_then_rename", true); if (p_extra_config.is_valid()) { diff --git a/modules/gdnative/gdnative/string.cpp b/modules/gdnative/gdnative/string.cpp index 9ce2b1406d..7f5dbc12be 100644 --- a/modules/gdnative/gdnative/string.cpp +++ b/modules/gdnative/gdnative/string.cpp @@ -932,7 +932,7 @@ godot_char_string GDAPI godot_string_ascii(const godot_string *p_self) { const String *self = (const String *)p_self; godot_char_string result; - memnew_placement(&result, String(self->ascii())); + memnew_placement(&result, CharString(self->ascii())); return result; } @@ -942,7 +942,7 @@ godot_char_string GDAPI godot_string_ascii_extended(const godot_string *p_self) godot_char_string result; - memnew_placement(&result, String(self->ascii(true))); + memnew_placement(&result, CharString(self->ascii(true))); return result; } @@ -952,7 +952,7 @@ godot_char_string GDAPI godot_string_utf8(const godot_string *p_self) { godot_char_string result; - memnew_placement(&result, String(self->utf8())); + memnew_placement(&result, CharString(self->utf8())); return result; } diff --git a/modules/mono/csharp_script.cpp b/modules/mono/csharp_script.cpp index 8f8116e26e..7df2043a62 100644 --- a/modules/mono/csharp_script.cpp +++ b/modules/mono/csharp_script.cpp @@ -449,7 +449,7 @@ Vector<ScriptLanguage::StackInfo> CSharpLanguage::debug_get_current_stack_info() // Printing an error here will result in endless recursion, so we must be careful - if (!gdmono->is_runtime_initialized() && GDMono::get_singleton()->get_api_assembly()) + if (!gdmono->is_runtime_initialized() || !GDMono::get_singleton()->get_api_assembly() || !GDMonoUtils::mono_cache.corlib_cache_updated) return Vector<StackInfo>(); MonoObject *stack_trace = mono_object_new(mono_domain_get(), CACHED_CLASS(System_Diagnostics_StackTrace)->get_mono_ptr()); @@ -503,6 +503,10 @@ Vector<ScriptLanguage::StackInfo> CSharpLanguage::stack_trace_get_info(MonoObjec return Vector<StackInfo>(); } + // TODO + // what if the StackFrame method is null (method_decl is empty). should we skip this frame? + // can reproduce with a MissingMethodException on internal calls + sif.file = GDMonoMarshal::mono_string_to_godot(file_name); sif.line = file_line_num; sif.func = GDMonoMarshal::mono_string_to_godot(method_decl); diff --git a/modules/mono/editor/monodevelop_instance.cpp b/modules/mono/editor/monodevelop_instance.cpp index 0b0b36e1e3..48a285561d 100644 --- a/modules/mono/editor/monodevelop_instance.cpp +++ b/modules/mono/editor/monodevelop_instance.cpp @@ -35,6 +35,8 @@ void MonoDevelopInstance::execute(const Vector<String> &p_files) { + _GDMONO_SCOPE_DOMAIN_(TOOLS_DOMAIN) + ERR_FAIL_NULL(execute_method); ERR_FAIL_COND(gc_handle.is_null()); diff --git a/modules/mono/glue/cs_files/DebuggingUtils.cs b/modules/mono/glue/cs_files/DebuggingUtils.cs index ced78f658d..42ca57fbf9 100644 --- a/modules/mono/glue/cs_files/DebuggingUtils.cs +++ b/modules/mono/glue/cs_files/DebuggingUtils.cs @@ -26,6 +26,12 @@ namespace Godot MethodBase methodBase = frame.GetMethod(); + if (methodBase == null) + { + methodDecl = string.Empty; + return; + } + StringBuilder sb = new StringBuilder(); if (methodBase is MethodInfo methodInfo) diff --git a/modules/mono/mono_gd/gd_mono_utils.cpp b/modules/mono/mono_gd/gd_mono_utils.cpp index d02c73978e..835a4614c1 100644 --- a/modules/mono/mono_gd/gd_mono_utils.cpp +++ b/modules/mono/mono_gd/gd_mono_utils.cpp @@ -44,10 +44,13 @@ namespace GDMonoUtils { MonoCache mono_cache; -#define CACHE_AND_CHECK(m_var, m_val) \ - { \ - m_var = m_val; \ - if (!m_var) ERR_PRINT("Mono Cache: Member " #m_var " is null. This is really bad!"); \ +#define CACHE_AND_CHECK(m_var, m_val) \ + { \ + m_var = m_val; \ + if (!m_var) { \ + ERR_EXPLAIN("Mono Cache: Member " #m_var " is null"); \ + ERR_FAIL(); \ + } \ } #define CACHE_CLASS_AND_CHECK(m_class, m_val) CACHE_AND_CHECK(GDMonoUtils::mono_cache.class_##m_class, m_val) @@ -133,6 +136,12 @@ void MonoCache::clear_members() { task_scheduler_handle = Ref<MonoGCHandle>(); } +void MonoCache::cleanup() { + + corlib_cache_updated = false; + godot_api_cache_updated = false; +} + #define GODOT_API_CLASS(m_class) (GDMono::get_singleton()->get_api_assembly()->get_class(BINDINGS_NAMESPACE, #m_class)) void update_corlib_cache() { @@ -158,6 +167,8 @@ void update_corlib_cache() { CACHE_METHOD_AND_CHECK(System_Diagnostics_StackTrace, ctor_bool, CACHED_CLASS(System_Diagnostics_StackTrace)->get_method_with_desc("System.Diagnostics.StackTrace:.ctor(bool)", true)); CACHE_METHOD_AND_CHECK(System_Diagnostics_StackTrace, ctor_Exception_bool, CACHED_CLASS(System_Diagnostics_StackTrace)->get_method_with_desc("System.Diagnostics.StackTrace:.ctor(System.Exception,bool)", true)); #endif + + mono_cache.corlib_cache_updated = true; } void update_godot_api_cache() { @@ -231,6 +242,8 @@ void update_godot_api_cache() { MonoObject *task_scheduler = mono_object_new(SCRIPTS_DOMAIN, GODOT_API_CLASS(GodotTaskScheduler)->get_mono_ptr()); mono_runtime_object_init(task_scheduler); mono_cache.task_scheduler_handle = MonoGCHandle::create_strong(task_scheduler); + + mono_cache.corlib_cache_updated = true; } void clear_cache() { @@ -402,6 +415,9 @@ void print_unhandled_exception(MonoObject *p_exc) { void print_unhandled_exception(MonoObject *p_exc, bool p_recursion_caution) { mono_print_unhandled_exception(p_exc); #ifdef DEBUG_ENABLED + if (!ScriptDebugger::get_singleton()) + return; + GDMonoClass *st_klass = CACHED_CLASS(System_Diagnostics_StackTrace); MonoObject *stack_trace = mono_object_new(mono_domain_get(), st_klass->get_mono_ptr()); diff --git a/modules/mono/mono_gd/gd_mono_utils.h b/modules/mono/mono_gd/gd_mono_utils.h index 597397eced..2666433170 100644 --- a/modules/mono/mono_gd/gd_mono_utils.h +++ b/modules/mono/mono_gd/gd_mono_utils.h @@ -129,10 +129,16 @@ struct MonoCache { Ref<MonoGCHandle> task_scheduler_handle; + bool corlib_cache_updated; + bool godot_api_cache_updated; + void clear_members(); - void cleanup() {} + void cleanup(); MonoCache() { + corlib_cache_updated = false; + godot_api_cache_updated = false; + clear_members(); } }; diff --git a/scene/3d/proximity_group.cpp b/scene/3d/proximity_group.cpp index f584ed22eb..101d9ed70c 100644 --- a/scene/3d/proximity_group.cpp +++ b/scene/3d/proximity_group.cpp @@ -193,7 +193,7 @@ void ProximityGroup::_bind_methods() { ADD_PROPERTY(PropertyInfo(Variant::INT, "dispatch_mode", PROPERTY_HINT_ENUM, "Proxy,Signal"), "set_dispatch_mode", "get_dispatch_mode"); ADD_PROPERTY(PropertyInfo(Variant::VECTOR3, "grid_radius"), "set_grid_radius", "get_grid_radius"); - ADD_SIGNAL(MethodInfo("broadcast", PropertyInfo(Variant::STRING, "name"), PropertyInfo(Variant::ARRAY, "parameters"))); + ADD_SIGNAL(MethodInfo("broadcast", PropertyInfo(Variant::STRING, "group_name"), PropertyInfo(Variant::ARRAY, "parameters"))); BIND_ENUM_CONSTANT(MODE_PROXY); BIND_ENUM_CONSTANT(MODE_SIGNAL); diff --git a/scene/animation/animation_player.cpp b/scene/animation/animation_player.cpp index 0a051cdb9b..d1829ce4d4 100644 --- a/scene/animation/animation_player.cpp +++ b/scene/animation/animation_player.cpp @@ -1341,9 +1341,9 @@ void AnimationPlayer::_bind_methods() { ADD_PROPERTY(PropertyInfo(Variant::BOOL, "playback_active", PROPERTY_HINT_NONE, "", 0), "set_active", "is_active"); ADD_PROPERTY(PropertyInfo(Variant::REAL, "playback_speed", PROPERTY_HINT_RANGE, "-64,64,0.01"), "set_speed_scale", "get_speed_scale"); - ADD_SIGNAL(MethodInfo("animation_finished", PropertyInfo(Variant::STRING, "name"))); + ADD_SIGNAL(MethodInfo("animation_finished", PropertyInfo(Variant::STRING, "anim_name"))); ADD_SIGNAL(MethodInfo("animation_changed", PropertyInfo(Variant::STRING, "old_name"), PropertyInfo(Variant::STRING, "new_name"))); - ADD_SIGNAL(MethodInfo("animation_started", PropertyInfo(Variant::STRING, "name"))); + ADD_SIGNAL(MethodInfo("animation_started", PropertyInfo(Variant::STRING, "anim_name"))); BIND_ENUM_CONSTANT(ANIMATION_PROCESS_PHYSICS); BIND_ENUM_CONSTANT(ANIMATION_PROCESS_IDLE); diff --git a/scene/resources/material.cpp b/scene/resources/material.cpp index e7329f5183..8a1978cf85 100644 --- a/scene/resources/material.cpp +++ b/scene/resources/material.cpp @@ -178,7 +178,7 @@ void ShaderMaterial::_bind_methods() { ClassDB::bind_method(D_METHOD("set_shader_param", "param", "value"), &ShaderMaterial::set_shader_param); ClassDB::bind_method(D_METHOD("get_shader_param", "param"), &ShaderMaterial::get_shader_param); - ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "shader", PROPERTY_HINT_RESOURCE_TYPE, "Shader,ShaderGraph"), "set_shader", "get_shader"); + ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "shader", PROPERTY_HINT_RESOURCE_TYPE, "Shader"), "set_shader", "get_shader"); } void ShaderMaterial::get_argument_options(const StringName &p_function, int p_idx, List<String> *r_options) const { diff --git a/servers/arvr_server.cpp b/servers/arvr_server.cpp index 441a7581d1..1804d97555 100644 --- a/servers/arvr_server.cpp +++ b/servers/arvr_server.cpp @@ -67,11 +67,11 @@ void ARVRServer::_bind_methods() { BIND_ENUM_CONSTANT(RESET_BUT_KEEP_TILT); BIND_ENUM_CONSTANT(DONT_RESET_ROTATION); - ADD_SIGNAL(MethodInfo("interface_added", PropertyInfo(Variant::STRING, "name"))); - ADD_SIGNAL(MethodInfo("interface_removed", PropertyInfo(Variant::STRING, "name"))); + ADD_SIGNAL(MethodInfo("interface_added", PropertyInfo(Variant::STRING, "interface_name"))); + ADD_SIGNAL(MethodInfo("interface_removed", PropertyInfo(Variant::STRING, "interface_name"))); - ADD_SIGNAL(MethodInfo("tracker_added", PropertyInfo(Variant::STRING, "name"), PropertyInfo(Variant::INT, "type"), PropertyInfo(Variant::INT, "id"))); - ADD_SIGNAL(MethodInfo("tracker_removed", PropertyInfo(Variant::STRING, "name"), PropertyInfo(Variant::INT, "type"), PropertyInfo(Variant::INT, "id"))); + ADD_SIGNAL(MethodInfo("tracker_added", PropertyInfo(Variant::STRING, "tracker_name"), PropertyInfo(Variant::INT, "type"), PropertyInfo(Variant::INT, "id"))); + ADD_SIGNAL(MethodInfo("tracker_removed", PropertyInfo(Variant::STRING, "tracker_name"), PropertyInfo(Variant::INT, "type"), PropertyInfo(Variant::INT, "id"))); }; real_t ARVRServer::get_world_scale() const { |