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
1
Question by artie · Aug 01, 2012 at 12:03 AM · materialsubmesh

How does submesh index map to material?

What I did was make a cube in Sketchup, set each side with a different material, exported as 2-sided FBX, imported to Unity. As expected, there are 7 materials (one for each exterior face and one for the 'inside' faces). And 24 triangles (2 per face, and 2 sets of those per side of the cube (exterior and interior). I examine the triangle index from the raycast hit, and using Scrooge's script, find the submesh. The index I get does not correspond to the order a that materials are listed in the IDE. So is there something I'm missing, is there a hidden API or member that maps submesh to material?

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 ScroodgeM · Aug 01, 2012 at 05:35 AM

i'd check it right now. submesh index and material index are the same. both are zero-based. if you get another result somewhere - show us example.

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 artie · Aug 01, 2012 at 07:01 AM 0
Share

See other post. Will put up screen shots tomorrow. Basically (using your script) I do get submesh indices 0 to 5 as expected (hitting exterior triangles of course), but the materials on those triangles don't follow the same order as what I see listed (top to bottom) in the inspector. Well now that I think of it, I'm looking at the material sample list (on the object), not the array of materials (by name) on the $$anonymous$$eshRenderer. $$anonymous$$aybe those don't jibe? Anyway, will check manana.

avatar image ScroodgeM · Aug 01, 2012 at 04:38 PM 0
Share

waiting for screenshots 8)

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

7 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

How can I ensure Unity does not rearrange the sub-mesh order of a mesh from Maya?,How can I ensure Unity does not rearrange sub-mesh order of a mesh? 0 Answers

Combining blender submeshes 3 Answers

How to work with submeshes in editor 1 Answer

Assign new material to submesh? 1 Answer

Why is it possible to add additional materials to a model, beyond its sub-mesh count? 4 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