Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by gulliby08 · Apr 02, 2015 at 01:59 PM · metafiles

Can I generate meta files by myself

We have some files stored out of Asset folder. When used, we export them to .bytes format and copy to Asset/Resources/Filebytes. So if we add a new file, we don't have its meta file generated by Unity. Can we generate this meta file manually (not by Unity) but with the same file format of Unity ? We promise to avoid generate same GUID, and are there any other risks?

Thanks a lot!

Comment
Add comment · Show 2
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image lnz611 · Mar 08 at 05:09 PM 0
Share

Hi I have been struggling to do this myself. My main problem with generating the meta is not the metafile itself, but that my scripts are not serialized into whereever Unity places those script assemblies.. This means I cannot compile the project without openening the Unity editor. If anyone has any idea how to solve this please let me know.

@petersvp You seem to know a lot about the meta files and how they are used in unity, do you know how unity handles metafiles, guids and assemblies for scripts in the asset folder?

avatar image Bunny83 lnz611 · Mar 09 at 12:23 AM 0
Share

Do not hijack other posts, especially if your question is not directly related to the question that was asked or if the question is very old. Both facts are true here. The question was about generating asset files (bytes extension) and not script files. Also the question is 7 years old. If you have your own question, please ask your own seperate question instead of posting an Answer to an ancient question that does not answer the question.

3 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by UNZoOM · Apr 02, 2015 at 04:17 PM

No , you cannot. Reason being , you cannot generate GUID's ( as they are Auto Generated ) based on versioning which are linked to .unity package files.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0

Answer by petersvp · Apr 09, 2019 at 01:18 PM

Well, basically, you can, IF and only IF you know what you are doing.

  1. Make sure your UUID is project-wise unique. This means: you must load every single meta file in your project and build a database with used uuids (SLOW but correct!). Or you can dir-list Library/Metadata/* subfolders and use any .info file's filename as a UUID (fastest, but requires the project to be saved in unity for correct results) . This way you generate a collection of all UUIDs in your unity project.

  2. Make sure your IDS are stable. Unity does not require proper UUIDs, any 128-bit number beside zero will succeed. This means you can use md5 hashing strategy to generate uuids. Be sure you have mechanism to avoid collisions!

  3. In Unity, uuids are whatever makes, and breaks, references. When you assign a texture to material, you asign it by uuid. You need to have code to manage such links.

With this in mind you are, basically, safe to go. But! ALWAYS use Version Control. If you generate assets from INSIDE unity, prefer to use AssetDatabase. But in my case, and in any case where you generate assets procedurally, like in my case, I am generating materials with linked textures from outside of unity, you must generate exactly the same, expected YAML files with hex-parseable, project-unique 128-bit numbers as uuids.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0

Answer by lnz611 · Mar 19 at 01:39 PM

Hi, I managed to generate the metafiles manually using GUIDs that ensure there will be no collisions using a relatively simple Scala script. For assets and scenes its not as much of a problem. With scene files (not sure if you are interested in that too) it looks highly complicated but follows a nice YAML structure and is easy to do once you get it. However, with things such as C# scripts you have to be careful as they will need script assemblies. I know this post is old, but if you are still interested in this or if anyone else comes by this post looking for this feel free to contact me

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

7 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Stop MetaData coming up in FileInfo. 1 Answer

Project automatically reimports, changing GUIDs in the meta files. 0 Answers

Is it safe to share .meta files of scripts across multiple projects? 1 Answer

Are .meta files included in an APK if they are in StreamingAssets? 0 Answers

Windows Phone 8.1 compiling problem 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges