A fast way to convert .scn scenes to new format?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By hearto
:warning: Old Version Published before Godot 3 was released.

Hello,
From what I understand, on the future, the scn/xscn scene should be deprecated and replaced by the new tscn file format. Taking this on account and my project which is hosted at a private git with many scenes on xscn format (50+ with many references).
Should I upgrade my project now?
What is the best way to upgrade it?

:bust_in_silhouette: Reply From: Akien

The .scn format won’t be deprecated, as some users prefer it and it’s still what the engine uses when exporting projects (it will convert the .tscn files to .scn on the fly for better performance in the exported version).

The .xscn format might be deprecated in the future yes, though there are no precise plans for that yet. But switching to .tscn is a good thing at any rate as it’s awesome :slight_smile:

Right now the conversion is a bit tedious. Here’s how I do it:

  • Open all .scn files and save them as .tscn
  • Close the editor, and open the .tscn files with a text editor
  • Replace all .scn extensions by .tscn (if you have scenes instanced in other scenes for example)
  • Grep the source code for other uses of .scn (e.g. in a load or preload function and change that too)
  • Open the project in Godot again, reopen all .tscn files and save them again (somehow the first conversion produces some strange artefacts, that will be removed when it’s saved anew - there’s a bug report for that).

Then if you have .res or .xres/.xml resources, a similar workflow can be used to convert them to .tres. At any rate, you’re in for a few hours a playing around with the converter, and yeah that’s annoying :smiley:

Hopefully we can have a conversion tool to ease the process in 2.1.

BTW, for the text editor step, I prefer to use Atom’s find and replace in files functionality, or sed -i ... **.tscn.

Bojidar Marinov | 2016-04-04 09:25

After I finished this process on my project, god How much time it took you to change all the demos, this screams a conversion tool or batch, at least for the .scn to .tscn point.

hearto | 2016-04-09 04:40