Description
Describe the project you are working on
I’m developing a large game where exported scenes, textures, and other resources must be referenced by path/UID to keep load times and memory usage low.
Describe the problem or limitation you are having in your project
Godot today offers two separate hints:
-
PROPERTY_HINT_FILE
- lets you pick files by extension (e.g.*.tres
,*.res
,*.tscn
), but has no type safety and requires manually maintained glob lists. -
PROPERTY_HINT_RESOURCE_TYPE
- filters by resource type, but stores the object reference (causing load).
I need the type safety and Editor UX of PROPERTY_HINT_RESOURCE_TYPE
, while having the underlying behaviour of PROPERTY_HINT_FILE
(so large resources aren’t loaded until needed)
Describe the feature / enhancement and how it helps to overcome the problem or limitation
Introduce a new hint, PROPERTY_HINT_RESOURCE_FILE
, which functions just like PROPERTY_HINT_RESOURCE_TYPE
but stores a path or UID as a String
instead of the object reference.
Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams
-
Add the hint to
PropertyHint
-
Modify
EditorPropertyPath
to optionally have a dropdown on right side (just likeEditorResourcePicker
) for "Quick Load" and "Load". -
Modify
EditorProperty *EditorInspectorDefaultPlugin::get_editor_for_property
in theString
case to setup theEditorPropertyPath
accordingly when the hint isPROPERTY_HINT_RESOURCE_FILE
.
If this enhancement will not be used often, can it be worked around with a few lines of script?
No
Is there a reason why this should be core and not an add-on in the asset library?
A lot of core code can actually benefit from this, here are some examples:
For example this
GLOBAL_DEF_BASIC(PropertyInfo(Variant::STRING, "application/run/main_scene", PROPERTY_HINT_FILE, "*.tscn,*.scn,*.res"), "");
Could turn to
GLOBAL_DEF_BASIC(PropertyInfo(Variant::STRING, "application/run/main_scene", PROPERTY_HINT_RESOURCE_FILE, "PackedScene"), "");