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 iron_attorney · Jun 25, 2015 at 12:58 PM · meshblenderverticesmeshfiltergeometry

Number of mesh vertices increase when imported into unity

Hi there, I have made a number of basic shapes in blender (ico spheres, cubes etc). When I import the shape into unity (either as a fbx or 3ds file) the amount of vertices drastically increases. I know this because I have a script which is storing the array of vertices, and then debuging the size of the array.

As an example, my ICO sphere has 962 verts in blender, and 3840 verts in unity. This is nearly, but not quite, 4 times the amount of verts. Why is this? I have read in other posts about unity's basic shapes having double verts, but nearly 4 times more is crazy (especially because it's not exactly 4 times more, that's what puzzles me the most!).

Incase it's of any consequence to the answer, I am going to procedurally ater the shapes in semi-random ways.

Cheers in advance,

Pete

Comment
Add comment · Show 7
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 Kirbyrawr · Jun 25, 2015 at 01:01 PM 0
Share

Hi, are you sure you are not exporting all the objects, you should export only the one you have selected

avatar image iron_attorney · Jun 25, 2015 at 01:10 PM 0
Share

That depends what you mean by all the objects. With the first few I exported with the camera and light aswell. After reading your answer, I thought I best check for an option to export just selected object, and I exported a basic cube with 8 verts. This time i definately just for the cube and it has 24 verts.

I understand what's going on, it's counting every corner of each of the 6 squares ins$$anonymous$$d of just counting the 8 intersecting corners, which I guess must be what's going on with my ICO cube. But is there a way to stop this happening? I'm considering writing some code to compare all vertices, find the repetitions and recreate a mesh without any repetitions. I'm hoping there's an easier way :D

Cheers for the ultra fast response man!

avatar image termway · Jun 25, 2015 at 02:03 PM 0
Share

Do you have modifier (like subsurf) ?

I know this because I have a script which is storing the array of vertices, and then debuging the size of the array.

It's maybe an error in your script, can you provide the counting part ? To be sure, you can also use the mesh view in Unity to get vertices number.

avatar image iron_attorney · Jun 25, 2015 at 02:22 PM 0
Share

I've just tried out the mesh viewer from the assets store if that's the one you're talking about, i can't get it to work. I'm pretty confident that that's correct though, because when I procedurally alter the positions of all the vertices, the cube is split up into 6 seperate squares. Here's the script anyway:

 meshFilter = GetComponent ();

     List<Vector3> vertices = new List<Vector3> ();

     $$anonymous$$eshFilter meshFilter;
     int vCount;

     void Start () {

         vertices.AddRange (meshFilter.mesh.vertices);

             // I was using an array originally, and that showed the same results
 //        Vector3[] vertices = meshFilter.mesh.vertices;
 
         vCount = vertices.Count;
 
         Debug.Log (vCount);

     }
 }

avatar image iron_attorney · Jun 25, 2015 at 02:26 PM 0
Share

Ah no, I've got a different mesh viewer working, and it does indeed have 24 vertices.

Show more comments

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by hexagonius · Jun 25, 2015 at 02:49 PM

I would say you're using hard edges for your icosphere. 3840 / 3 gives me a rounded 1280, and it's divided by three because an icosphere consist of triangles, not quads. This means every vertex is tripled and that is because of multiple vertex attribute per vertex, which Blender might handle but Unity doesn't. In your case that's the normals, one for each adjacent face.

Therefore the amount is perfectly valid. Same for the cube, which equals the Unity primitive cube with 24 vertices.

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 iron_attorney · Jun 25, 2015 at 04:11 PM 0
Share

In blender, the icosphere had 962 verts, not 1280. 3840 / 4 = 960, so it's just under 4 times the amount, not 3.

That asside, I've read documentation that suggests making primatives in blender or similar to overcome the issue of unity primatives have multiple verts per intersecting vert. ie, a cube can have only 8 verts, but the way unity creates them makes them have 24. I'm trying to make the 8 vert version.

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

24 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

Related Questions

Mesh Vertices Welding 0 Answers

Mirror vertices procedurally 2 Answers

Selecting a single polygon / face at runtime 1 Answer

Extruding faces of a mold. Need to properly assign vertices to triangles 0 Answers

How to Reference Vertices of a Mesh of a meshFilter of a GameObject? 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