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 rambramdt · Dec 14, 2011 at 06:24 AM · importblenderverticescoordinates

Importing shapekeys from Blender

hi, I have some issues with importing shapekeys from Blender. I tried MetaMorph by folishFrost and it worked, but I would like to export the shapekeys in C# so that I can use them directly, because loading dozens of image files and extracting shapekey information from them can take quite some time. I am also avoiding using UV because it looks like in Blender the uv values are associated with faces, while in Unity they are associated with vertices. I am hoping to map the vertices directly between Blender and Unity.

Like always, I ran into a few problems.

  1. The order of the vertices are changed when a mesh is imported from blender into unity. Online searching told me that this is because the coordinate systems are different. Is there a simple way to restore the vertex order?

  2. I tried to look up the vertices one by one by coordinates. I mapped the coordinates like this: Xu = -Xb; Yu = Zb; Zu = -Yb (u for unity and b for blender). I found no match :( There was no scaling or translation of the mesh (would that have mattered?).

  3. It seems to me that in order to update the mesh, one must reassign the vertices property of the mesh.vertices. Modifying individual vertices (e.g. mesh.vertices[0].x += 1.0 ) doesn't work. Is that supposed to be?

Please help me out. And if I am mistaken in anything, please point them out as well. Thank you!

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

5 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by Foolish Frost · Dec 23, 2011 at 10:49 PM

Perhaps you're fighting the wrong fight.

How about taking the pair of arrays metamorph makes from the images (the index of verts effected, and the shift of those verts) and just save them to a text file. Then have the game look for that text files and read it on gamestart?

also, if you can preload characters in the background, you can just have it yield every 10-100 lines of textfile read to stop lagging as well.

Good luck!

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 rambramdt · Dec 26, 2011 at 10:21 PM

Thank you, Foolish Frost! I did not expect a direct answer from you. I learned a lot from your script. It led me into the door of mesh scripting.

I figured out how Unity imports vertices from Blender: it inverts the X coordinates then rotate around the X axis by 270 degrees without changing the local coordinates further. I was able to find the vertices in my C# script. Still, I could use a few advices:

  1. I had some spikes when using MetaMorph -- singular vertices moving along their normals creating long spikes. Do you know what could have cause this problem? Could it be caused by the UV unwrapping process? Is there a recommended UV unwrapping method for MetaMorph?

  2. I do not know how to preload characters in the background. Can you give a few pointers on that?

Many thanks and happy holiday!

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 Foolish Frost · Dec 27, 2011 at 01:59 AM

Well, some hings to keep in mind:

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 Foolish Frost · Dec 27, 2011 at 01:58 AM

Well, first things to check:

  • Did you set the texture to 24 bit color compression import in unity?

  • Is the mip-map turned off in unity for that texture?

  • Did you make sure the UV map never overlapped on he model?

Most of the issues are due to the image being processed like a texture, instead of as pure data.

As to preloading, that about programming: I don't offer that as a part of the free scripts since it was a tech demo. It's expected to be handed t a coder for tweaking for specific cases, more than as a final solution.

Preloadings is taking the data arrays made from the textures, and saving them as files that can be loaded again later without processing every vert in the mesh again.

The problem with that is, if you reimport the mesh, then you may need to re-process the vert movement data for metamorph. Again, I wish I could be more specific, but I'm currently on some projects with tight deadlines breathing down my neck.

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 rambramdt · Dec 27, 2011 at 03:18 AM

Thank you, Foolish Frost! I will look into those issue. Good luck on your project.

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 DayyanSisson · Dec 27, 2011 at 04:19 AM 0
Share

When someone answers your question, put comments under where it says "add new comment", so we keep comments as comments and keep answers as answers.

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

5 People are following this question.

avatar image avatar image avatar image avatar image avatar image

Related Questions

Importing from blender. 1 Answer

Fatal error with import from Blender 2 Answers

Blender transparent model Import and wierd line appears 0 Answers

Blender to Unity faulty Skinned Mesh Renderer. 0 Answers

Blender animations 4.6 to Unity 4 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