|
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?
(comments are locked)
|
|
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. 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 MeshRenderer. Maybe those don't jibe? Anyway, will check manana.
Aug 01 '12 at 07:01 AM
artie
waiting for screenshots 8)
Aug 01 '12 at 04:38 PM
ScroodgeM
(comments are locked)
|
