Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
c48f139
add option to export mesh as a GLB/GLTF file in the single resource e…
nikitalita Jun 23, 2026
f6ac740
add `gltf-mutex-all-document-extensions` to rebase
nikitalita Jun 23, 2026
88ab299
rebase on master @ f964fa714f5
nikitalita Jun 23, 2026
a99025a
fix custom_magic not being passed from `seek_offset_from_exe`
nikitalita Jun 23, 2026
197bb34
enforce type-safety on config value setting
nikitalita Jun 23, 2026
221c1f2
improve choosing preferred import path logic in import info
nikitalita Jun 23, 2026
853a314
GDRESettings: fix mapping path logic, fix uid cache conflict resoluti…
nikitalita Jun 23, 2026
806ae95
Don't init shaders if rendering server doesn't exist
nikitalita Jun 23, 2026
aa027c1
fix gdre_custom_pack_source documentation
nikitalita Jun 23, 2026
e23dcde
fix certain godot 0.99 resources not being detected as autoconverted
nikitalita Jul 2, 2026
8f087c1
Add ResourceFormatSaverXML::save_custom
nikitalita Jul 2, 2026
f4e3477
add ResourceFormatSaverCompatBinaryInstance::save_to_file
nikitalita Jul 2, 2026
5571dd8
binary compat: fix crash when writing old resource variants
nikitalita Jul 3, 2026
abaa2e9
Fix resource savers not working with ver_major == 0
nikitalita Jul 3, 2026
c50676f
fix TextureExporter::recreate_missing_variants failing on v2 and lower
nikitalita Jul 3, 2026
ee39bc2
make dummy path take in an optional buffer
nikitalita Jul 3, 2026
c506047
fix resource_to_string for `.optimized.` files
nikitalita Jul 3, 2026
a71218f
add ResourceCompatLoader::save_custom_to_file
nikitalita Jul 3, 2026
43db531
fix image converting for v2 imagetextures
nikitalita Jul 3, 2026
8428dbb
translation exporter: Add exporting to po
nikitalita Jul 3, 2026
7d37181
importinfo: fix setting autoconverted importer
nikitalita Jul 3, 2026
853d496
obdb: fix loading external resources
nikitalita Jul 3, 2026
6635c8b
fix non-empty dummy files not being extracted
nikitalita Jul 3, 2026
21d90cc
fix cli recovery not extracting dummy files
nikitalita Jul 3, 2026
8a8a884
Load resources from packed OBDB files from pre-1.x projects
nikitalita Jul 3, 2026
fe659e8
update rebase script
nikitalita Jul 3, 2026
a15fcfd
fix v3 format identifiers not having ASTC_8x8
nikitalita Jul 3, 2026
01640a1
add optional defaults to import info getters
nikitalita Jul 3, 2026
0885d7d
fix TextureExporter::get_extant_texture_path to work consistently for…
nikitalita Jul 3, 2026
258a61e
clean up unused header files
nikitalita Jul 3, 2026
ed93eaa
clean up unused variables
nikitalita Jul 3, 2026
da51c3a
fix macros.h usage
nikitalita Jul 3, 2026
13835d5
Fix hang when values aren't initialized
nikitalita Jul 3, 2026
7e1ddbb
fix mac CI
nikitalita Jul 3, 2026
2c7e243
Update to latest pck format version in new pck dialog
nikitalita Jul 4, 2026
2e376e5
fix issue with opening packs
nikitalita Jul 4, 2026
1be79aa
make PckCreator use gdre::get_recursive_dir_list_multithread for more…
nikitalita Jul 4, 2026
03c6987
fix export script on newer macos versions
nikitalita Jul 4, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 3 additions & 7 deletions .github/workflows/all_builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ env:
# TODO: change this back to godotengine/godot and target master when #109685 and #109475 are merged
GODOT_REPOSITORY: nikitalita/godot
# Change the README too
GODOT_MAIN_SYNC_REF: gdre-wb-df6235838b6
GODOT_MAIN_SYNC_REF: gdre-wb-f964fa714f5
SCONSFLAGS: verbose=yes warnings=all werror=no module_text_server_fb_enabled=yes minizip=yes deprecated=yes angle=yes accesskit=no
SCONSFLAGS_TEMPLATE: disable_path_overrides=no no_editor_splash=yes module_camera_enabled=no module_mobile_vr_enabled=no module_upnp_enabled=no module_websocket_enabled=no module_csg_enabled=yes module_gridmap_enabled=yes use_static_cpp=yes builtin_freetype=yes builtin_libpng=yes builtin_zlib=yes builtin_libwebp=yes builtin_libvorbis=yes builtin_libogg=yes disable_3d=no
SCONS_CACHE_MSVC_CONFIG: true
Expand Down Expand Up @@ -117,7 +117,7 @@ jobs:
bin: ./bin/godot.linuxbsd.editor.x86_64

