Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
2 captures
13 Jun 22 - 14 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 _Petroz · Jun 21, 2012 at 09:48 PM · editormeshassetdatabase

Creating a Mesh asset inside the editor

I am trying to save a generated Mesh from an imported .obj file. I basically take a sphere which I have created and UV mapped in blender and then modify it. This works fine, I get exactly the result I want, now I want to save out this new mesh as an Asset, which is where I have trouble.

When I try to save the Mesh using AssetDatabase.CreateAsset, i can see an object in the Project panel but it has no type, inside explorer I can see that it's a 64kb file. Do I need to add a file extension?

When I look at the Meshes I have imported they seem to be multiple objects is this necessary or is it possible to save a single Mesh asset by itself?

I have tried using the objexporter script from the Unify wiki but the UVs get ruined in the process.

Any help would be greatly appreciated.

Comment
Add comment
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

1 Reply

· Add your reply
  • Sort: 
avatar image
3
Best Answer

Answer by Jessy · Jun 21, 2012 at 10:15 PM

.asset

It says so right here.:

You must ensure that the path uses a supported extension ('.mat' for materials, '.cubemap' for cubemaps, '.GUISkin' for skins, '.anim' for animations and '.asset' for arbitrary other assets.)

Comment
Add comment · Show 6 · 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 _Petroz · Jun 21, 2012 at 11:25 PM 0
Share

What would I do without you Jessy?! I'll try this when I get home. Thank you so much.

avatar image _Petroz · Jun 22, 2012 at 12:09 PM 0
Share

It works perfectly, thank you again!

avatar image Steazy · Jul 15, 2015 at 01:43 AM 0
Share

*Edit - Docs have moved, but still state the same thing. $$anonymous$$e == dumb.

http://docs.unity3d.com/ScriptReference/AssetDatabase.CreateAsset.html

BTW I don't feel like this is a very good answer. That page just contains a partial list of asset extensions and states "'.asset' for arbitrary other assets". If that's the only information you're using then you're effectively resolving the "case not implemented" error by adding an empty default and calling it a day without even looking at the code involved. This happens to be correct in this case, just like a broken clock, but it is quite misleading... (that's more on the Docs than your answer though).

avatar image Stevens-R-Miller · Mar 09, 2020 at 12:37 PM 0
Share

Thanks for the updated link, Sleazy. When linking to an answer, it is always best to include the gist of the answer as well, or else a Google phrase that is likely to find it again when its URL changes.

avatar image Bunny83 Stevens-R-Miller · Mar 09, 2020 at 02:35 PM 1
Share

You're right. I've fixed the documentation link in the answer and added a quote of the essential part :)


I'd like to add (because S$$anonymous$$zy seems to be somewhat upset by the docs) that the ".asset" extension can be used for any kind of asset, even materials, GUISkins, ... Unity's asset format is kind of "universal". You can also pack multiple assets into one asset file. See AssetDatabase.AddObjectToAsset

avatar image Stevens-R-Miller Bunny83 · Mar 09, 2020 at 04:44 PM 0
Share

Hey, thanks for doing that. Just to round it all out: I've been using the .mesh extension explicitly and it works fine in 2018.4.

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

6 People are following this question.

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

Related Questions

Proper way to update AssetDatabase after creating assets? 0 Answers

Proper way to refresh asset 0 Answers

Get dynamic persistent asset reference 0 Answers

How do I wait until after AssetDatabase creates an assets before carrying out another function ? 0 Answers

How do I access Mesh/ Meshfilter in Editor code? 3 Answers


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