EditorExportPreset
Export preset settings and manual resource selections.
Obtain EditorExportPreset through a platform’s CreatePreset or an export-plugin context. A new standalone preset is not added to the user list and does not become runnable automatically. This C# type exposes the listed getters; do not invent public SetExportFilter or SetFileExportMode methods from internal C++ names.
GetFilesToExport is the manual set, not completed build contents. It can be empty for ExportAllResources. ExportSelectedScenes selects serialized PackedEntity hierarchies, including .rscene levels and .rprefab prefabs, by resource type; the SDK enum name is retained. Dependencies, filters and export plugins further affect final contents.
GetCustomizedFiles returns an independent Dictionary with strip/keep/remove strings. GetFileExportMode checks only an exact path, not ancestor rules. GetCustomFeatures is the original comma-separated string. GetProjectSetting applies preset features and can therefore differ from host ProjectSettings.
GetOrEnv returns environment values as strings without type conversion. This complete helper explicitly parses an integer option and strictly validates 64 hex key characters before native ResolveEncryptionKey:
using System;
using System.Globalization;
using Reckfell;
public static class ExportPresetTools
{
public static int ReadInt(EditorExportPreset preset, StringName option, string environmentVariable)
{
using var value = preset.GetOrEnv(option, environmentVariable);
if (value.VariantType == Variant.Type.Int)
return checked((int)value.AsInt64());
if (value.VariantType == Variant.Type.String &&
int.TryParse(value.AsString(), NumberStyles.Integer, CultureInfo.InvariantCulture, out int parsed))
return parsed;
throw new InvalidOperationException($"Export option '{option}' must be a 32-bit integer.");
}
public static bool IsEncryptionKey(string? text)
{
if (text is null || text.Length != 64) return false;
foreach (char character in text)
if (!Uri.IsHexDigit(character)) return false;
return true;
}
}GetEncryptionKey reads the stored string; ResolveEncryptionKey applies environment precedence and caches bytes on first call. Environment changes do not refresh this cache. Prepare the environment before first resolution; do not reuse an already resolved preset after changing it. Native parsing checks length but is not strict hex validation. Do not log keys.
GetVersion formats only the project-version fallback: an empty option can turn 1.0.0 into 1.0.0.0 for Windows metadata; a nonempty option is returned without normalization. This is metadata formatting, not a new engine version.
An isolated Windows preset, getters, Variant types, feature override, versions, key caching and the complete helper were checked in the current editor. Only synthetic values in the QA process were used. This run does not establish actual PCK encryption, dependency-expanded pack contents, export, UI behavior or target-platform execution.
Declarations checked against C# SDK 1.0.0. Expand a name to see declarations and documentation.
Methods26
AreAdvancedOptionsEnabledbool
public bool AreAdvancedOptionsEnabled();Returns whether advanced options are shown: includes active option searching and editor setting _export_preset_advanced_mode. It is neither an exported-game capability nor a separate saved flag of this preset.
boolCurrent advanced-option visibility including active search.
GetCustomFeaturesstring
public string GetCustomFeatures();Returns the original comma-separated custom feature-tag string, not an array or the complete platform feature set. GetProjectSetting parses and adds them when selecting an override.
stringOriginal comma-separated feature-tag string; initially empty.
GetCustomizedFilesReckfell.Collections.Dictionary
public Reckfell.Collections.Dictionary GetCustomizedFiles();Returns a new Dictionary of explicitly customized file or directory paths. Values are strings strip, keep or remove, not numeric FileExportMode values. Editing the dictionary does not change the preset. Empty does not mean the export contains no files.
Reckfell.Collections.DictionaryNew Dictionary: path → strip/keep/remove string.
GetCustomizedFilesCountint
public int GetCustomizedFilesCount();Number of explicit path-customization entries, including directories; not final build-file or dependency count. Initially 0.
intCount of explicitly customized paths, including directories.
GetEncryptDirectorybool
public bool GetEncryptDirectory();Reads the PCK directory-encryption request; initially false. Does not establish successful encryption, a valid key or a matching export template.
boolWhether PCK directory encryption is requested.
GetEncryptPckbool
public bool GetEncryptPck();Reads the pack-data encryption flag; initially false. Actual file selection also depends on encryption include/exclude filters. This getter performs no encryption.
boolWhether pack encryption is requested.
GetEncryptionExFilterstring
public string GetEncryptionExFilter();Returns the original comma-separated encryption-exclusion patterns. This is not the general ExcludeFilter: a file excluded from encryption can remain in the pack.
stringOriginal encryption-exclusion pattern string.
GetEncryptionInFilterstring
public string GetEncryptionInFilter();Returns the original comma-separated encryption-inclusion patterns. Separate from the general IncludeFilter and PCK directory-encryption flag.
stringOriginal encryption-inclusion pattern string.
GetEncryptionKeystring
public string GetEncryptionKey();Returns the stored preset key string, initially empty. Does not apply RECKFELL_SCRIPT_ENCRYPTION_KEY or return ResolveEncryptionKey’s result. Do not log the value.
stringStored key text without the environment override.
GetExcludeFilterstring
public string GetExcludeFilter();Returns the original comma-separated export-exclusion patterns. General exclude is applied after general include. This getter does not compute final contents and is unrelated to encryption filters.
stringOriginal general exclusion-pattern string.
GetExportFilterEditorExportPreset.ExportFilter
public EditorExportPreset.ExportFilter GetExportFilter();Returns the initial resource-selection mode, initially ExportAllResources. The manual list has mode-specific meaning: selected hierarchies/resources with dependencies, excluded resources, or separate ExportCustomized rules. Later filters and export plugins can change the result.
EditorExportPreset.ExportFilterCurrent resource-selection mode.
GetExportPathstring
public string GetExportPath();Returns the stored output path, initially empty. It can be project-relative: native configuration converts an absolute path to a relative one. Does not create a directory or report the last actual exported file.
stringStored, possibly relative output path.
GetFileExportModeEditorExportPreset.FileExportMode
public EditorExportPreset.FileExportMode GetFileExportMode(string path, EditorExportPreset.FileExportMode @default = EditorExportPreset.FileExportMode.NotCustomized);Looks up an explicit entry for exactly this path; returns default if absent. The method itself neither searches ancestor rules nor checks file existence. Effective inheritance during export is handled separately.
| Name | Type | Default |
|---|---|---|
path | string | — |
default | EditorExportPreset.FileExportMode | EditorExportPreset.FileExportMode.NotCustomized |
pathExact asset:// file or directory path; the method does not traverse ancestors.
defaultResult when no explicit entry exists; defaults to NotCustomized.
EditorExportPreset.FileExportModeExplicit mode for the exact path, or the supplied default.
GetFilesToExportstring[]
public string[] GetFilesToExport();Returns an independent string[] of manually selected paths. Meaning depends on ExportFilter; it can be empty under ExportAllResources while the project still exports. Not the complete dependency-expanded file set. HashSet ordering is not guaranteed.
string[]Copy of the manual path set with unspecified order.
GetIncludeFilterstring
public string GetIncludeFilter();Returns the original comma-separated additional inclusion patterns. Not a list of already included resources. The general ExcludeFilter is applied later and can remove a matching file.
stringOriginal general additional-inclusion pattern string.
GetOrEnvVariant
public Variant GetOrEnv(StringName name, string envVar);Returns a nonempty environment variable as a String Variant without converting to the option type. Otherwise reads the preset option with its native type and possible plugin override. Supply an existing option for fallback and dispose the returned Variant with using.
| Name | Type | Default |
|---|---|---|
name | StringName | — |
envVar | string | — |
nameExisting fallback option name, such as debug/export_console_wrapper.
envVarEnvironment-variable name. A nonempty value is returned as a string without type conversion.
VariantString Variant from nonempty environment, otherwise the option’s native-typed value.
GetPatchesstring[]
public string[] GetPatches();Returns an independent string[] of base-pack paths in stored order. Does not open packs, check their existence or build a patch. An empty list is not an ordinary-export error.
string[]Copy of the ordered base-pack path list.
GetPresetNamestring
public string GetPresetName();Returns this preset’s name. A new standalone preset from CreatePreset can be unnamed; the name is not automatically the platform name or game version.
stringPreset name; a new instance can be unnamed.
GetProjectSettingVariant
public Variant GetProjectSetting(StringName name);Reads ProjectSettings using platform, preset and custom features. The result can differ from ordinary editor reads on the host OS. Use an existing key, check VariantType and dispose the result with using.
| Name | Type | Default |
|---|---|---|
name | StringName | — |
nameExisting ProjectSettings key, not an export_presets.cfg key.
VariantSetting Variant after preset feature overrides.
GetScriptExportModeEditorExportPreset.ScriptExportMode
public EditorExportPreset.ScriptExportMode GetScriptExportMode();Returns the built-in script-format export mode; initially BinaryTokensCompressed. This is neither PCK encryption nor the ExportDebug/ExportRelease configuration selection for C# publication.
EditorExportPreset.ScriptExportModeText, BinaryTokens or BinaryTokensCompressed.
GetVersionstring
public string GetVersion(StringName name, bool windowsVersion);Reads a version-string option. Nonempty values are returned unchanged. Only an empty option falls back to application/config/version and normalizes that fallback, including four-component Windows formatting when windowsVersion=true. Not a general semver validator or engine-version getter.
| Name | Type | Default |
|---|---|---|
name | StringName | — |
windowsVersion | bool | — |
nameExisting version-string option, such as application/file_version on a Windows preset.
windowsVersionApply four-component Windows formatting to the fallback. A nonempty option value itself is not normalized.
stringOption string or normalized project-version fallback.
Hasbool
public bool Has(StringName property);Checks membership in the export-option map, not visibility or a nonzero value. Does not test inherited Resource properties: resource_name, for example, is not an export option.
| Name | Type | Default |
|---|---|---|
property | StringName | — |
propertyExact option name, such as binary_format/architecture.
boolTrue if the name exists in the option map.
HasExportFilebool
public bool HasExportFile(string path);Checks exact path membership in the manual selected-file set. Neither checks disk existence nor guarantees final-build inclusion: the set’s meaning depends on ExportFilter.
| Name | Type | Default |
|---|---|---|
path | string | — |
pathExact manual-set path, normally asset://. Disk existence is not checked.
boolTrue if the exact path belongs to the manual set.
IsDedicatedServerbool
public bool IsDedicatedServer();Returns the saved dedicated-server preset flag, initially false. Not a check of the current editor’s --headless state or proof that every visual resource was removed.
boolSaved dedicated-server preset flag.
IsRunnablebool
public bool IsRunnable();Reports whether EditorExport selected this specific preset as runnable for its platform. CreatePreset alone does not select a standalone preset. True does not establish a device, templates or successful execution.
boolWhether this preset is selected as runnable for its platform.
ResolveEncryptionKeybyte[]
public byte[] ResolveEncryptionKey();On first call uses nonempty RECKFELL_SCRIPT_ENCRYPTION_KEY, otherwise the stored string, and caches the result. Length 64 produces 32 bytes; other lengths produce an empty array. Native parsing is not strict hex validation: validate every character first. Environment changes after the first call do not refresh this preset’s cache. GetEncryptionKey still returns the stored string.
byte[]Copy of the cached 32 bytes or an empty array; length 32 alone establishes neither valid hex nor template compatibility.
EditorExportPreset.ExportFilter
EditorExportPreset.FileExportMode
| Value | Description |
|---|---|
Keep = 2 | |
NotCustomized = 0 | |
Remove = 3 | |
Strip = 1 |
EditorExportPreset.ScriptExportMode
| Value | Description |
|---|---|
BinaryTokens = 1 | |
BinaryTokensCompressed = 2 | |
Text = 0 |