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 Xarro92 · May 04, 2011 at 05:56 PM · meshrenderervertexsharedskinned

Manipulate skinned mesh?

I need to manipulate the vertex of a skinned mesh, but not its sharedMesh (beacuse it remain deformed also when i stop the game). How i can do?

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
4

Answer by sneftel · May 04, 2011 at 07:40 PM

Copy the mesh on startup, so that you're operating on the clone instead:

void Start() {
  Mesh oldMesh = GetComponent<SkinnedMeshRenderer>().sharedMesh;
  Mesh newMesh = (Mesh)Object.Instantiate(oldMesh);
  GetComponent<SkinnedMeshRenderer>().sharedMesh = newMesh;
}
Comment
Add comment · Show 2 · 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 Xarro92 · May 05, 2011 at 12:08 PM 0
Share

I used with javascript:

var new$$anonymous$$esh : $$anonymous$$esh;

function Start() { var old$$anonymous$$esh = GetComponent("Skinned$$anonymous$$eshRenderer").shared$$anonymous$$esh; new$$anonymous$$esh = old$$anonymous$$esh; GetComponent("Skinned$$anonymous$$eshRenderer").shared$$anonymous$$esh = new$$anonymous$$esh; }

function Update () { var mesh : $$anonymous$$esh = GetComponent(Skinned$$anonymous$$eshRenderer ).shared$$anonymous$$esh; var vertices : Vector3[] = mesh.vertices;

for (var i = 0; i < vertices.Length; i++) vertices[i] += Vector3.up * Time.deltaTime/100;

mesh.vertices = vertices; mesh.RecalculateBounds(); }

But when i stop the game in the editor the skidder mesh dont return to its original... is permanent modified.

avatar image Xarro92 · May 05, 2011 at 12:14 PM 0
Share

With Instantiate it works very well, thank 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

No one has followed this question yet.

Related Questions

Prefab can't be transformed in editor after import from a package. 1 Answer

Skinned mesh doesn't appear when imported in unity and the animation is not there 4 Answers

Preventing run-time mesh deformations from altering the underlying FBX file 1 Answer

Access skinned mesh vertices 2 Answers

Smoothing Errors with Skinned Mesh Renderer 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