- Home /
Is this workaround OK? It's for fixing lost tag/layer info on export/import
As mentioned in http://forum.unity3d.com/threads/33890-Open-Mac-unity-project-on-a-PC?p=220179&viewfull=1#post220179 tag and layer info gets lost when one exports an entire scene, then imports that unitypackage into another project.
The context of this is: Need to copy a scene from one base project to a set of related projects that are to contain that scene.
Exporting the scene along with all assets it needs seemed like the straight-forward way to go. And it works. Except user-defined tag and layer info is lost. Maybe lost at export-time. Maybe lost at import-time. Either way, after import: an important portion of user-defined tag and layer info clearly did not get imported.
Well, I jury-rigged a workaround. It works. However, just because it works for me now, doesn't mean this workaround will work in all cases.
So my question for the gurus: Please take a look at this workaround, and let us know whether you think this workaround will work in all cases. And if you think it will break something in some cases, please explain what those cases might be so they can be avoided, or perhaps the workaround can be improved by the community. Thanks in advance, and here we go:
1- In exporting project, click Edit/Project Settings/Editor, and turn on "Meta Files" and turn on "Force Text" (umm, go slow on these, they take time to finish)
2- Click Assets/Export Package, export what you need.
3- Create the new empty project. In this new project, do the "Meta Files" and "Force Text" things already done in the exporting project.
4- DO NOT IMPORT YET. Exit Unity.
5- For this step, you need a file-comparison utility. Any one you like, such as Beyond-Compare, but whatever, you just need a utility that shows two text files side by side and lets you click in the margins to copy a difference from one file into the other. Compare the ProjectSettings/TagManager.asset files. That is, the exporting project will have one, and the importing project will have one also. Compare those two files.
6- The differences regarding any user-defined tags or labels will show up. Use the comparison-utility to repair the losses of your user-defined tags/layers, so that the new-project's TagManager.asset file looks like the one for the exporting project. Save your changes.
7- Open the importing project in Unity. Your user-defined tag+layer info is fixed, so you are now ready to import the unitypackage. So import it. If you have already imported, delete the new project and begin again at step 3.
8- Done, but note that I'm not using the asset server, git, svn. I am using no source control at all. I have no clue how this workaround could or could not apply in source control settings.
I Googled and searched forums out the wazoo on this. I apologize if my search skills epic-failed.
If anyone cares, I have more info on just what is lost. It is NOT the case that all user-defined tag/layer info is lost.
OK. Call for the question.
Is the workaround sound? Is there a better way than export/import?
And, can Unity be modified so it just stops losing tag/layer info in the first place?
I know there are many pressing priorities for the Unity team. Still, it would just be super to know that this data-loss issue is on the list of things to improve in future.
I am facing off the same problem
(Unity 4.3.3f1 pro)
Answer by pgomes · Jan 26, 2014 at 12:29 AM
Alternatively, if you just want to update the layer & tags replacing them, you can just:
Select Assets in the Project pane.
Go to Assets > Export Package ... selecting the assets you want to export.
Close Unity.
Copy the TagManager.asset file from the ProjectSettings folder of the original project to the ProjectSettings folder of the project you want to export to.
Open the unity project you want to export to.
Go to Assets > Import Package > Custom Package... and select the exported package.
Answering your specific questions:
It has worked so far but I will let everyone know if I run into issues.
I have not found a better workaround.
I do not believe you can stop unity from losing tags/layers.
(Unity 4.3.3f1)