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
1
Question by timothy-s-dev · Sep 17, 2013 at 06:21 AM · c#animationgraphics

What is the best way to return a deformed mesh to its initial shape?

I've been toying around with mesh deformation lately, but I've noticed that the mesh seems to save it's state between session - in order to make it return to its original shape I have to close out of Unity entirely. Is there any convenient way to force the mesh back to its original shape when the session ends? (Or at any point, for that matter). At the moment, my only thought is to store the initial positions of every vertex, and then restore those positions when I'm done, but I'm not entirely sure how to detect the end of the test session (when I "unclick" the play button in Unity), and feel like there ought to be a more elegant solution.

Comment
Add comment · Show 1
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 Fattie · Sep 17, 2013 at 08:09 AM 0
Share

A simple solution is just copy it when you are "beginning work". Use only the copy.

This can avoid the tremendous confusion of what the hell "shared$$anonymous$$esh" means, etc :)

1 Reply

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

Answer by syclamoth · Sep 17, 2013 at 06:25 AM

This... really shouldn't be happening. Make sure you instantiate the mesh at the beginning of the session, and edit that- otherwise you are editing the imported base mesh, which you probably don't want to do. Either way, you can simply use 'OnApplicationQuit' to detect when the session ends, but as you say that's not very elegant.

Comment
Add comment · Show 3 · 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 Bunny83 · Sep 17, 2013 at 07:01 AM 2
Share

Actually most direct changes to Assets will persist, even when changed at runtime. Only stuff placed in a scene is reverted because that is serialized / deserialized. The imported $$anonymous$$esh data is stored in the library folder. It's only loaded when you start Unity / your game. All changes you made will persist until you restart the application. The changes might even persist a restart once Unity has invalidated the asset and store it back to disk.

If the mesh was an imported FBX, the FBX isn't changed, but the imported $$anonymous$$esh. You can reimport the FBX asset at any time to revert any changes to the imported mesh. At runtime the only way is to restart the application.

avatar image Fattie · Sep 17, 2013 at 08:06 AM 0
Share

yup, this is the "normal, annoying, confuising at first" behaviour!

avatar image timothy-s-dev · Sep 17, 2013 at 01:37 PM 1
Share

Ah! Thank you very much, used this and Fattie's comment - now I'm creating a copy of the mesh in Start(), and only making changes to that. Thanks, both of you!

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

18 People are following this question.

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

Related Questions

Unassigned Reference Exception 4 Answers

Animated Texture Offset 1 Answer

adding animation dynamically by script 0 Answers

Playing an animation with C#? 1 Answer

SendMessage not working While Animator is Enabled 0 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