Godot: Converter 2.1 to 3.0 issues

Created on 15 Jul 2017  路  23Comments  路  Source: godotengine/godot

Operating system or device - Godot version:
This was tested with version 3: e64b82ebfcc3475c7a7d2a9196bfe20d6c9e3614 version 2: 408f91024c1babc5b60a8fa283a51c44637e00b6

Issue description:
_Background:_ Last day I was working on porting plugin from godot 2 to godot 3. So it's a little special case since almost any script was a tool. In normal project conversion works quite well.
Also I will not enlist problems with variable/function name changes since those are expected to be fixed by the develop on his own.

The list:

  • [x] Groups are not converted
  • [x] Path9Frame nodes are not converted (class name change to NinePatchRect)
  • [x] Tool scenes are forgetting outgoing signals that were defined in editor
  • [x] Control.filter is always ignore, this can be misleading, see above and #9657. Conversion from focus would be welcome.
  • [x] Tool Control scenes are losing their size
  • [x] Tool Control scenes are losing their position
  • [x] Tool Control scenes are losing their anchoring
  • [ ] Tool scenes are sometimes re not linked to their scripts (not very often, haven't isolated)
  • [x] Old .fnt are not recognized #9610
  • [ ] Converter is unable to convert some models imported from dae file #9715
  • [x] KEY_RETURN and KEY_ENTER got renamed #10123

(those below are from comments)

  • [x] Control nodes position and size is not always set correct - Seems to be caused by combinations of anchors
  • [x] Opacity and Self Opacity is no longer available in 3.0 and the converter doesn't handle this. It should set the alpha on the Modulate and Self Modulate respectively
  • [x] Animation tracks modifying the opacity should also modify the modulate/alpha instead
  • [ ] Particles2D doesn't work after conversion.
  • [ ] Particles3D doesn't work after conversion.
  • [ ] ButtonGroup is no longer a Node but a Resource - Right now a ButtonGroup is converted to a Node and radio button setups are broken.
  • [x] Control nodes and their Focus Mode in 2.1 doesn't really correspond to the Mouse/Filter in 3.0 - I can't seem to find consistency in what the 3.0 Filter will be set to based on the 2.1 Focus Mode
  • [x] Anchors are not converted correct. For example a Control anchored to Center Bottom in 2.1 is anchored as Bottom Right in 3.0 - Seems like Center becomes 1 instead of 0.5
  • [x] Size Flags are not set correct on Control nodes
  • [x] Button Click On Press isn't set to the corresponding Action Mode in 3.0
  • [ ] Item Mask ----> Item Cull Mask (Not Binded)
  • [x] Light2D, Polygon2D and others: Opacity ---> SelfModulate.a (or Modulate.a)
  • [ ] Mix Mode ---> New CanvasItemMaterial/MixMode (I don麓t know if this is posible, but is one choice)
  • [ ] Texture Import: Repeat property is not converted.

Some properties for animation are not converted (sorry don't have a list at the time, but for me it was most of Control ones (inside rect)), not sure what is status of others?

  • [x] track: rotation_deg ----> rotation_degrees
  • [x] (not 100% sure) all inside Control.rect
  • [x] (not 100% sure) all inside CanvasItem.visibility
  • [x] Control: rect/pos -> rect_position
  • [x] Control: rect/scale -> rect_scale
  • [x] Control: rect/size -> rect_size

Those lists are probably very much incomplete, but I will try to update them when I see something new, also some of those are really easy to fix. Also I'm not saying all of those NEED to be fixed, but some of them should be for sure, and even if something wont be fixed it's better to be aware since it might be helpful during migration guide doc creation.

If you will want to share your own observations always test on the newest 2.0 build. And paste build git hash so we could know what version it was.

Steps to reproduce:

Link to minimal example project:
Not very convenient, but if you really want to start with something here is a project in which I was trying to reproduce my issues: Test2 to 3 conversion.zip

bug hero wanted! editor tracker usability

Most helpful comment

BTW, old .fnt files aren't recognized (even after renaming to .font). See #9610.

All 23 comments

I've ticked what I've fixed locally, or in the case of signals could not reproduce (they are properly converted and kept, although they don't work in 3.0 apparently, see #9657).

Not sure yet about the two other tool-related ones, and for animations I still have to check. But your 2to3 test project converts perfectly now :)

BTW, old .fnt files aren't recognized (even after renaming to .font). See #9610.

@akien-mga thank you for your work! Was porting two other plugins today and it was almost a breeze! When it comes to issue with signal conversion, it seems it's one more time about something else (leaved a comment in #9657).

9610 is fixed, fyi.

Converter source code is here for anyone who wants to work on this:
https://github.com/godotengine/godot/blob/2.1/editor/editor_export_godot3.cpp

I just want to say. It seems like KEY_RETURN and KEY_ENTER got renamed

https://github.com/godotengine/godot/pull/10123

I am just adding another issue to the list

I am not sure #9610 is completely fixed, as there is still problems with the .fnt files used in 2.1 for bitmap fonts.

The converter right now tries to convert it to .font as a normal binary .fnt file, but fails because the .fnt in a bitmap font is just a text file defining the characters on a .png file.

Backtrace:
https://pastebin.com/dWUDFGQz

The backtrace looks like your .fnt did not get renamed to .font as it should have been as per #11869.
In the master branch, .fnt files are supposed to be BMFont files, not Godot's binary format from 2.1 (which should be .font).

@akien-mga it didn't, it fails because the conversion to .font expects the binary .fnt but in case of a bitmap font it isn't.

So i guess some kind of check is needed to see if it isn't the binary .fnt and then convert it to the BMFont file instead?

I think there's a misunderstanding, there is no conversion to .font performed, it's only renamed.

  • Godot 2.1 has a Godot-specific BitmapFont binary format, using the .fnt extension
  • Godot 3.0 has the same BitmapFont bianry format, using the .font extension
  • Godot 3.0 also supports the thirdparty BMFont format (text-based), using the .fnt extension
  • When you export a 2.1 project to 3.0, it should rename your .fnt files to .font. In theory you should not have any BMFont file in your 2.1 project, as they were not supported. If you do, it may also rename it to .font but then Godot 3.0 won't know how to read it.

In theory you should not have any BMFont file in your 2.1 project, as they were not supported.

Hehe then there have been a misunderstanding 馃槃 Even though they aren't supported they work just fine.

Okay i edited this again, creating a list of issues i stumble across instead for a better overview.

Converter used at db262f80be654c09288453126379277a2306ac01

  • Control nodes position and size is not always set correct - Seems to be caused by combinations of anchors
  • Opacity and Self Opacity is no longer available in 3.0 and the converter doesn't handle this. It should set the alpha on the Modulate and Self Modulate respectively
    -- Animation tracks modifying the opacity should also modify the modulate/alpha instead

  • Particles2D doesn't work after conversion. In 3.0 a Particle2D needs a material to process the particles. If i am not mistaken the option to add ShaderMaterial is not present in 2.1, so the converter should create a ParticlesMaterial and set the properties corresponding to the ones in the 2.1 particle system. If possible.

  • Shaders aren't working, mostly because of shader language changes - So this falls under the _"expected to be fixed by the developer on his own"_ category i guess

  • ButtonGroup is no longer a Node but a Resource - Right now a ButtonGroup is converted to a Node and radio button setups are broken. Would it make sense to create a new ButtonGroup resource and set it on all child buttons Group property?

  • Control nodes and their Focus Mode in 2.1 doesn't really correspond to the Mouse/Filter in 3.0 - I can't seem to find consistency in what the 3.0 Filter will be set to based on the 2.1 Focus Mode

  • Anchors are not converted correct. For example a Control anchored to Center Bottom in 2.1 is anchored as Bottom Right in 3.0 - Seems like Center becomes 1 instead of 0.5

  • Size Flags are not set correct on Control nodes

  • Button Click On Press isn't set to the corresponding Action Mode in 3.0

Hope it is ok i just list issues i find here so they can be added to the tracker instead of creating new issues. And please correct me if i am wrong on any of my points, like i was with the font conversion :wink:

Oh, I was opening an issue and find you!:
Some issues from a conversion made in 2.1.4 compiled at 29/11/2017:

  • Animation Player:
    track: rotation_deg ----> rotation_degrees (Bad converted, shows error in console)

  • Light2D:
    Item Mask ----> Item Cull Mask (Not Binded)

  • Light2D, Polygon2D and others:
    Opacity ---> SelfModulate.a (or Modulate.a)

  • Mix Mode ---> New CanvasItemMaterial/MixMode (I don麓t know if this is posible, but is one choice)

  • Texture Import:
    Repeat property is not converted.

https://github.com/godotengine/godot/commit/482e07af7e5c8b85463f950036dc7b14cb8cd3b4#diff-43287f78e603b193c1c77b7298273367L682

This comment is just to add support that rotation_deg got renamed to rotation_degrees

it got changed in 3d Spatial.

  • set_rotation_deg -> set_rotation_degrees
  • get_rotation_deg -> get_rotation_degrees

There are other changes in the commit such as Node2d

functions

  • set_rotation_in_degrees -> set_rotation_degrees
  • get_rotation_in_degrees -> get_rotation_degrees
  • set_global_rotation_in_degrees -> set_global_rotation_degrees
  • get_global_rotation_in_degrees -> get_global_rotation_degrees

Member variables

  • rotation_deg -> rotation_degrees
  • global_rotation_deg -> global_rotation_degrees

There might be other but that was a huge patch

LIke Polygon2D, CanvasLayer, Control etc

for #15191 PR.

  • z property of Node2D got changed to z_index

For #15611:

  • playback/play -> current_animation
  • texture_rotation -> texture_rotation_degrees
  • h_scroll, v_scroll -> scroll_horizontal_enabled, scroll_vertical_enabled
  • CanvasLayer.rotation -> rotation_degrees, if doable
  • Maybe a few others, forgot them now...

Linking because semi-relevant: https://github.com/dploeger/godot-migrationnotes

(not 100% sure) all inside Control.rect
(not 100% sure) all inside CanvasItem.visibility
Control: rect/pos -> rect_position
Control: rect/scale -> rect_scale
Control: rect/size -> rect_size

Should be fixed here:
https://github.com/godotengine/godot/blob/2.1/editor/editor_export_godot3.cpp#L340-L344

Here:
https://github.com/godotengine/godot/blob/2.1/editor/editor_export_godot3.cpp#L411-L416

And here:
https://github.com/godotengine/godot/blob/2.1/editor/editor_export_godot3.cpp#L643-L652

If I am not mistaken?

Indeed, thanks.

See #19556 for fixes on:

Control nodes and their Focus Mode in 2.1 doesn't really correspond to the Mouse/Filter in 3.0 - I can't seem to find consistency in what the 3.0 Filter will be set to based on the 2.1 Focus Mode

Button Click On Press isn't set to the corresponding Action Mode in 3.0

Following is already fixed by the previous opacity/modulate fixes:

Light2D, Polygon2D and others: Opacity ---> SelfModulate.a (or Modulate.a)

seems 3.x doesn't have support for .texture file extensions but the exporter converts to that from .tex anyway?
Also the exporter seems to pickup any strings that has the word ".remove" and converts to ".remove_and_collide" or something similar.

The 2.1 branch is no longer actively worked on by engine developers, unless critical fixes are needed for current games in production. As such we are now closing non-critical bug reports affecting only the 2.1 branch.

Please comment if this was incorrectly triaged and is still relevant in 3.x versions.

Well actually this issue can be considered as "fixed". Most remaining points on the OP can't really be fixed.

Also the exporter seems to pickup any strings that has the word ".remove" and converts to ".remove_and_collide" or something similar.

This is a mistake in my regexp, I'll fix it eventually.

Was this page helpful?
0 / 5 - 0 ratings