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

Converter 2.1 to 3.0 issues #9656

Closed
kubecz3k opened this Issue Jul 15, 2017 · 23 comments

Comments

Projects
None yet
@kubecz3k
Copy link
Member

kubecz3k commented Jul 15, 2017

Operating system or device - Godot version:
This was tested with version 3: e64b82e version 2: 408f910

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:

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

(those below are from comments)

  • 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.
  • 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.
  • 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
  • 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.

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?

  • track: rotation_deg ----> rotation_degrees
  • (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

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

@kubecz3k kubecz3k added this to the 3.0 milestone Jul 15, 2017

@akien-mga akien-mga changed the title Converter 2.0 to 3.0 issues Converter 2.1 to 3.0 issues Jul 15, 2017

@akien-mga

This comment has been minimized.

Copy link
Member

akien-mga commented Jul 15, 2017

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 :)

@akien-mga akien-mga self-assigned this Jul 15, 2017

@vnen

This comment has been minimized.

Copy link
Member

vnen commented Jul 15, 2017

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

@kubecz3k

This comment has been minimized.

Copy link
Member Author

kubecz3k commented Jul 17, 2017

@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).

@kubecz3k kubecz3k added the tracker label Jul 19, 2017

@LikeLakers2

This comment has been minimized.

Copy link
Contributor

LikeLakers2 commented Oct 11, 2017

#9610 is fixed, fyi.

@reduz reduz added the hero wanted! label Nov 13, 2017

@reduz

This comment has been minimized.

Copy link
Member

reduz commented Nov 13, 2017

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

@hungrymonkey

This comment has been minimized.

Copy link
Contributor

hungrymonkey commented Dec 8, 2017

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

#10123

I am just adding another issue to the list

@Keetz

This comment has been minimized.

Copy link
Contributor

Keetz commented Dec 12, 2017

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

@akien-mga

This comment has been minimized.

Copy link
Member

akien-mga commented Dec 12, 2017

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).

@Keetz

This comment has been minimized.

Copy link
Contributor

Keetz commented Dec 12, 2017

@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?

@akien-mga

This comment has been minimized.

Copy link
Member

akien-mga commented Dec 12, 2017

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.
@Keetz

This comment has been minimized.

Copy link
Contributor

Keetz commented Dec 12, 2017

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.

@Keetz

This comment has been minimized.

Copy link
Contributor

Keetz commented Dec 13, 2017

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

Converter used at db262f8

  • 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 😉

@Ranoller

This comment has been minimized.

Copy link
Contributor

Ranoller commented Dec 22, 2017

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.

@hungrymonkey

This comment has been minimized.

Copy link
Contributor

hungrymonkey commented Dec 29, 2017

482e07a#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

@Nutriz

This comment has been minimized.

Copy link
Contributor

Nutriz commented Jan 3, 2018

for #15191 PR.

  • z property of Node2D got changed to z_index
@bojidar-bg

This comment has been minimized.

Copy link
Member

bojidar-bg commented Jan 12, 2018

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...
@mhilbrunner

This comment has been minimized.

Copy link
Member

mhilbrunner commented Jan 12, 2018

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

@Keetz

This comment has been minimized.

Copy link
Contributor

Keetz commented Jun 12, 2018

(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?

@akien-mga

This comment has been minimized.

Copy link
Member

akien-mga commented Jun 12, 2018

Indeed, thanks.

@Keetz

This comment has been minimized.

Copy link
Contributor

Keetz commented Jun 14, 2018

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)

@vonflyhighace2

This comment has been minimized.

Copy link

vonflyhighace2 commented Aug 1, 2018

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.

@akien-mga

This comment has been minimized.

Copy link
Member

akien-mga commented Sep 17, 2018

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.

@akien-mga akien-mga closed this Sep 17, 2018

@akien-mga

This comment has been minimized.

Copy link
Member

akien-mga commented Sep 17, 2018

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.