From 133f1d9823bb77eb055d3d79a0a956b56f738a18 Mon Sep 17 00:00:00 2001 From: Joyless <65855333+Joy-less@users.noreply.github.com> Date: Tue, 9 Dec 2025 01:46:40 +0000 Subject: [PATCH 1/2] Add custom `editor_delay` export variable --- demo/addons/sprite_mesh/sprite_mesh_instance.gd | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/demo/addons/sprite_mesh/sprite_mesh_instance.gd b/demo/addons/sprite_mesh/sprite_mesh_instance.gd index 697e2ad..4473654 100644 --- a/demo/addons/sprite_mesh/sprite_mesh_instance.gd +++ b/demo/addons/sprite_mesh/sprite_mesh_instance.gd @@ -62,6 +62,8 @@ const GreedyAlgorithm = preload("./scripts/greedy_algorithm.gd") ## This property aims to fix this problem. When its value increases, the UV mapping would move ## inwards. Be careful, as it would also produce misalignment. @export_range(0, 1) var uv_correction := 0.0: set = set_uv_correction +## The number of seconds before the editor generates the sprite mesh. +@export var editor_delay := 1.0 @export_group("Generated SpriteMesh") ## The result of the algorithm. It would generate automatically in the editor, or after calling @@ -104,7 +106,7 @@ func _request_update() -> void: _pending_update = true if Engine.is_editor_hint(): - _seconds_left = 1 + _seconds_left = editor_delay func _generate_sprite_mesh() -> SpriteMesh: From 4c9ae6aefb51214bee71aed3962246cf5f38842b Mon Sep 17 00:00:00 2001 From: Joyless <65855333+Joy-less@users.noreply.github.com> Date: Mon, 15 Dec 2025 19:10:27 +0000 Subject: [PATCH 2/2] Add `editor_delay` to readme doc --- README.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/README.md b/README.md index 7ec132f..304fa8f 100644 --- a/README.md +++ b/README.md @@ -105,6 +105,7 @@ Array[ArrayMesh] get_meshes() | `Rect2` | [`region_rect`](#rect2-region_rect--rect20-0-0-0) | `Rect2(0, 0, 0, 0)` | | `Texture2D` | [`texture`](#texture2d-texture) | | | `float` | [`uv_correction`](#float-uv_correction--00) | `0.0` | +| `float` | [`editor_delay`](#float-editor_delay--10) | `1.0` | | `int` | [`vframes`](#int-vframes--1) | `1` | ### Methods @@ -288,6 +289,16 @@ void set_uv_correction(float uv_correction) float get_uv_correction() ``` +#### `float editor_delay = 1.0` + +The number of seconds before the editor generates the sprite mesh. + +```gdscript +void set_editor_delay(float editor_delay) + +float get_editor_delay() +``` + #### `int vframes = 1` The number of rows in the sprite sheet.