- name: "🍎 macOS Editor"
os: "macos-latest"
os: "macos-26"
id: macos-editor
platform: macos
target: editor
Expand All @@ -127,7 +127,7 @@ jobs:
bin: ./bin/godot.macos.editor.arm64

- name: "🍎 macOS Template Release"
os: "macos-latest"
os: "macos-26"
id: macos-template
platform: macos
target: template_release
Expand Down Expand Up @@ -159,10 +159,6 @@ jobs:
run: |
cp -R modules/gdsdecomp/.github/actions/* .github/actions/

- name: Select Xcode 16
if: matrix.platform == 'macos'
run: sudo xcode-select -s /Applications/Xcode_16.2.app

- name: Restore Godot build cache
uses: ./.github/actions/godot-cache-restore
id: restore-cache
Expand Down
16 changes: 8 additions & 8 deletions .scripts/export.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ function Get-VersionInfo {
# Try to find git command
$git = Get-Command git -ErrorAction SilentlyContinue
$versionInfo = "unknown"

if ($null -eq $git) {
Write-Host "GDRE WARNING: cannot find git on path, unknown version will be saved in gdre_version.gen.h"
}
Expand All @@ -61,7 +61,7 @@ function Get-VersionInfo {
}
else {
$versionInfo = $versionInfo.Trim()

# git describe --exact-match --tags HEAD
$res = & git describe --exact-match --tags HEAD 2>$null
if ($LASTEXITCODE -ne 0 -or [string]::IsNullOrEmpty($res)) {
Expand All @@ -70,9 +70,9 @@ function Get-VersionInfo {
$buildNum = $splits[-2]
# everything but the last two elements
$newVersionInfo = ($splits[0..($splits.Length - 3)] -join '-')

$semverRegex = '^[vV]?(?<major>0|[1-9]\d*)\.(?<minor>0|[1-9]\d*)\.(?<patch>0|[1-9]\d*)(?:-(?<prerelease>(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+(?<buildmetadata>[0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$'

if ($newVersionInfo -match $semverRegex) {
$major = $Matches.major
$minor = $Matches.minor
Expand All @@ -97,7 +97,7 @@ function Get-VersionInfo {
$prereleaseTag = ""
$buildMetadata = ""
}

$devStuff = "dev.$buildNum+$buildInfo"
if ($prereleaseTag) {
$prereleaseNameParts = $prereleaseTag -split '\.'
Expand Down Expand Up @@ -138,7 +138,7 @@ function Get-VersionInfo {
if ($versionInfo.StartsWith("v")) {
$versionInfo = $versionInfo.Substring(1)
}

return $versionInfo
}

Expand Down Expand Up @@ -226,7 +226,7 @@ $platform = "linuxbsd"
if ($env:OS -eq "Windows_NT") {
$platform = "windows"
}
elseif ($PSVersionTable.Os.StartsWith("Darwin")) {
elseif ($PSVersionTable.Os.StartsWith("Darwin") -or $PSVersionTable.Os.StartsWith("macOS")) {
$platform = "macos"
}

Expand Down Expand Up @@ -335,7 +335,7 @@ if ($export_preset -eq "Android") {
$user_settings = Get-Content $user_settings_path
$user_settings = $user_settings -replace 'export/android/java_sdk_path = ".*"', "export/android/java_sdk_path = ""$java_home"""
$user_settings = $user_settings -replace 'export/android/android_sdk_path = ".*"', "export/android/android_sdk_path = ""$android_home"""
} else {
} else {
New-Item -ItemType File -Path $user_settings_path
$user_settings = "[gd_resource type=""EditorSettings"" format=3]
[resource]
Expand Down
6 changes: 3 additions & 3 deletions .scripts/rebase_godot.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@ BRANCHES_TO_MERGE=(
gltf-fix-skeleton-bone
gltf-fix-double-precision
gltf-fix-vertex-colors
ensure-bptc-textures
fix-v3-meshes
fix-clearcoat-gloss
fix-blend-export
gltf-mutex-all-document-extensions
gltf-node-weights
)

# set fail on error
Expand All @@ -61,7 +61,7 @@ else
sed_in_place() { sed -i "$@"; }
fi

# git push nikitalita $NEW_BRANCH_NAME --set-upstream
git push nikitalita $NEW_BRANCH_NAME --set-upstream

# change the branch name in .github/workflows/all_builds.yml and the README.md
sed_in_place "s/GODOT_MAIN_SYNC_REF: .*/GODOT_MAIN_SYNC_REF: $NEW_BRANCH_NAME/" "$GDRE_PATH/.github/workflows/all_builds.yml"
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ During SCons configure, the module auto-applies the patches under `modules/gdsde

### Requirements

[Our fork of godot](https://github.com/nikitalita/godot) @ branch `gdre-wb-df6235838b6`
[Our fork of godot](https://github.com/nikitalita/godot) @ branch `gdre-wb-f964fa714f5`

- Support for building on 3.x has been dropped and no new features are being pushed
- Godot RE Tools still retains the ability to decompile 3.x and 2.x projects, however.
Expand Down
6 changes: 0 additions & 6 deletions bytecode/bytecode_base.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@

#include "bytecode/bytecode_versions.h"
#include "bytecode/gdscript_tokenizer_compat.h"
#include "bytecode/gdscript_v1_tokenizer_compat.h"
#include "bytecode/gdscript_v2_tokenizer_buffer.h"
#include "compat/file_access_encrypted_v3.h"
#include "compat/variant_decoder_compat.h"
#include "compat/variant_writer_compat.h"
Expand All @@ -22,7 +20,6 @@
#include "core/io/file_access_encrypted.h"
#include "core/io/marshalls.h"
#include "core/object/class_db.h"
#include "core/variant/binder_common.h"

#define GDSDECOMP_FAIL_V_MSG(m_retval, m_msg) \
error_message = RTR(m_msg); \
Expand Down Expand Up @@ -668,18 +665,15 @@
auto handle_newline = [&](int i, GlobalToken curr_token) {
auto curr_line = tokens[i].end_line;
write_current_line(indent);
if (curr_line <= prev_line) {

Check warning on line 668 in bytecode/bytecode_base.cpp

View workflow job for this annotation

GitHub Actions / Windows Template Release

'<=': signed/unsigned mismatch

Check warning on line 668 in bytecode/bytecode_base.cpp

View workflow job for this annotation

GitHub Actions / Windows Editor

'<=': signed/unsigned mismatch
curr_line = prev_line + 1; // force new line
}
bool was_escaped = false;
while (curr_line > prev_line) {

Check warning on line 671 in bytecode/bytecode_base.cpp

View workflow job for this annotation

GitHub Actions / Windows Template Release

'>': signed/unsigned mismatch

Check warning on line 671 in bytecode/bytecode_base.cpp

View workflow job for this annotation

GitHub Actions / Windows Editor

'>': signed/unsigned mismatch
if (curr_token != G_TK_NEWLINE && bytecode_version < GDSCRIPT_2_0_VERSION) {
script_text += "\\"; // line continuation
was_escaped = true;
} else if (bytecode_version >= GDSCRIPT_2_0_VERSION && tokens[i].start_line != tokens[i].end_line) {
if (!first_line || (!gdre::remove_whitespace(line).is_empty())) {
script_text += "\\";
was_escaped = true;
}
}
script_text += "\n";
Expand All @@ -692,7 +686,7 @@

auto check_new_line = [&](int i) {
auto ln = tokens[i].start_line;
if (ln > prev_line && ln != 0) {

Check warning on line 689 in bytecode/bytecode_base.cpp

View workflow job for this annotation

GitHub Actions / Windows Template Release

'>': signed/unsigned mismatch

Check warning on line 689 in bytecode/bytecode_base.cpp

View workflow job for this annotation

GitHub Actions / Windows Editor

'>': signed/unsigned mismatch
return true;
}
ln = tokens[i].end_line;
Expand Down
16 changes: 16 additions & 0 deletions compat/config_file_compat.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,22 @@ Vector<String> ConfigFileCompat::get_section_keys(const String &p_section) const
return keys;
}

Vector<Pair<String, Variant>> ConfigFileCompat::get_section_keys_with_values_beginning_with(const String &p_section, const String &p_prefix) const {
Vector<Pair<String, Variant>> keys;
ERR_FAIL_COND_V_MSG(!values.has(p_section), keys, vformat("Cannot get keys from nonexistent section \"%s\".", p_section));

const HashMap<String, Variant> &keys_map = values[p_section];
keys.reserve(keys_map.size());

for (const KeyValue<String, Variant> &E : keys_map) {
if (E.key.begins_with(p_prefix)) {
keys.push_back({ E.key, E.value });
}
}

return keys;
}

void ConfigFileCompat::erase_section(const String &p_section) {
ERR_FAIL_COND_MSG(!values.has(p_section), vformat("Cannot erase nonexistent section \"%s\".", p_section));
values.erase(p_section);
Expand Down
1 change: 1 addition & 0 deletions compat/config_file_compat.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ class ConfigFileCompat : public RefCounted {

Vector<String> get_sections() const;
Vector<String> get_section_keys(const String &p_section) const;
Vector<Pair<String, Variant>> get_section_keys_with_values_beginning_with(const String &p_section, const String &p_key_prefix) const;

void erase_section(const String &p_section);
void erase_section_key(const String &p_section, const String &p_key);
Expand Down
4 changes: 3 additions & 1 deletion compat/image_enum_compat.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,8 @@ const char *v3_format_identifiers[V3Image::FORMAT_MAX] = {
"ETC2_RG11S",
"ETC2_RGB8",
"ETC2_RGBA8",
"ETC2_RGB8A1"
"ETC2_RGB8A1",
"ASTC_8x8",
};

const char *v3_format_names[V3Image::FORMAT_MAX] = {
Expand Down Expand Up @@ -131,6 +132,7 @@ const char *v3_format_names[V3Image::FORMAT_MAX] = {
"ETC2_RGB8",
"ETC2_RGBA8",
"ETC2_RGB8A1",
"ASTC_8x8",
};

const char *v4_format_identifiers[Image::FORMAT_MAX] = {
Expand Down
33 changes: 20 additions & 13 deletions compat/resource_compat_binary.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2117,21 +2117,20 @@ void ResourceFormatSaverCompatBinaryInstance::write_variant(Ref<FileAccess> f, c
} break;
case Variant::OBJECT: {
// This will only be triggered on godot 2.x, where the image variant is loaded as an image object vs. a resource
if (ver_format <= 1) {
Ref<Resource> resp = p_property;
if (resp->is_class("Image")) {
Ref<Resource> res = p_property;
if (ver_format <= 1 && res.is_valid()) {
if (res->is_class("Image")) {
f->store_32(VARIANT_IMAGE);
// storing lossless compressed by default
ImageParserV2::write_image_v2_to_bin(f, p_property, true);
break;
} else if (resp->is_class("InputEvent")) {
} else if (res->is_class("InputEvent")) {
// these should never be saved to binary; just store the type
f->store_32(VARIANT_INPUT_EVENT);
break;
}
}
f->store_32(VARIANT_OBJECT);
Ref<Resource> res = p_property;
if (res.is_null() || res->get_meta(SNAME("_skip_save_"), false)) {
f->store_32(OBJECT_EMPTY);
return; // Don't save it.
Expand Down Expand Up @@ -2437,15 +2436,11 @@ static String _resource_get_class(Ref<Resource> p_resource) {

/* this is really only appropriate for saving fake-loaded resources right now; don't use it to save anything else*/
Error ResourceFormatSaverCompatBinaryInstance::save(const String &p_path, const Ref<Resource> &p_resource, uint32_t p_flags) {
// Resource::seed_scene_unique_id(p_path.hash());
// get metadata from the resource

Error err;

path = get_local_path(p_path, p_resource);

set_save_settings(p_resource, p_flags);
ResourceUID::ID uid = res_uid;

Ref<FileAccess> f;
using_compression = using_compression || p_flags & ResourceSaver::FLAG_COMPRESS;
Expand All @@ -2464,6 +2459,21 @@ Error ResourceFormatSaverCompatBinaryInstance::save(const String &p_path, const
}

ERR_FAIL_COND_V_MSG(err != OK, err, "Cannot create file '" + p_path + "'.");
return save_to_file(f, p_path, p_resource, p_flags);
}

Error ResourceFormatSaverCompatBinaryInstance::save_to_file(const Ref<FileAccess> &p_f, const String &p_path, const Ref<Resource> &p_resource, uint32_t p_flags) {
path = get_local_path(p_path, p_resource);

set_save_settings(p_resource, p_flags);
return _save_to_file(p_f, p_path, p_resource, p_flags);
}

Error ResourceFormatSaverCompatBinaryInstance::_save_to_file(const Ref<FileAccess> &p_f, const String &p_path, const Ref<Resource> &p_resource, uint32_t p_flags) {
// Resource::seed_scene_unique_id(p_path.hash());

Ref<FileAccess> f = p_f;
ResourceUID::ID uid = res_uid;

if (using_real_t_double) {
f->real_is_double = true;
Expand Down Expand Up @@ -3525,9 +3535,6 @@ Error ResourceFormatSaverCompatBinaryInstance::set_save_settings(const Ref<Resou
ver_major = compat->ver_major;
ver_minor = compat->ver_minor;
}
if (ver_major == 0) {
WARN_PRINT("Resource has a major version of 0, this is not supported.");
}
String format = compat->resource_format;
script_class = compat->script_class;
using_script_class = compat->using_script_class();
Expand Down Expand Up @@ -3643,7 +3650,7 @@ int ResourceFormatSaverCompatBinary::get_ver_minor_from_format_version(int ver_f
}

Error ResourceFormatSaverCompatBinary::save_custom(const Ref<Resource> &p_resource, const String &p_path, int ver_format, int ver_major, int ver_minor, uint32_t p_flags) {
ERR_FAIL_COND_V_MSG(ver_format <= 0 || ver_major <= 0, ERR_INVALID_PARAMETER, "Invalid version info");
ERR_FAIL_COND_V_MSG(ver_format < 0 || ver_major < 0, ERR_INVALID_PARAMETER, "Invalid version info");

p_flags = CompatFormatLoader::set_version_info_in_flags(p_flags, ver_format, ver_major, ver_minor);
return ResourceFormatSaverCompatBinary::save(p_resource, p_path, p_flags);
Expand Down
3 changes: 3 additions & 0 deletions compat/resource_compat_binary.h
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,8 @@ class ResourceFormatSaverCompatBinaryInstance {

static String get_local_path(const String &p_path, const Ref<Resource> &p_resource);

Error _save_to_file(const Ref<FileAccess> &p_f, const String &p_path, const Ref<Resource> &p_resource, uint32_t p_flags = 0);

public:
enum {
FORMAT_FLAG_NAMED_SCENE_IDS = 1,
Expand All @@ -253,6 +255,7 @@ class ResourceFormatSaverCompatBinaryInstance {
};
Error write_v2_import_metadata(Ref<FileAccess> f, Ref<ResourceImportMetadatav2> imd, HashMap<Ref<Resource>, int> &p_resource_map);
Error save(const String &p_path, const Ref<Resource> &p_resource, uint32_t p_flags = 0);
Error save_to_file(const Ref<FileAccess> &p_f, const String &p_path, const Ref<Resource> &p_resource, uint32_t p_flags = 0);
Error set_uid(const String &p_path, ResourceUID::ID p_uid);
void write_variant(Ref<FileAccess> f, const Variant &p_property, HashMap<Ref<Resource>, int> &resource_map, HashMap<Ref<Resource>, int> &external_resources, HashMap<StringName, int> &string_map, const PropertyInfo &p_hint = PropertyInfo());
};
Expand Down
Loading
Loading