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

3-to-4 project converter doesn't preserve viewport width and height #66125

Closed
Tracked by #73960
daveTheOldCoder opened this issue Sep 19, 2022 · 4 comments · Fixed by #74040
Closed
Tracked by #73960

3-to-4 project converter doesn't preserve viewport width and height #66125

daveTheOldCoder opened this issue Sep 19, 2022 · 4 comments · Fixed by #74040

Comments

@daveTheOldCoder
Copy link

Godot version

4.0.beta1

System information

Linux (Pop!_OS 20.04)

Issue description

3-to-4 project converter changes viewport width and height. I would expect them to remain the same.

Steps to reproduce

Create a new Godot 3.x project. I used Godot 3.5.1.rc1.

Change the width and height in the project settings to 1280x720 (Project >> Project Settings... >> General >> Display >> Window >> Size >> Width,Height).

The 3.x minimal reproduction project attached below already has this change.

Import the project in Godot 4.0.beta1 and select Convert Full Project.

Go to Project >> Project Settings... >> General >> Display >> Window >> Size and enable Advanced Settings.

The Width and Height values are preserved, but the Viewport Width and Viewport Height have different values: 1152 and 648, respectively.

Minimal reproduction project

project_converter_3_to_4-bug3.zip

@fire
Copy link
Member

fire commented Sep 19, 2022

Not sure, but I recall the view rect was flipped, maybe it has a clamp on negative numbers.

@Calinou
Copy link
Member

Calinou commented Sep 19, 2022

Not sure, but I recall the view rect was flipped, maybe it has a clamp on negative numbers.

This is unrelated. The issue is the project settings not being renamed when running 3to4.

@gotnospirit
Copy link
Contributor

gotnospirit commented Sep 20, 2022

The rename aren't defined but, after few tests, it looks like no rename can be applied for a project.godot file.
I see them used for ".gd" and ".tscn" files (project settings are allowed here?), so maybe it works in this case but not (as is) for project.godot, because this file uses a .ini format

if (file_name.ends_with(".gd")) {
rename_classes(lines, reg_container); // Using only specialized function.
rename_common(enum_renames, reg_container.enum_regexes, lines);
rename_colors(lines, reg_container); // Require to additional rename.
rename_common(gdscript_function_renames, reg_container.gdscript_function_regexes, lines);
rename_gdscript_functions(lines, reg_container, false); // Require to additional rename.
rename_common(project_settings_renames, reg_container.project_settings_regexes, lines);

@Calinou
Copy link
Member

Calinou commented Sep 20, 2022

cc @qarmin

@akien-mga akien-mga added this to the 4.0 milestone Feb 27, 2023
@akien-mga akien-mga modified the milestones: 4.0, 4.1 Feb 27, 2023
JeffVenancius pushed a commit to JeffVenancius/godot that referenced this issue Mar 3, 2023
In the ConfigFile format, the first subpath is the category and is not part
of the line that the regex would match.

Fixes godotengine#66125.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment