diff options
-rw-r--r-- | core/extension/gdextension_interface.cpp | 12 | ||||
-rw-r--r-- | core/extension/gdextension_interface.h | 12 | ||||
-rw-r--r-- | doc/classes/AudioStreamPlayer2D.xml | 6 | ||||
-rw-r--r-- | doc/classes/AudioStreamPlayer3D.xml | 20 | ||||
-rw-r--r-- | doc/classes/EditorExportPlugin.xml | 8 | ||||
-rw-r--r-- | doc/classes/Generic6DOFJoint3D.xml | 6 | ||||
-rw-r--r-- | doc/classes/PhysicsServer2D.xml | 8 | ||||
-rw-r--r-- | doc/classes/PhysicsServer3D.xml | 10 | ||||
-rw-r--r-- | doc/classes/SkeletonModification2DJiggle.xml | 4 | ||||
-rw-r--r-- | drivers/gles3/rasterizer_canvas_gles3.cpp | 2 | ||||
-rw-r--r-- | drivers/vulkan/vulkan_context.cpp | 12 | ||||
-rw-r--r-- | editor/export/editor_export_plugin.cpp | 1 | ||||
-rw-r--r-- | modules/gltf/gltf_document.cpp | 368 | ||||
-rw-r--r-- | modules/gltf/gltf_document.h | 3 | ||||
-rw-r--r-- | modules/mono/editor/GodotTools/GodotTools/Export/ExportPlugin.cs | 16 |
15 files changed, 334 insertions, 154 deletions
diff --git a/core/extension/gdextension_interface.cpp b/core/extension/gdextension_interface.cpp index b02a9ee368..8f606f7948 100644 --- a/core/extension/gdextension_interface.cpp +++ b/core/extension/gdextension_interface.cpp @@ -54,22 +54,22 @@ static void gdextension_free(void *p_mem) { } // Helper print functions. -static void gdextension_print_error(const char *p_description, const char *p_function, const char *p_file, int32_t p_line, bool p_editor_notify) { +static void gdextension_print_error(const char *p_description, const char *p_function, const char *p_file, int32_t p_line, GDExtensionBool p_editor_notify) { _err_print_error(p_function, p_file, p_line, p_description, p_editor_notify, ERR_HANDLER_ERROR); } -static void gdextension_print_error_with_message(const char *p_description, const char *p_message, const char *p_function, const char *p_file, int32_t p_line, bool p_editor_notify) { +static void gdextension_print_error_with_message(const char *p_description, const char *p_message, const char *p_function, const char *p_file, int32_t p_line, GDExtensionBool p_editor_notify) { _err_print_error(p_function, p_file, p_line, p_description, p_message, p_editor_notify, ERR_HANDLER_ERROR); } -static void gdextension_print_warning(const char *p_description, const char *p_function, const char *p_file, int32_t p_line, bool p_editor_notify) { +static void gdextension_print_warning(const char *p_description, const char *p_function, const char *p_file, int32_t p_line, GDExtensionBool p_editor_notify) { _err_print_error(p_function, p_file, p_line, p_description, p_editor_notify, ERR_HANDLER_WARNING); } -static void gdextension_print_warning_with_message(const char *p_description, const char *p_message, const char *p_function, const char *p_file, int32_t p_line, bool p_editor_notify) { +static void gdextension_print_warning_with_message(const char *p_description, const char *p_message, const char *p_function, const char *p_file, int32_t p_line, GDExtensionBool p_editor_notify) { _err_print_error(p_function, p_file, p_line, p_description, p_message, p_editor_notify, ERR_HANDLER_WARNING); } -static void gdextension_print_script_error(const char *p_description, const char *p_function, const char *p_file, int32_t p_line, bool p_editor_notify) { +static void gdextension_print_script_error(const char *p_description, const char *p_function, const char *p_file, int32_t p_line, GDExtensionBool p_editor_notify) { _err_print_error(p_function, p_file, p_line, p_description, p_editor_notify, ERR_HANDLER_SCRIPT); } -static void gdextension_print_script_error_with_message(const char *p_description, const char *p_message, const char *p_function, const char *p_file, int32_t p_line, bool p_editor_notify) { +static void gdextension_print_script_error_with_message(const char *p_description, const char *p_message, const char *p_function, const char *p_file, int32_t p_line, GDExtensionBool p_editor_notify) { _err_print_error(p_function, p_file, p_line, p_description, p_message, p_editor_notify, ERR_HANDLER_SCRIPT); } diff --git a/core/extension/gdextension_interface.h b/core/extension/gdextension_interface.h index d561d0ecbd..3865b152bd 100644 --- a/core/extension/gdextension_interface.h +++ b/core/extension/gdextension_interface.h @@ -414,12 +414,12 @@ typedef struct { void *(*mem_realloc)(void *p_ptr, size_t p_bytes); void (*mem_free)(void *p_ptr); - void (*print_error)(const char *p_description, const char *p_function, const char *p_file, int32_t p_line, bool p_editor_notify); - void (*print_error_with_message)(const char *p_description, const char *p_message, const char *p_function, const char *p_file, int32_t p_line, bool p_editor_notify); - void (*print_warning)(const char *p_description, const char *p_function, const char *p_file, int32_t p_line, bool p_editor_notify); - void (*print_warning_with_message)(const char *p_description, const char *p_message, const char *p_function, const char *p_file, int32_t p_line, bool p_editor_notify); - void (*print_script_error)(const char *p_description, const char *p_function, const char *p_file, int32_t p_line, bool p_editor_notify); - void (*print_script_error_with_message)(const char *p_description, const char *p_message, const char *p_function, const char *p_file, int32_t p_line, bool p_editor_notify); + void (*print_error)(const char *p_description, const char *p_function, const char *p_file, int32_t p_line, GDExtensionBool p_editor_notify); + void (*print_error_with_message)(const char *p_description, const char *p_message, const char *p_function, const char *p_file, int32_t p_line, GDExtensionBool p_editor_notify); + void (*print_warning)(const char *p_description, const char *p_function, const char *p_file, int32_t p_line, GDExtensionBool p_editor_notify); + void (*print_warning_with_message)(const char *p_description, const char *p_message, const char *p_function, const char *p_file, int32_t p_line, GDExtensionBool p_editor_notify); + void (*print_script_error)(const char *p_description, const char *p_function, const char *p_file, int32_t p_line, GDExtensionBool p_editor_notify); + void (*print_script_error_with_message)(const char *p_description, const char *p_message, const char *p_function, const char *p_file, int32_t p_line, GDExtensionBool p_editor_notify); uint64_t (*get_native_struct_size)(GDExtensionConstStringNamePtr p_name); diff --git a/doc/classes/AudioStreamPlayer2D.xml b/doc/classes/AudioStreamPlayer2D.xml index 18869e87cb..b01a267154 100644 --- a/doc/classes/AudioStreamPlayer2D.xml +++ b/doc/classes/AudioStreamPlayer2D.xml @@ -4,7 +4,7 @@ Plays positional sound in 2D space. </brief_description> <description> - Plays audio that dampens with distance from a given position. + Plays audio that is attenuated with distance to the listener. By default, audio is heard from the screen center. This can be changed by adding an [AudioListener2D] node to the scene and enabling it by calling [method AudioListener2D.make_current] on it. See also [AudioStreamPlayer] to play a sound non-positionally. [b]Note:[/b] Hiding an [AudioStreamPlayer2D] node does not disable its audio output. To temporarily disable an [AudioStreamPlayer2D]'s audio output, set [member volume_db] to a very low value like [code]-100[/code] (which isn't audible to human hearing). @@ -57,7 +57,7 @@ Determines which [Area2D] layers affect the sound for reverb and audio bus effects. Areas can be used to redirect [AudioStream]s so that they play in a certain audio bus. An example of how you might use this is making a "water" area so that sounds played in the water are redirected through an audio bus to make them sound like they are being played underwater. </member> <member name="attenuation" type="float" setter="set_attenuation" getter="get_attenuation" default="1.0"> - Dampens audio over distance with this as an exponent. + The volume is attenuated over distance with this as an exponent. </member> <member name="autoplay" type="bool" setter="set_autoplay" getter="is_autoplay_enabled" default="false"> If [code]true[/code], audio plays when added to scene tree. @@ -88,7 +88,7 @@ If [code]true[/code], the playback is paused. You can resume it by setting [code]stream_paused[/code] to [code]false[/code]. </member> <member name="volume_db" type="float" setter="set_volume_db" getter="get_volume_db" default="0.0"> - Base volume without dampening. + Base volume before attenuation. </member> </members> <signals> diff --git a/doc/classes/AudioStreamPlayer3D.xml b/doc/classes/AudioStreamPlayer3D.xml index d5a06dcad6..bfb5b6f154 100644 --- a/doc/classes/AudioStreamPlayer3D.xml +++ b/doc/classes/AudioStreamPlayer3D.xml @@ -4,7 +4,7 @@ Plays positional sound in 3D space. </brief_description> <description> - Plays a sound effect with directed sound effects, dampens with distance if needed, generates effect of hearable position in space. For greater realism, a low-pass filter is automatically applied to distant sounds. This can be disabled by setting [member attenuation_filter_cutoff_hz] to [code]20500[/code]. + Plays audio with positional sound effects, based on the relative position of the audio listener. Positional effects include distance attenuation, directionality, and the Doppler effect. For greater realism, a low-pass filter is applied to distant sounds. This can be disabled by setting [member attenuation_filter_cutoff_hz] to [code]20500[/code]. By default, audio is heard from the camera position. This can be changed by adding an [AudioListener3D] node to the scene and enabling it by calling [method AudioListener3D.make_current] on it. See also [AudioStreamPlayer] to play a sound non-positionally. [b]Note:[/b] Hiding an [AudioStreamPlayer3D] node does not disable its audio output. To temporarily disable an [AudioStreamPlayer3D]'s audio output, set [member volume_db] to a very low value like [code]-100[/code] (which isn't audible to human hearing). @@ -57,7 +57,7 @@ Determines which [Area3D] layers affect the sound for reverb and audio bus effects. Areas can be used to redirect [AudioStream]s so that they play in a certain audio bus. An example of how you might use this is making a "water" area so that sounds played in the water are redirected through an audio bus to make them sound like they are being played underwater. </member> <member name="attenuation_filter_cutoff_hz" type="float" setter="set_attenuation_filter_cutoff_hz" getter="get_attenuation_filter_cutoff_hz" default="5000.0"> - Dampens audio using a low-pass filter above this frequency, in Hz. To disable the dampening effect entirely, set this to [code]20500[/code] as this frequency is above the human hearing limit. + The cutoff frequency of the attenuation low-pass filter, in Hz. A sound above this frequency is attenuated more than a sound below this frequency. To disable this effect, set this to [code]20500[/code] as this frequency is above the human hearing limit. </member> <member name="attenuation_filter_db" type="float" setter="set_attenuation_filter_db" getter="get_attenuation_filter_db" default="-24.0"> Amount how much the filter affects the loudness, in decibels. @@ -76,13 +76,13 @@ Decides in which step the Doppler effect should be calculated. </member> <member name="emission_angle_degrees" type="float" setter="set_emission_angle" getter="get_emission_angle" default="45.0"> - The angle in which the audio reaches cameras undampened. + The angle in which the audio reaches a listener unattenuated. </member> <member name="emission_angle_enabled" type="bool" setter="set_emission_angle_enabled" getter="is_emission_angle_enabled" default="false"> - If [code]true[/code], the audio should be dampened according to the direction of the sound. + If [code]true[/code], the audio should be attenuated according to the direction of the sound. </member> <member name="emission_angle_filter_attenuation_db" type="float" setter="set_emission_angle_filter_attenuation_db" getter="get_emission_angle_filter_attenuation_db" default="-12.0"> - Dampens audio if camera is outside of [member emission_angle_degrees] and [member emission_angle_enabled] is set by this factor, in decibels. + Attenuation factor used if listener is outside of [member emission_angle_degrees] and [member emission_angle_enabled] is set, in decibels. </member> <member name="max_db" type="float" setter="set_max_db" getter="get_max_db" default="3.0"> Sets the absolute maximum of the soundlevel, in decibels. @@ -112,7 +112,7 @@ The factor for the attenuation effect. Higher values make the sound audible over a larger distance. </member> <member name="volume_db" type="float" setter="set_volume_db" getter="get_volume_db" default="0.0"> - The base sound level unaffected by dampening, in decibels. + The base sound level before attenuation, in decibels. </member> </members> <signals> @@ -124,16 +124,16 @@ </signals> <constants> <constant name="ATTENUATION_INVERSE_DISTANCE" value="0" enum="AttenuationModel"> - Linear dampening of loudness according to distance. + Attenuation of loudness according to linear distance. </constant> <constant name="ATTENUATION_INVERSE_SQUARE_DISTANCE" value="1" enum="AttenuationModel"> - Squared dampening of loudness according to distance. + Attenuation of loudness according to squared distance. </constant> <constant name="ATTENUATION_LOGARITHMIC" value="2" enum="AttenuationModel"> - Logarithmic dampening of loudness according to distance. + Attenuation of loudness according to logarithmic distance. </constant> <constant name="ATTENUATION_DISABLED" value="3" enum="AttenuationModel"> - No dampening of loudness according to distance. The sound will still be heard positionally, unlike an [AudioStreamPlayer]. [constant ATTENUATION_DISABLED] can be combined with a [member max_distance] value greater than [code]0.0[/code] to achieve linear attenuation clamped to a sphere of a defined size. + No attenuation of loudness according to distance. The sound will still be heard positionally, unlike an [AudioStreamPlayer]. [constant ATTENUATION_DISABLED] can be combined with a [member max_distance] value greater than [code]0.0[/code] to achieve linear attenuation clamped to a sphere of a defined size. </constant> <constant name="DOPPLER_TRACKING_DISABLED" value="0" enum="DopplerTracking"> Disables doppler tracking. diff --git a/doc/classes/EditorExportPlugin.xml b/doc/classes/EditorExportPlugin.xml index 3e8ce10aa5..fd76e8ddaa 100644 --- a/doc/classes/EditorExportPlugin.xml +++ b/doc/classes/EditorExportPlugin.xml @@ -87,6 +87,14 @@ Return a hash based on the configuration passed (for both scenes and resources). This helps keep separate caches for separate export configurations. </description> </method> + <method name="_get_export_features" qualifiers="virtual const"> + <return type="PackedStringArray" /> + <param index="0" name="platform" type="EditorExportPlatform" /> + <param index="1" name="debug" type="bool" /> + <description> + Return a [PackedStringArray] of additional features this preset, for the given [param platform], should have. + </description> + </method> <method name="_get_name" qualifiers="virtual const"> <return type="String" /> <description> diff --git a/doc/classes/Generic6DOFJoint3D.xml b/doc/classes/Generic6DOFJoint3D.xml index e6058b1bf9..b8151bdc5a 100644 --- a/doc/classes/Generic6DOFJoint3D.xml +++ b/doc/classes/Generic6DOFJoint3D.xml @@ -115,7 +115,7 @@ The minimum rotation in positive direction to break loose and rotate around the X axis. </member> <member name="angular_limit_y/damping" type="float" setter="set_param_y" getter="get_param_y" default="1.0"> - The amount of rotational damping across the Y axis. The lower, the more dampening occurs. + The amount of rotational damping across the Y axis. The lower, the more damping occurs. </member> <member name="angular_limit_y/enabled" type="bool" setter="set_flag_y" getter="get_flag_y" default="true"> If [code]true[/code], rotation across the Y axis is limited. @@ -139,7 +139,7 @@ The minimum rotation in positive direction to break loose and rotate around the Y axis. </member> <member name="angular_limit_z/damping" type="float" setter="set_param_z" getter="get_param_z" default="1.0"> - The amount of rotational damping across the Z axis. The lower, the more dampening occurs. + The amount of rotational damping across the Z axis. The lower, the more damping occurs. </member> <member name="angular_limit_z/enabled" type="bool" setter="set_flag_z" getter="get_flag_z" default="true"> If [code]true[/code], rotation across the Z axis is limited. @@ -357,7 +357,7 @@ The speed of all rotations across the axes. </constant> <constant name="PARAM_ANGULAR_DAMPING" value="13" enum="Param"> - The amount of rotational damping across the axes. The lower, the more dampening occurs. + The amount of rotational damping across the axes. The lower, the more damping occurs. </constant> <constant name="PARAM_ANGULAR_RESTITUTION" value="14" enum="Param"> The amount of rotational restitution across the axes. The lower, the more restitution occurs. diff --git a/doc/classes/PhysicsServer2D.xml b/doc/classes/PhysicsServer2D.xml index 93e88347d4..c3387cf6bd 100644 --- a/doc/classes/PhysicsServer2D.xml +++ b/doc/classes/PhysicsServer2D.xml @@ -1049,16 +1049,16 @@ Constant to set/get a body's gravity multiplier. </constant> <constant name="BODY_PARAM_LINEAR_DAMP_MODE" value="6" enum="BodyParameter"> - Constant to set/get a body's linear dampening mode. See [enum BodyDampMode] for possible values. + Constant to set/get a body's linear damping mode. See [enum BodyDampMode] for possible values. </constant> <constant name="BODY_PARAM_ANGULAR_DAMP_MODE" value="7" enum="BodyParameter"> - Constant to set/get a body's angular dampening mode. See [enum BodyDampMode] for possible values. + Constant to set/get a body's angular damping mode. See [enum BodyDampMode] for possible values. </constant> <constant name="BODY_PARAM_LINEAR_DAMP" value="8" enum="BodyParameter"> - Constant to set/get a body's linear dampening factor. + Constant to set/get a body's linear damping factor. </constant> <constant name="BODY_PARAM_ANGULAR_DAMP" value="9" enum="BodyParameter"> - Constant to set/get a body's angular dampening factor. + Constant to set/get a body's angular damping factor. </constant> <constant name="BODY_PARAM_MAX" value="10" enum="BodyParameter"> Represents the size of the [enum BodyParameter] enum. diff --git a/doc/classes/PhysicsServer3D.xml b/doc/classes/PhysicsServer3D.xml index 5b261d8414..82464d2f99 100644 --- a/doc/classes/PhysicsServer3D.xml +++ b/doc/classes/PhysicsServer3D.xml @@ -1241,7 +1241,7 @@ A factor that gets multiplied onto all rotations across the axes. </constant> <constant name="G6DOF_JOINT_ANGULAR_DAMPING" value="13" enum="G6DOFJointAxisParam"> - The amount of rotational damping across the axes. The lower, the more dampening occurs. + The amount of rotational damping across the axes. The lower, the more damping occurs. </constant> <constant name="G6DOF_JOINT_ANGULAR_RESTITUTION" value="14" enum="G6DOFJointAxisParam"> The amount of rotational restitution across the axes. The lower, the more restitution occurs. @@ -1392,16 +1392,16 @@ Constant to set/get a body's gravity multiplier. </constant> <constant name="BODY_PARAM_LINEAR_DAMP_MODE" value="6" enum="BodyParameter"> - Constant to set/get a body's linear dampening mode. See [enum BodyDampMode] for possible values. + Constant to set/get a body's linear damping mode. See [enum BodyDampMode] for possible values. </constant> <constant name="BODY_PARAM_ANGULAR_DAMP_MODE" value="7" enum="BodyParameter"> - Constant to set/get a body's angular dampening mode. See [enum BodyDampMode] for possible values. + Constant to set/get a body's angular damping mode. See [enum BodyDampMode] for possible values. </constant> <constant name="BODY_PARAM_LINEAR_DAMP" value="8" enum="BodyParameter"> - Constant to set/get a body's linear dampening factor. + Constant to set/get a body's linear damping factor. </constant> <constant name="BODY_PARAM_ANGULAR_DAMP" value="9" enum="BodyParameter"> - Constant to set/get a body's angular dampening factor. + Constant to set/get a body's angular damping factor. </constant> <constant name="BODY_PARAM_MAX" value="10" enum="BodyParameter"> Represents the size of the [enum BodyParameter] enum. diff --git a/doc/classes/SkeletonModification2DJiggle.xml b/doc/classes/SkeletonModification2DJiggle.xml index 3321fffe1b..12f3b9b901 100644 --- a/doc/classes/SkeletonModification2DJiggle.xml +++ b/doc/classes/SkeletonModification2DJiggle.xml @@ -107,7 +107,7 @@ <param index="0" name="joint_idx" type="int" /> <param index="1" name="damping" type="float" /> <description> - Sets the amount of dampening of the Jiggle joint at [param joint_idx]. + Sets the amount of damping of the Jiggle joint at [param joint_idx]. </description> </method> <method name="set_jiggle_joint_gravity"> @@ -160,7 +160,7 @@ </methods> <members> <member name="damping" type="float" setter="set_damping" getter="get_damping" default="0.75"> - The default amount of dampening applied to the Jiggle joints, if they are not overridden. Higher values lead to more of the calculated velocity being applied. + The default amount of damping applied to the Jiggle joints, if they are not overridden. Higher values lead to more of the calculated velocity being applied. </member> <member name="gravity" type="Vector2" setter="set_gravity" getter="get_gravity" default="Vector2(0, 6)"> The default amount of gravity applied to the Jiggle joints, if they are not overridden. diff --git a/drivers/gles3/rasterizer_canvas_gles3.cpp b/drivers/gles3/rasterizer_canvas_gles3.cpp index 7f67651e62..0e217f699e 100644 --- a/drivers/gles3/rasterizer_canvas_gles3.cpp +++ b/drivers/gles3/rasterizer_canvas_gles3.cpp @@ -1142,6 +1142,8 @@ void RasterizerCanvasGLES3::_record_item_commands(const Item *p_item, RID p_rend RID particles = pt->particles; state.canvas_instance_batches[state.current_batch_index].tex = pt->texture; state.canvas_instance_batches[state.current_batch_index].shader_variant = CanvasShaderGLES3::MODE_INSTANCED; + state.instance_data_array[r_index].flags |= FLAGS_INSTANCING_HAS_COLORS; + state.instance_data_array[r_index].flags |= FLAGS_INSTANCING_HAS_CUSTOM_DATA; if (particles_storage->particles_has_collision(particles) && texture_storage->render_target_is_sdf_enabled(p_render_target)) { // Pass collision information. diff --git a/drivers/vulkan/vulkan_context.cpp b/drivers/vulkan/vulkan_context.cpp index 864ad5931a..179de8227a 100644 --- a/drivers/vulkan/vulkan_context.cpp +++ b/drivers/vulkan/vulkan_context.cpp @@ -2271,7 +2271,7 @@ Error VulkanContext::prepare_buffers() { print_verbose("Vulkan: Early suboptimal swapchain."); break; } else if (err != VK_SUCCESS) { - ERR_BREAK_MSG(err != VK_SUCCESS, "Vulkan: Did not create swapchain successfully."); + ERR_BREAK_MSG(err != VK_SUCCESS, "Vulkan: Did not create swapchain successfully. Error code: " + String(string_VkResult(err))); } else { w->semaphore_acquired = true; } @@ -2348,7 +2348,7 @@ Error VulkanContext::swap_buffers() { submit_info.signalSemaphoreCount = 1; submit_info.pSignalSemaphores = &draw_complete_semaphores[frame_index]; err = vkQueueSubmit(graphics_queue, 1, &submit_info, fences[frame_index]); - ERR_FAIL_COND_V(err, ERR_CANT_CREATE); + ERR_FAIL_COND_V_MSG(err, ERR_CANT_CREATE, "Vulkan: Cannot submit graphics queue. Error code: " + String(string_VkResult(err))); command_buffer_queue.write[0] = nullptr; command_buffer_count = 1; @@ -2379,7 +2379,7 @@ Error VulkanContext::swap_buffers() { submit_info.signalSemaphoreCount = 1; submit_info.pSignalSemaphores = &image_ownership_semaphores[frame_index]; err = vkQueueSubmit(present_queue, 1, &submit_info, nullFence); - ERR_FAIL_COND_V(err, ERR_CANT_CREATE); + ERR_FAIL_COND_V_MSG(err, ERR_CANT_CREATE, "Vulkan: Cannot submit present queue. Error code: " + String(string_VkResult(err))); } // If we are using separate queues, we have to wait for image ownership, @@ -2488,14 +2488,14 @@ Error VulkanContext::swap_buffers() { if (err == VK_ERROR_OUT_OF_DATE_KHR) { // Swapchain is out of date (e.g. the window was resized) and // must be recreated. - print_verbose("Vulkan: Swapchain is out of date, recreating."); + print_verbose("Vulkan queue submit: Swapchain is out of date, recreating."); resize_notify(); } else if (err == VK_SUBOPTIMAL_KHR) { // Swapchain is not as optimal as it could be, but the platform's // presentation engine will still present the image correctly. - print_verbose("Vulkan: Swapchain is suboptimal."); + print_verbose("Vulkan queue submit: Swapchain is suboptimal."); } else { - ERR_FAIL_COND_V(err, ERR_CANT_CREATE); + ERR_FAIL_COND_V_MSG(err, ERR_CANT_CREATE, "Error code: " + String(string_VkResult(err))); } buffers_prepared = false; diff --git a/editor/export/editor_export_plugin.cpp b/editor/export/editor_export_plugin.cpp index 0add55820f..5887befcd8 100644 --- a/editor/export/editor_export_plugin.cpp +++ b/editor/export/editor_export_plugin.cpp @@ -229,6 +229,7 @@ void EditorExportPlugin::_bind_methods() { GDVIRTUAL_BIND(_end_customize_scenes); GDVIRTUAL_BIND(_end_customize_resources); + GDVIRTUAL_BIND(_get_export_features, "platform", "debug"); GDVIRTUAL_BIND(_get_name); } diff --git a/modules/gltf/gltf_document.cpp b/modules/gltf/gltf_document.cpp index bd3ee1881f..028028a103 100644 --- a/modules/gltf/gltf_document.cpp +++ b/modules/gltf/gltf_document.cpp @@ -4894,13 +4894,11 @@ Error GLTFDocument::_serialize_animations(Ref<GLTFState> p_state) { return OK; } for (int32_t player_i = 0; player_i < p_state->animation_players.size(); player_i++) { - List<StringName> animation_names; AnimationPlayer *animation_player = p_state->animation_players[player_i]; - animation_player->get_animation_list(&animation_names); - if (animation_names.size()) { - for (int animation_name_i = 0; animation_name_i < animation_names.size(); animation_name_i++) { - _convert_animation(p_state, animation_player, animation_names[animation_name_i]); - } + List<StringName> animations; + animation_player->get_animation_list(&animations); + for (StringName animation_name : animations) { + _convert_animation(p_state, animation_player, animation_name); } } Array animations; @@ -6028,7 +6026,7 @@ void GLTFDocument::_import_animation(Ref<GLTFState> p_state, AnimationPlayer *p_ Node *root = p_animation_player->get_parent(); ERR_FAIL_COND(root == nullptr); HashMap<GLTFNodeIndex, Node *>::Iterator node_element = p_state->scene_nodes.find(node_index); - ERR_CONTINUE_MSG(!node_element, vformat("Unable to find node %d for animation", node_index)); + ERR_CONTINUE_MSG(!node_element, vformat("Unable to find node %d for animation.", node_index)); node_path = root->get_path_to(node_element->value); HashMap<GLTFNodeIndex, ImporterMeshInstance3D *>::Iterator mesh_instance_element = p_state->scene_mesh_instances.find(node_index); if (mesh_instance_element) { @@ -6450,58 +6448,179 @@ GLTFAnimation::Track GLTFDocument::_convert_animation_track(Ref<GLTFState> p_sta for (int32_t key_i = 0; key_i < key_count; key_i++) { times.write[key_i] = p_animation->track_get_key_time(p_track_i, key_i); } + double anim_end = p_animation->get_length(); if (track_type == Animation::TYPE_SCALE_3D) { - p_track.scale_track.times = times; - p_track.scale_track.interpolation = gltf_interpolation; - p_track.scale_track.values.resize(key_count); - for (int32_t key_i = 0; key_i < key_count; key_i++) { - Vector3 scale; - Error err = p_animation->scale_track_get_key(p_track_i, key_i, &scale); - ERR_CONTINUE(err != OK); - p_track.scale_track.values.write[key_i] = scale; + if (gltf_interpolation == GLTFAnimation::INTERP_CUBIC_SPLINE) { + gltf_interpolation = GLTFAnimation::INTERP_LINEAR; + p_track.scale_track.times.clear(); + p_track.scale_track.values.clear(); + // CATMULLROMSPLINE or CUBIC_SPLINE have to be baked, apologies. + const double increment = 1.0 / BAKE_FPS; + double time = 0.0; + bool last = false; + while (true) { + Vector3 scale; + Error err = p_animation->scale_track_interpolate(p_track_i, time, &scale); + ERR_CONTINUE(err != OK); + p_track.scale_track.values.push_back(scale); + p_track.scale_track.times.push_back(time); + if (last) { + break; + } + time += increment; + if (time >= anim_end) { + last = true; + time = anim_end; + } + } + } else { + p_track.scale_track.times = times; + p_track.scale_track.interpolation = gltf_interpolation; + p_track.scale_track.values.resize(key_count); + for (int32_t key_i = 0; key_i < key_count; key_i++) { + Vector3 scale; + Error err = p_animation->scale_track_get_key(p_track_i, key_i, &scale); + ERR_CONTINUE(err != OK); + p_track.scale_track.values.write[key_i] = scale; + } } } else if (track_type == Animation::TYPE_POSITION_3D) { - p_track.position_track.times = times; - p_track.position_track.values.resize(key_count); - p_track.position_track.interpolation = gltf_interpolation; - for (int32_t key_i = 0; key_i < key_count; key_i++) { - Vector3 position; - Error err = p_animation->position_track_get_key(p_track_i, key_i, &position); - ERR_CONTINUE(err != OK); - p_track.position_track.values.write[key_i] = position; + if (gltf_interpolation == GLTFAnimation::INTERP_CUBIC_SPLINE) { + gltf_interpolation = GLTFAnimation::INTERP_LINEAR; + p_track.position_track.times.clear(); + p_track.position_track.values.clear(); + // CATMULLROMSPLINE or CUBIC_SPLINE have to be baked, apologies. + const double increment = 1.0 / BAKE_FPS; + double time = 0.0; + bool last = false; + while (true) { + Vector3 scale; + Error err = p_animation->position_track_interpolate(p_track_i, time, &scale); + ERR_CONTINUE(err != OK); + p_track.position_track.values.push_back(scale); + p_track.position_track.times.push_back(time); + if (last) { + break; + } + time += increment; + if (time >= anim_end) { + last = true; + time = anim_end; + } + } + } else { + p_track.position_track.times = times; + p_track.position_track.values.resize(key_count); + p_track.position_track.interpolation = gltf_interpolation; + for (int32_t key_i = 0; key_i < key_count; key_i++) { + Vector3 position; + Error err = p_animation->position_track_get_key(p_track_i, key_i, &position); + ERR_CONTINUE(err != OK); + p_track.position_track.values.write[key_i] = position; + } } } else if (track_type == Animation::TYPE_ROTATION_3D) { - p_track.rotation_track.times = times; - p_track.rotation_track.interpolation = gltf_interpolation; - p_track.rotation_track.values.resize(key_count); - for (int32_t key_i = 0; key_i < key_count; key_i++) { - Quaternion rotation; - Error err = p_animation->rotation_track_get_key(p_track_i, key_i, &rotation); - ERR_CONTINUE(err != OK); - p_track.rotation_track.values.write[key_i] = rotation; + if (gltf_interpolation == GLTFAnimation::INTERP_CUBIC_SPLINE) { + gltf_interpolation = GLTFAnimation::INTERP_LINEAR; + p_track.rotation_track.times.clear(); + p_track.rotation_track.values.clear(); + // CATMULLROMSPLINE or CUBIC_SPLINE have to be baked, apologies. + const double increment = 1.0 / BAKE_FPS; + double time = 0.0; + bool last = false; + while (true) { + Quaternion rotation; + Error err = p_animation->rotation_track_interpolate(p_track_i, time, &rotation); + ERR_CONTINUE(err != OK); + p_track.rotation_track.values.push_back(rotation); + p_track.rotation_track.times.push_back(time); + if (last) { + break; + } + time += increment; + if (time >= anim_end) { + last = true; + time = anim_end; + } + } + } else { + p_track.rotation_track.times = times; + p_track.rotation_track.values.resize(key_count); + p_track.rotation_track.interpolation = gltf_interpolation; + for (int32_t key_i = 0; key_i < key_count; key_i++) { + Quaternion rotation; + Error err = p_animation->rotation_track_get_key(p_track_i, key_i, &rotation); + ERR_CONTINUE(err != OK); + p_track.rotation_track.values.write[key_i] = rotation; + } } } else if (track_type == Animation::TYPE_VALUE) { if (path.contains(":position")) { - p_track.position_track.times = times; p_track.position_track.interpolation = gltf_interpolation; - + p_track.position_track.times = times; p_track.position_track.values.resize(key_count); - p_track.position_track.interpolation = gltf_interpolation; - for (int32_t key_i = 0; key_i < key_count; key_i++) { - Vector3 position = p_animation->track_get_key_value(p_track_i, key_i); - p_track.position_track.values.write[key_i] = position; + if (gltf_interpolation == GLTFAnimation::INTERP_CUBIC_SPLINE) { + gltf_interpolation = GLTFAnimation::INTERP_LINEAR; + p_track.position_track.times.clear(); + p_track.position_track.values.clear(); + // CATMULLROMSPLINE or CUBIC_SPLINE have to be baked, apologies. + const double increment = 1.0 / BAKE_FPS; + double time = 0.0; + bool last = false; + while (true) { + Vector3 position; + Error err = p_animation->position_track_interpolate(p_track_i, time, &position); + ERR_CONTINUE(err != OK); + p_track.position_track.values.push_back(position); + p_track.position_track.times.push_back(time); + if (last) { + break; + } + time += increment; + if (time >= anim_end) { + last = true; + time = anim_end; + } + } + } else { + for (int32_t key_i = 0; key_i < key_count; key_i++) { + Vector3 position = p_animation->track_get_key_value(p_track_i, key_i); + p_track.position_track.values.write[key_i] = position; + } } } else if (path.contains(":rotation")) { - p_track.rotation_track.times = times; p_track.rotation_track.interpolation = gltf_interpolation; - + p_track.rotation_track.times = times; p_track.rotation_track.values.resize(key_count); - p_track.rotation_track.interpolation = gltf_interpolation; - - for (int32_t key_i = 0; key_i < key_count; key_i++) { - Vector3 rotation_radian = p_animation->track_get_key_value(p_track_i, key_i); - p_track.rotation_track.values.write[key_i] = Quaternion::from_euler(rotation_radian); + if (gltf_interpolation == GLTFAnimation::INTERP_CUBIC_SPLINE) { + gltf_interpolation = GLTFAnimation::INTERP_LINEAR; + p_track.rotation_track.times.clear(); + p_track.rotation_track.values.clear(); + // CATMULLROMSPLINE or CUBIC_SPLINE have to be baked, apologies. + const double increment = 1.0 / BAKE_FPS; + double time = 0.0; + bool last = false; + while (true) { + Quaternion rotation; + Error err = p_animation->rotation_track_interpolate(p_track_i, time, &rotation); + ERR_CONTINUE(err != OK); + p_track.rotation_track.values.push_back(rotation); + p_track.rotation_track.times.push_back(time); + if (last) { + break; + } + time += increment; + if (time >= anim_end) { + last = true; + time = anim_end; + } + } + } else { + for (int32_t key_i = 0; key_i < key_count; key_i++) { + Vector3 rotation_radian = p_animation->track_get_key_value(p_track_i, key_i); + p_track.rotation_track.values.write[key_i] = Quaternion::from_euler(rotation_radian); + } } } else if (path.contains(":scale")) { p_track.scale_track.times = times; @@ -6510,68 +6629,115 @@ GLTFAnimation::Track GLTFDocument::_convert_animation_track(Ref<GLTFState> p_sta p_track.scale_track.values.resize(key_count); p_track.scale_track.interpolation = gltf_interpolation; - for (int32_t key_i = 0; key_i < key_count; key_i++) { - Vector3 scale_track = p_animation->track_get_key_value(p_track_i, key_i); - p_track.scale_track.values.write[key_i] = scale_track; + if (gltf_interpolation == GLTFAnimation::INTERP_CUBIC_SPLINE) { + gltf_interpolation = GLTFAnimation::INTERP_LINEAR; + p_track.scale_track.times.clear(); + p_track.scale_track.values.clear(); + // CATMULLROMSPLINE or CUBIC_SPLINE have to be baked, apologies. + const double increment = 1.0 / BAKE_FPS; + double time = 0.0; + bool last = false; + while (true) { + Vector3 scale; + Error err = p_animation->scale_track_interpolate(p_track_i, time, &scale); + ERR_CONTINUE(err != OK); + p_track.scale_track.values.push_back(scale); + p_track.scale_track.times.push_back(time); + if (last) { + break; + } + time += increment; + if (time >= anim_end) { + last = true; + time = anim_end; + } + } + } else { + for (int32_t key_i = 0; key_i < key_count; key_i++) { + Vector3 scale_track = p_animation->track_get_key_value(p_track_i, key_i); + p_track.scale_track.values.write[key_i] = scale_track; + } } } } else if (track_type == Animation::TYPE_BEZIER) { - if (path.contains("/scale")) { - const int32_t keys = p_animation->track_get_key_time(p_track_i, key_count - 1) * BAKE_FPS; + const int32_t keys = anim_end * BAKE_FPS; + if (path.contains(":scale")) { if (!p_track.scale_track.times.size()) { + p_track.scale_track.interpolation = gltf_interpolation; Vector<real_t> new_times; new_times.resize(keys); for (int32_t key_i = 0; key_i < keys; key_i++) { new_times.write[key_i] = key_i / BAKE_FPS; } p_track.scale_track.times = new_times; - p_track.scale_track.interpolation = gltf_interpolation; p_track.scale_track.values.resize(keys); for (int32_t key_i = 0; key_i < keys; key_i++) { p_track.scale_track.values.write[key_i] = Vector3(1.0f, 1.0f, 1.0f); } - p_track.scale_track.interpolation = gltf_interpolation; - } - for (int32_t key_i = 0; key_i < keys; key_i++) { - Vector3 bezier_track = p_track.scale_track.values[key_i]; - if (path.contains("/scale:x")) { - bezier_track.x = p_animation->bezier_track_interpolate(p_track_i, key_i / BAKE_FPS); - } else if (path.contains("/scale:y")) { - bezier_track.y = p_animation->bezier_track_interpolate(p_track_i, key_i / BAKE_FPS); - } else if (path.contains("/scale:z")) { - bezier_track.z = p_animation->bezier_track_interpolate(p_track_i, key_i / BAKE_FPS); + for (int32_t key_i = 0; key_i < keys; key_i++) { + Vector3 bezier_track = p_track.scale_track.values[key_i]; + if (path.contains(":scale:x")) { + bezier_track.x = p_animation->bezier_track_interpolate(p_track_i, key_i / BAKE_FPS); + } else if (path.contains(":scale:y")) { + bezier_track.y = p_animation->bezier_track_interpolate(p_track_i, key_i / BAKE_FPS); + } else if (path.contains(":scale:z")) { + bezier_track.z = p_animation->bezier_track_interpolate(p_track_i, key_i / BAKE_FPS); + } + p_track.scale_track.values.write[key_i] = bezier_track; } - p_track.scale_track.values.write[key_i] = bezier_track; } - } else if (path.contains("/position")) { - const int32_t keys = p_animation->track_get_key_time(p_track_i, key_count - 1) * BAKE_FPS; + } else if (path.contains(":position")) { if (!p_track.position_track.times.size()) { + p_track.position_track.interpolation = gltf_interpolation; Vector<real_t> new_times; new_times.resize(keys); for (int32_t key_i = 0; key_i < keys; key_i++) { new_times.write[key_i] = key_i / BAKE_FPS; } p_track.position_track.times = new_times; - p_track.position_track.interpolation = gltf_interpolation; p_track.position_track.values.resize(keys); - p_track.position_track.interpolation = gltf_interpolation; } for (int32_t key_i = 0; key_i < keys; key_i++) { Vector3 bezier_track = p_track.position_track.values[key_i]; - if (path.contains("/position:x")) { + if (path.contains(":position:x")) { bezier_track.x = p_animation->bezier_track_interpolate(p_track_i, key_i / BAKE_FPS); - } else if (path.contains("/position:y")) { + } else if (path.contains(":position:y")) { bezier_track.y = p_animation->bezier_track_interpolate(p_track_i, key_i / BAKE_FPS); - } else if (path.contains("/position:z")) { + } else if (path.contains(":position:z")) { bezier_track.z = p_animation->bezier_track_interpolate(p_track_i, key_i / BAKE_FPS); } p_track.position_track.values.write[key_i] = bezier_track; } + } else if (path.contains(":rotation")) { + if (!p_track.rotation_track.times.size()) { + p_track.rotation_track.interpolation = gltf_interpolation; + Vector<real_t> new_times; + new_times.resize(keys); + for (int32_t key_i = 0; key_i < keys; key_i++) { + new_times.write[key_i] = key_i / BAKE_FPS; + } + p_track.rotation_track.times = new_times; + + p_track.rotation_track.values.resize(keys); + } + for (int32_t key_i = 0; key_i < keys; key_i++) { + Quaternion bezier_track = p_track.rotation_track.values[key_i]; + if (path.contains(":rotation:x")) { + bezier_track.x = p_animation->bezier_track_interpolate(p_track_i, key_i / BAKE_FPS); + } else if (path.contains(":rotation:y")) { + bezier_track.y = p_animation->bezier_track_interpolate(p_track_i, key_i / BAKE_FPS); + } else if (path.contains(":rotation:z")) { + bezier_track.z = p_animation->bezier_track_interpolate(p_track_i, key_i / BAKE_FPS); + } else if (path.contains(":rotation:w")) { + bezier_track.w = p_animation->bezier_track_interpolate(p_track_i, key_i / BAKE_FPS); + } + p_track.rotation_track.values.write[key_i] = bezier_track; + } } } return p_track; @@ -6582,16 +6748,18 @@ void GLTFDocument::_convert_animation(Ref<GLTFState> p_state, AnimationPlayer *p Ref<GLTFAnimation> gltf_animation; gltf_animation.instantiate(); gltf_animation->set_name(_gen_unique_name(p_state, p_animation_track_name)); - for (int32_t track_i = 0; track_i < animation->get_track_count(); track_i++) { if (!animation->track_is_enabled(track_i)) { continue; } - String orig_track_path = animation->track_get_path(track_i); - if (String(orig_track_path).contains(":position")) { - const Vector<String> node_suffix = String(orig_track_path).split(":position"); + String final_track_path = animation->track_get_path(track_i); + Node *animation_base_node = p_animation_player->get_parent(); + ERR_CONTINUE_MSG(!animation_base_node, "Cannot get the parent of the animation player."); + if (String(final_track_path).contains(":position")) { + const Vector<String> node_suffix = String(final_track_path).split(":position"); const NodePath path = node_suffix[0]; - const Node *node = p_animation_player->get_parent()->get_node_or_null(path); + const Node *node = animation_base_node->get_node_or_null(path); + ERR_CONTINUE_MSG(!node, "Cannot get the node from a position path."); for (const KeyValue<GLTFNodeIndex, Node *> &position_scene_node_i : p_state->scene_nodes) { if (position_scene_node_i.value == node) { GLTFNodeIndex node_index = position_scene_node_i.key; @@ -6604,10 +6772,11 @@ void GLTFDocument::_convert_animation(Ref<GLTFState> p_state, AnimationPlayer *p gltf_animation->get_tracks().insert(node_index, track); } } - } else if (String(orig_track_path).contains(":rotation_degrees")) { - const Vector<String> node_suffix = String(orig_track_path).split(":rotation_degrees"); + } else if (String(final_track_path).contains(":rotation_degrees")) { + const Vector<String> node_suffix = String(final_track_path).split(":rotation_degrees"); const NodePath path = node_suffix[0]; - const Node *node = p_animation_player->get_parent()->get_node_or_null(path); + const Node *node = animation_base_node->get_node_or_null(path); + ERR_CONTINUE_MSG(!node, "Cannot get the node from a rotation degrees path."); for (const KeyValue<GLTFNodeIndex, Node *> &rotation_degree_scene_node_i : p_state->scene_nodes) { if (rotation_degree_scene_node_i.value == node) { GLTFNodeIndex node_index = rotation_degree_scene_node_i.key; @@ -6620,10 +6789,11 @@ void GLTFDocument::_convert_animation(Ref<GLTFState> p_state, AnimationPlayer *p gltf_animation->get_tracks().insert(node_index, track); } } - } else if (String(orig_track_path).contains(":scale")) { - const Vector<String> node_suffix = String(orig_track_path).split(":scale"); + } else if (String(final_track_path).contains(":scale")) { + const Vector<String> node_suffix = String(final_track_path).split(":scale"); const NodePath path = node_suffix[0]; - const Node *node = p_animation_player->get_parent()->get_node_or_null(path); + const Node *node = animation_base_node->get_node_or_null(path); + ERR_CONTINUE_MSG(!node, "Cannot get the node from a scale path."); for (const KeyValue<GLTFNodeIndex, Node *> &scale_scene_node_i : p_state->scene_nodes) { if (scale_scene_node_i.value == node) { GLTFNodeIndex node_index = scale_scene_node_i.key; @@ -6636,10 +6806,11 @@ void GLTFDocument::_convert_animation(Ref<GLTFState> p_state, AnimationPlayer *p gltf_animation->get_tracks().insert(node_index, track); } } - } else if (String(orig_track_path).contains(":transform")) { - const Vector<String> node_suffix = String(orig_track_path).split(":transform"); + } else if (String(final_track_path).contains(":transform")) { + const Vector<String> node_suffix = String(final_track_path).split(":transform"); const NodePath path = node_suffix[0]; - const Node *node = p_animation_player->get_parent()->get_node_or_null(path); + const Node *node = animation_base_node->get_node_or_null(path); + ERR_CONTINUE_MSG(!node, "Cannot get the node from a transform path."); for (const KeyValue<GLTFNodeIndex, Node *> &transform_track_i : p_state->scene_nodes) { if (transform_track_i.value == node) { GLTFAnimation::Track track; @@ -6647,12 +6818,16 @@ void GLTFDocument::_convert_animation(Ref<GLTFState> p_state, AnimationPlayer *p gltf_animation->get_tracks().insert(transform_track_i.key, track); } } - } else if (String(orig_track_path).contains(":") && animation->track_get_type(track_i) == Animation::TYPE_BLEND_SHAPE) { - const Vector<String> node_suffix = String(orig_track_path).split(":"); + } else if (String(final_track_path).contains(":") && animation->track_get_type(track_i) == Animation::TYPE_BLEND_SHAPE) { + const Vector<String> node_suffix = String(final_track_path).split(":"); const NodePath path = node_suffix[0]; const String suffix = node_suffix[1]; - Node *node = p_animation_player->get_parent()->get_node_or_null(path); + Node *node = animation_base_node->get_node_or_null(path); + ERR_CONTINUE_MSG(!node, "Cannot get the node from a blend shape path."); MeshInstance3D *mi = cast_to<MeshInstance3D>(node); + if (!mi) { + continue; + } Ref<Mesh> mesh = mi->get_mesh(); ERR_CONTINUE(mesh.is_null()); int32_t mesh_index = -1; @@ -6703,14 +6878,20 @@ void GLTFDocument::_convert_animation(Ref<GLTFState> p_state, AnimationPlayer *p } tracks[mesh_index] = track; } - } else if (String(orig_track_path).contains(":")) { + } else if (String(final_track_path).contains(":")) { //Process skeleton - const Vector<String> node_suffix = String(orig_track_path).split(":"); + const Vector<String> node_suffix = String(final_track_path).split(":"); const String node = node_suffix[0]; const NodePath node_path = node; const String suffix = node_suffix[1]; - Node *godot_node = p_animation_player->get_parent()->get_node_or_null(node_path); - Skeleton3D *skeleton = nullptr; + Node *godot_node = animation_base_node->get_node_or_null(node_path); + if (!godot_node) { + continue; + } + Skeleton3D *skeleton = cast_to<Skeleton3D>(animation_base_node->get_node_or_null(node)); + if (!skeleton) { + continue; + } GLTFSkeletonIndex skeleton_gltf_i = -1; for (GLTFSkeletonIndex skeleton_i = 0; skeleton_i < p_state->skeletons.size(); skeleton_i++) { if (p_state->skeletons[skeleton_i]->godot_skeleton == cast_to<Skeleton3D>(godot_node)) { @@ -6719,7 +6900,7 @@ void GLTFDocument::_convert_animation(Ref<GLTFState> p_state, AnimationPlayer *p ERR_CONTINUE(!skeleton); Ref<GLTFSkeleton> skeleton_gltf = p_state->skeletons[skeleton_gltf_i]; int32_t bone = skeleton->find_bone(suffix); - ERR_CONTINUE(bone == -1); + ERR_CONTINUE_MSG(bone == -1, vformat("Cannot find the bone %s.", suffix)); if (!skeleton_gltf->godot_bone_node.has(bone)) { continue; } @@ -6733,9 +6914,10 @@ void GLTFDocument::_convert_animation(Ref<GLTFState> p_state, AnimationPlayer *p gltf_animation->get_tracks()[node_i] = track; } } - } else if (!String(orig_track_path).contains(":")) { - ERR_CONTINUE(!p_animation_player->get_parent()); - Node *godot_node = p_animation_player->get_parent()->get_node_or_null(orig_track_path); + } else if (!String(final_track_path).contains(":")) { + ERR_CONTINUE(!animation_base_node); + Node *godot_node = animation_base_node->get_node_or_null(final_track_path); + ERR_CONTINUE_MSG(!godot_node, vformat("Cannot get the node from a skeleton path %s.", final_track_path)); for (const KeyValue<GLTFNodeIndex, Node *> &scene_node_i : p_state->scene_nodes) { if (scene_node_i.value == godot_node) { GLTFNodeIndex node_i = scene_node_i.key; diff --git a/modules/gltf/gltf_document.h b/modules/gltf/gltf_document.h index b8b989bf89..ae19f67390 100644 --- a/modules/gltf/gltf_document.h +++ b/modules/gltf/gltf_document.h @@ -364,8 +364,7 @@ public: Ref<GLTFNode> p_gltf_node); GLTFMeshIndex _convert_mesh_to_gltf(Ref<GLTFState> p_state, MeshInstance3D *p_mesh_instance); - void _convert_animation(Ref<GLTFState> p_state, AnimationPlayer *p_animation_player, - String p_animation_track_name); + void _convert_animation(Ref<GLTFState> p_state, AnimationPlayer *p_animation_player, String p_animation_track_name); Error _serialize(Ref<GLTFState> p_state, const String &p_path); Error _parse(Ref<GLTFState> p_state, String p_path, Ref<FileAccess> p_file); }; diff --git a/modules/mono/editor/GodotTools/GodotTools/Export/ExportPlugin.cs b/modules/mono/editor/GodotTools/GodotTools/Export/ExportPlugin.cs index 70b48b0e3a..a284451a35 100644 --- a/modules/mono/editor/GodotTools/GodotTools/Export/ExportPlugin.cs +++ b/modules/mono/editor/GodotTools/GodotTools/Export/ExportPlugin.cs @@ -24,19 +24,7 @@ namespace GodotTools.Export public void RegisterExportSettings() { // TODO: These would be better as export preset options, but that doesn't seem to be supported yet - - GlobalDef("mono/export/include_scripts_content", false); - - GlobalDef("mono/export/aot/enabled", false); - GlobalDef("mono/export/aot/full_aot", false); - GlobalDef("mono/export/aot/use_interpreter", true); - - // --aot or --aot=opt1,opt2 (use 'mono --aot=help AuxAssembly.dll' to list AOT options) - GlobalDef("mono/export/aot/extra_aot_options", Array.Empty<string>()); - // --optimize/-O=opt1,opt2 (use 'mono --list-opt'' to list optimize options) - GlobalDef("mono/export/aot/extra_optimizer_options", Array.Empty<string>()); - - GlobalDef("mono/export/aot/android_toolchain_path", ""); + GlobalDef("dotnet/export/include_scripts_content", false); } private string _maybeLastExportError; @@ -56,7 +44,7 @@ namespace GodotTools.Export // TODO What if the source file is not part of the game's C# project - bool includeScriptsContent = (bool)ProjectSettings.GetSetting("mono/export/include_scripts_content"); + bool includeScriptsContent = (bool)ProjectSettings.GetSetting("dotnet/export/include_scripts_content"); if (!includeScriptsContent) { |