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

--convert-3to4 doesn't upgrade Light2D Blend Mode mode -> blend_mode #77887

Closed
hsandt opened this issue Jun 5, 2023 · 4 comments · Fixed by #86811
Closed

--convert-3to4 doesn't upgrade Light2D Blend Mode mode -> blend_mode #77887

hsandt opened this issue Jun 5, 2023 · 4 comments · Fixed by #86811

Comments

@hsandt
Copy link
Contributor

hsandt commented Jun 5, 2023

Godot version

v4.0.2.stable.official [7a0977c]

System information

Linux Ubuntu 22.04 with Unity desktop

Issue description

Upgrading a Godot 3 project to Godot 4 (via GUI or godot4 --convert-3to4) does not upgrade the Light2D mode member to blend_mode.

As a result, after opening the upgraded project, all non-Add blend modes have been lost. Subtract, Mix and Mask are all reset to Add blending mode.

Note: Mask has been removed and now requires CanvasItem clipping, which is a much more complex upgrade. I suppose we can print some warnings in the console (and if possible, in some popup when upgrading via GUI) to warn user that they need more work to upgrade this feature usage to Godot 4. It should be added on conversion doc side too, but this task has already been added on godotengine/godot-docs#5121

At least Subtract and Mix should be upgraded correctly.

Steps to reproduce

  1. Add some lights with different blending modes in the project... or just download the MRP below
  2. Run godot4 --convert-3to4 or upgrade project via GUI
  3. Observe that blending modes were lost.

Hint: for a quicker check without opening Godot, use the MRP which is under Git, run godot4 --convert-3to4 in the console and check the Git diff to see that mode has not been renamed blend_mode.

Minimal reproduction project

v3.5.2 - convert 3to4 Light2D Mix Blending Mode reset to Add.zip

@Calinou Calinou added this to the 4.x milestone Jun 5, 2023
@AThousandShips
Copy link
Member

This is contextual and the converter is too simplistic for that

@YuriSizov
Copy link
Contributor

The convertor doesn't have advanced heuristics to detect when mode is used in the context of Light2D in your scripts. As the term has a very wide usage and can be mistaken in other contexts, we cannot add such a rename to the convertor. As explained in the popup before you run it, it works on the best effort principle, and such a change is outside of its capabilities.

@Calinou
Copy link
Member

Calinou commented Jun 5, 2023

We can add a compatibility getter method (_get()) to PointLight2D to handle the property rename in this case. (This is not needed in DirectionalLight2D, which is new in 4.0.)

@TheSofox
Copy link
Contributor

TheSofox commented Jan 5, 2024

Followed this thread and followed its conclusions to make a PR to fix this issue (though it seems I had to create a _set() rather than _get() method).

@AThousandShips AThousandShips modified the milestones: 4.x, 4.3 Jan 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants