Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 11 Next capture
2021 2022 2023
1 capture
11 Jun 22 - 11 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 castor · Jul 14, 2015 at 04:12 AM · mecanimswapskinning

Mecanim - swap Skinned Mesh Renderer

I have a character in my game and I want to swap the SkinnedMeshRenderer.sharedMesh during game.

I made 3 models and exported them from 3DsMax as FBX. (A,B and C) They also only have one material per model.

In Unity the game character uses Model A and the other models Avatar Definition is copied from Model A. Model B has the same polycount as Model A, works well and I can swap with no problem. But the problem is with Model C, which has a different polycount, and when swapped, I get stretched polys. alt text

But Model C seems fine, it has the same bone names, just a different polycount. Also if I import it by itself (without swapping the sharedMesh) it works properly. It's only when I swap the mesh from Model A that I get this issue.

Help very appreciated!

skinerror.jpg (180.9 kB)
Comment
Add comment · Show 4
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 Thromshall · Nov 16, 2016 at 07:26 AM 0
Share

I need help with his as well as I have the exact same issue.

avatar image Keby Thromshall · Mar 01, 2017 at 12:30 AM 0
Share

I have the same exact issue. Bumping this thread hoping to find an answer

avatar image Keby · Mar 01, 2017 at 07:22 AM 0
Share

I have the same exact issue. Resurrecting this in hopes that someone can answer.

avatar image koyima Keby · Mar 06, 2018 at 08:55 AM 0
Share

See my reply below

2 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by koyima · Mar 14, 2017 at 02:26 PM

This is not a bug. You can't just swap geometry, there are vertex weights to consider, which are dependent on vertex indices, which are different for different models.

To solve this would be to create a whole rigging transfer solution, which is beyond what Unity offers in general, so I don't see it happening. You have that capability in most professional 3D apps which you use to author your 3d content.

There are two main options here:

1) have all three models under a main object and turn off the ones you don't want to be visible.

2) make a scene in your 3d app, in which all 3 models are using the same skeleton, then you have 3 skinned mesh renderers, which you can enable and disable at will, it is similar to the first option, but you will only have one hierarchy, but you need to be able to author the new file, which might be out of scope for you (as it is out of scope for Unity to offer such tools).

Comment
Add comment · Show 5 · 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 Thromshall · Mar 14, 2017 at 03:09 PM 0
Share

All of the models I have tried swapping use the same skeleton. Therefore, the information about vertex weighting is still relevant to the rig. I'm not talking about throwing new geometry on willy nilly.

Yeah, I guess I could just completely swap skinned mesh renderers as well for this, just makes it a pain when I have to randomly swap other body parts, as I'm making a zombie shooter where the zombie can spawn with one of 10 heads and one of 10 bodies.

avatar image koyima Thromshall · Mar 14, 2017 at 03:20 PM 0
Share

Nope, the information is stored according to the mesh and is per vertex, yes of course the rig is relevant, but if the vertex numbering isn't the same you can't do anything with that info, because suddenly vertex #100 which is on the arm in one model is on the hand in the other.

I know what I'm talking about, I have actually already done what you want to do as well:

https://www.youtube.com/watch?v=-bAJ$$anonymous$$9T_7s0

avatar image Thromshall koyima · Mar 14, 2017 at 03:23 PM 0
Share

That's pretty legit. So what was your method? Did you simply swap out skinned mesh renderers?

Show more comments
avatar image
0

Answer by GStoll · Mar 05, 2018 at 11:19 PM

I was having a similar issue, we were using the same rig for multiple skinned mesh uniforms that we planned on swapping during run-time.

I found out my bind setting settings in Maya had "Remove unused influences" turned on by default which from my experience leads to the exact issue in your screenshot. I'd recommend finding a similar setting in 3Ds Max and re-skinning the characters to see if it helps.

I hadn't found anyone else mention this setting so I figured it might be worth it to make this post.

Hope this helps!

Comment
Add comment · Show 1 · 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 koyima · Mar 06, 2018 at 08:58 AM 0
Share

What you are experiencing is bone weights that are not correctly setup, this setting is there to remove artifacts that may exist because you haven't been super careful with your weight setup.

The result is similar, but the cause is not the same.

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

25 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 avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Why does my Mecanim mesh have dead vertices? 1 Answer

Animator state not activating immediately.(URGENT) 0 Answers

Why my mecanim animated model is flying away when walking on an uneven terrain. 2 Answers

Animation clip slow down error 0 Answers

Mecanim hand/arm look at target (Aim), not pro? 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