Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 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 /
  • Help Room /
avatar image
0
Question by Lapius · Sep 18, 2017 at 12:17 PM · uvuv mappingfbximporteruv coordinatesparser

UV tiling with already made coordinates.

Hi. I am making FBX parser in runtime and faced again the problem. FBX has information about vertices coordinates, IDs of those vertices how to make polygons (PolygonVertexIndex), UV coordinates, and UV indexes. Here is what you need: link text. The problem is that when I try to assign UV coordinates to mesh it says that UVs array MUST be the same as vertex array.

The problem is that mesh has 8 vertices (in the example), but Unwrapped UV has 14 vertices. One vertex on a mesh can have more than one UV coordinate vertex.

mesh.SetUVs() gives out of bounds error because vertex array is smaller than UV array.

I tried to use mesh.GetUVs() from the same object that was imported in Editor and it showed me 24 UV coordinates on the cube. While it has only 8 vertexes.

Any ideas how to put UV's with more vertices on an object while importing FBX?

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
0
Best Answer

Answer by aleksandrk · Sep 18, 2017 at 02:12 PM

Hi! The mesh you're importing has 8 vertex coordinates, not 8 unique vertices. A unique vertex would be a set of position, uv and normal corresponding to the same vertex. You can get those depending on type of data (the linked file contains "Direct" and "IndexToDirect"). Direct means that the data is (nearly) ready, IndexToDirect means that it contains some data and indices into that data that map it to final layout. The amount of vertices in the first case is given by the number of entries in the array, and by the number of indices in the second case. To build the final triangles you need the data from PolygonVertexIndex, which gives you the indices of vertex coordinates, the data from normals and the data from UVIndex, which gives you the indices of UV coordinates.

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 Lapius · Sep 19, 2017 at 10:35 AM 0
Share

So basically I need to create as many vertices as PolygonVertexIndex shows, map normals, and UVs?

avatar image aleksandrk Lapius · Sep 19, 2017 at 10:43 AM 0
Share

Yes, that's correct.

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

114 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 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 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 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 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

Assigning uv's to multiple faces 1 Answer

Help setting UV coordinates for code-generated plane 0 Answers

I want reverse(?) spherize 0 Answers

Distorted/Warped Textures On Character Model After Bundling For Tabletop Simulator/In A Build 1 Answer

How can I change the UV's on a font and then save it so that these changes are permanent? 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