Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Accidentally converted a folder to a .META file.

Discussion in 'Editor & General Support' started by Wilelle, Mar 16, 2017.

  1. Wilelle

    Wilelle

    Joined:
    Jun 16, 2015
    Posts:
    93
    I'm not sure what would be the right section for this, so I'm just going to hope this is right.

    Anyway, my problem is that when experimenting with something irrelevant to the subject, I somehow managed to convert my Animations folder into a useless .META file. Quitting the project without saving did nothing considering that this didn't affect the scene itself and all that, I can't restore the project to an earlier version and I never made a backup.

    I suspect that this folder and all its animations is gone forever, but considering that it represents hours of work I doubt I could replicate with the accuracy I would need to make it work again, I'm still asking if anyone knows a way to fix this. If there's some hidden backup somewhere or if there's a way to convert the file back to a folder with no loss of data, etc.
     
  2. Fabian-Haquin

    Fabian-Haquin

    Joined:
    Dec 3, 2012
    Posts:
    231
    You did not converted a folder to a .meta file (folder /=/ file).

    Every files and folder have a correspond .meta file used to record connections between files or a file setting inside Unity.
    So your folder seems pretty much gone yes...

    I advice you to use source control, there is a lot of solution (SVN, Perforce, Git...).

    Here is a Unity tutorial to use costless source control with Git: https://unity3d.com/fr/learn/tutori...creating-your-first-source-control-repository

    The concept of this is to send every time you want your project onto a server that keep track of the change, this mean you can go back in time when you want to retrieve an older version of a file, even deleted files (locally or on the server).
     
    Last edited: Mar 16, 2017
  3. Wilelle

    Wilelle

    Joined:
    Jun 16, 2015
    Posts:
    93
    I see... I guess I'll use something like that for the future then. Ugh, it still really stings to lose so much work... This might force me to discontinue the entire project.
    Thanks anyway, though.
     
  4. Fabian-Haquin

    Fabian-Haquin

    Joined:
    Dec 3, 2012
    Posts:
    231
    I understand your frustration...

    I'm so used to use version control that when I'm not, I live in a constant fear of losing my work.
     
  5. BlackPete

    BlackPete

    Joined:
    Nov 16, 2016
    Posts:
    970
    If the folder was deleted, maybe check your Recycle Bin? Assuming you're on a PC with Windows, that is.
     
  6. Baste

    Baste

    Joined:
    Jan 24, 2013
    Posts:
    6,199
    Did you rename the folder to "folderName.meta"? In that case you should simply be able to remove the name extension if that's confusing Unity.
     
  7. Wilelle

    Wilelle

    Joined:
    Jun 16, 2015
    Posts:
    93
    No, I checked my recycle bin and nothing was there. The problem is that the folder wasn't deleted, I wish it was, but instead it was converted into a useless file, thus being beyond redemption as far as I can tell.
     
  8. Wilelle

    Wilelle

    Joined:
    Jun 16, 2015
    Posts:
    93
    There was no renaming involved. I was trying to add a file to the folder through a script, specifically an Avatar (I'm still looking for a workaround to be able to mobilize the Avatar Mask without having to rig my character in a program like Maya, and this was such an attempt), however since I didn't know what kind of file an Avatar is, I foolishly left the .(something) part blank, making the script think I wanted to create a .META file (Apparently its substitute for .(nothing)) in place of my folder, overwriting the folder. That is at least what happened as far as I can tell. This stuff it alien territory to me. Hence why I screwed up so badly.
     
  9. Fabian-Haquin

    Fabian-Haquin

    Joined:
    Dec 3, 2012
    Posts:
    231
    A folder is not a file... you can't "overwrite a folder" neither apply an extension to it.
    The concept of folders is just to sort files but when a file is written onto your HDD memory, moving a file from a folder to another will not move the file's content memory position.

    Windows API consider folders and files as different kind of stuff, I really don't think naming a folder "myfolder.meta" will confuse Unity, it will juste create a "myfolder.meta.meta" file, that's all.

    There is two options to me:

    You somehow flag your folder to be hided by windows, that's why the .meta is still there (Unity delete automatically .meta files from inexistant files/folders). If so, go to your folders options and enable "display hidden folders & files".

    Or you deleted your folder without knowing it but as I said, Unity should remove the associated .meta file automatically if the folder is not there anymore.
     
  10. Wilelle

    Wilelle

    Joined:
    Jun 16, 2015
    Posts:
    93
    Okay, so... Turns out the folder didn't turn into a .META, it only HAS a .META. The actual file is just called... "File". Although that doesn't improve my situation from what I can see. It only makes more sense since not specifying what kind of file it is shouldn't make it a .META, but a... well, an undefined file, I'm guessing is what it is.
     
  11. Fabian-Haquin

    Fabian-Haquin

    Joined:
    Dec 3, 2012
    Posts:
    231
    You can see there is one .meta per folder (and file).
    Capture.PNG


    The content of a folder meta file:
    Code (CSharp):
    1. fileFormatVersion: 2
    2. guid: a012ab13afa6afb4ea2b0a2854db31c7
    3. folderAsset: yes
    4. timeCreated: 1485380109
    5. DefaultImporter:
    6.   userData:
    7.   assetBundleName:
    8.   assetBundleVariant:
    9.  
    The content of a texture meta file:

    Code (CSharp):
    1. fileFormatVersion: 2
    2. guid: 6e3bf915df5d41741bda8bd0777d0003
    3. timeCreated: 1486500872
    4. TextureImporter:
    5.   fileIDToRecycleName: {}
    6.   serializedVersion: 4
    7.   mipmaps:
    8.     mipMapMode: 0
    9.     enableMipMap: 0
    10.     sRGBTexture: 1
    11.     linearTexture: 0
    12.     fadeOut: 0
    13.     borderMipMap: 0
    14.     mipMapFadeDistanceStart: 1
    15.     mipMapFadeDistanceEnd: 3
    16.   bumpmap:
    17.     convertToNormalMap: 0
    18.     externalNormalMap: 0
    19.     heightScale: 0.25
    20.     normalMapFilter: 0
    21.   isReadable: 0
    22.   grayScaleToAlpha: 0
    23.   generateCubemap: 6
    24.   cubemapConvolution: 0
    25.   seamlessCubemap: 0
    26.   textureFormat: 1
    27.   maxTextureSize: 2048
    28.   textureSettings:
    29.     filterMode: 0
    30.     aniso: -1
    31.     mipBias: -1
    32.     wrapMode: 1
    33.   nPOTScale: 0
    34.   lightmap: 0
    35.   compressionQuality: 50
    36.   spriteMode: 1
    37.   spriteExtrude: 1
    38.   spriteMeshType: 1
    39.   alignment: 0
    40.   spritePivot: {x: 0.5, y: 0.5}
    41.   spriteBorder: {x: 0, y: 0, z: 0, w: 0}
    42.   spritePixelsToUnits: 32
    43.   alphaUsage: 1
    44.   alphaIsTransparency: 0
    45.   spriteTessellationDetail: -1
    46.   textureType: 8
    47.   textureShape: 1
    48.   maxTextureSizeSet: 0
    49.   compressionQualitySet: 0
    50.   textureFormatSet: 0
    51.   platformSettings:
    52.   - buildTarget: DefaultTexturePlatform
    53.     maxTextureSize: 2048
    54.     textureFormat: -1
    55.     textureCompression: 0
    56.     compressionQuality: 50
    57.     crunchedCompression: 0
    58.     allowsAlphaSplitting: 0
    59.     overridden: 0
    60.   - buildTarget: Standalone
    61.     maxTextureSize: 2048
    62.     textureFormat: -1
    63.     textureCompression: 0
    64.     compressionQuality: 50
    65.     crunchedCompression: 0
    66.     allowsAlphaSplitting: 0
    67.     overridden: 0
    68.   - buildTarget: Android
    69.     maxTextureSize: 2048
    70.     textureFormat: -1
    71.     textureCompression: 0
    72.     compressionQuality: 50
    73.     crunchedCompression: 0
    74.     allowsAlphaSplitting: 0
    75.     overridden: 0
    76.   spriteSheet:
    77.     serializedVersion: 2
    78.     sprites: []
    79.     outline: []
    80.   spritePackingTag:
    81.   userData:
    82.   assetBundleName:
    83.   assetBundleVariant:
    84.