Skip to content
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

Data loss when opening Godot 3 scenes in Godot 4 #78893

Closed
Koopa1018 opened this issue Jul 1, 2023 · 3 comments
Closed

Data loss when opening Godot 3 scenes in Godot 4 #78893

Koopa1018 opened this issue Jul 1, 2023 · 3 comments

Comments

@Koopa1018
Copy link

Godot version

v4.1.beta1.official [828ec2c]

System information

Godot v4.1.beta1 - Windows 10.0.19045 - Vulkan (Forward+) - dedicated NVIDIA GeForce RTX 2070 SUPER (NVIDIA; 30.0.14.7247) - AMD Ryzen 7 3700X 8-Core Processor (16 Threads)

Issue description

In Godot 4.1rc1, opening .tscn files formatted for Godot 3 doesn't upgrade them properly--if a node has a property whose name was changed in Godot 4, the property is destroyed rather than upgraded (reset when the scene is opened, removed when the scene is saved).

Examples I've found are TextureRect and TouchScreenButton. When I open scenes containing those, I find that the TextureRect's positioning has been reset to 0,0 (because margin_ properties were renamed to offset_) and the TouchScreenButton's graphics have been removed (because normal and pressed were renamed to texture_normal and texture_pressed).

Expected behavior is that, instead of vanishing into the aether, properties with changed names are updated to their new names when loaded in Godot 4, respecting the type of the node and making any changes required to preserve data in the new API.

Steps to reproduce

  1. In Godot 3, open the repro project labeled "Godot3" and the scene named GD3Scene.tscn.
  2. Observe that the TextureRect is roughly in the middle of the scene's screen outline, with its anchors far above and to the left.
  3. Inspect GD3Scene.tscn in a text editor. Observe that the node named "TextureRect" has properties margin_left, margin_top, etc.
  4. Copy GD3Scene.tscn into the repro project labeled "Godot4."
  5. In Godot 4.1, open project "Godot4" and the copied scene.
  6. Observe that the TextureRect is at the top-left of the screen outline, touching its anchors.
  7. Without modifying anything, save the scene.
  8. Inspect the saved version of GD3Scene.tscn in a text editor. Observe that "TextureRect" has lost all properties except texture.

Minimal reproduction project

GD4 Scene Convert Problem.zip

@AThousandShips
Copy link
Member

AThousandShips commented Jul 1, 2023

Are you using the converter? It sounds like you don't, you can't open scenes from 3.x in 4.x directly and expect correct results, you need to run the project converter, see here

@Koopa1018
Copy link
Author

Koopa1018 commented Jul 2, 2023

Yes, I did run the converter. The converter didn't touch the indicated properties.

EDIT: Ah--I see. I'll be closing this report and making a more correct one now.

@Calinou
Copy link
Member

Calinou commented Jul 2, 2023

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants