Skip to content

Add behavior change note for @export_file annotation in Godot 4.4 #11075

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
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
17 changes: 17 additions & 0 deletions tutorials/migrating/upgrading_to_godot_4.4.rst
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,23 @@ Method ``post`` adds a new ``count`` optional parameter
Method ``standardize_locale`` adds a new ``add_defaults`` optional parameter |✔️| |✔️ with compat| |✔️ with compat| `GH-98972`_
======================================================================================================================== =================== ==================== ==================== ============

**Export annotations**

.. warning::

The behavior of ``@export_file`` changed in Godot 4.4. When assigning a new value from the Inspector, the path is now stored and returned as a ``uid://`` reference instead of the traditional ``res://`` path. This is a **breaking change** and may cause issues if you're expecting ``res://``-based paths in scripts or serialized files.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line as well as line 66 need to be broken up. We don't like endlessly long lines. Technically we have no official hard limit. But when I can see it spilling out onto multiple lines on github that's a problem. Personally I make lines 85 characters long at maximum, but again that's not an official limit. It just needs to be shorter and broken up.


For example, exported arrays of files may now contain a mix of ``uid://`` and ``res://`` paths, especially if they were edited partially in the Inspector.

In 4.4, the only way to retain the ``res://`` format is to **manually edit** the `.tscn` or `.tres` files in a text editor. Starting in Godot 4.5, a new annotation ``@export_file_path`` can be used to explicitly retain the old behavior and export raw ``res://`` paths.

Related issues:

- PR: `Add @export_file_path to export raw paths (no UID) <https://github.com/godotengine/godot/pull/105414>`_
- Issue: `@export_file behavior change is breaking <https://github.com/godotengine/godot/issues/11065>`_
- See also: `ProjectSettings stores UIDs for file paths <https://github.com/godotengine/godot/pull/104818>`_
Comment on lines +68 to +72
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Two things here. One linking to the two issues is excessive. It's helpful for a documentation review since that gives me an easy way to verify information, but as an end user it's not helpful.

Two, the link to the PR should be formatted like the other links on this page. but don't just leave it down here, put it after "instead of the traditional res:// path. " in the beginning of the warning.



.. [#f1] Default buffer size in 4.3 is ``1024``.

GUI nodes
Expand Down
Loading