0

I downloaded a very complex house / mansion model fromonine, and I want it to now work with unity.

As many know, if I simply put a mesh collider on this huge complex house mesh in unity, things wouldn't work out.

So my plan is to somehow automatically split this very complex house into many smaller, simpler meshes. For example, in a place where there are complex decorated pillars supporting the roof, that would create a simple cylinder mesh to overlap, and so on for all of the mesh-shapes built in to the model (then obviously in unity I would just loop through all meshes except the original and add a mesh collider o each one individually).

The thing is: I have abolutely no idea how to do this, just pressing P -> by loose parts does nothing, since it's one solid object, so I suspect some python script might be the solution, but I have no idea how to start with that.

So basically: yeah.

EDIT: found the answer here: All Faces to Individual Objects

  • Does it have materials? seams? Generally a script is written to emulate what you can do in the UI. If it gets to complex, it may be quicker to select and tag somehow manually. – batFINGER Oct 05 '18 at 15:04
  • no materials, I don't know what "seams" are, it's just one big single-mesh complex house that I want to split up automatically into many smaller parts, it would take forever seleting every pillar manually or re-making cylinders around each one... I don't care about materials or anything, this is only for a collision mask so all of the parts will be invisible – B''H Bi'ezras -- Boruch Hashem Oct 05 '18 at 17:44
  • TO be lear: Im trying to automatically generate many simple-meshes based on one complex mesh – B''H Bi'ezras -- Boruch Hashem Oct 05 '18 at 17:44
  • Great that you have found an answer splitting mesh into objects from faces. Make it an answer and elaborate.. A mesh can be split by materials or seams. Even if materials are not supplied, they may be assigned to faces. What is not clear is the mesh other than it's downloaded from the net, complex and a house. The latter is about the only shred of info that may be of some use to write a script. For example if a face on pillar has certain area. edge lengths, z location range, etc in common with all other pillars can use this to select, then filter by connection to weed out mismatches. – batFINGER Oct 06 '18 at 04:33
  • @batFINGER thanks for the input but I didn't exactly get the last point you were saying, were you suggesting how to merge the faces back together? 'Cause that's the only problem: first, it takes a long time for blender to make a separate object out of each for for like 4000+ faces, and also in unity if each face is a separate game object that would be a lot of processing, so prefferably I would like to recombine them, but I'm not sure how exactly? – B''H Bi'ezras -- Boruch Hashem Oct 07 '18 at 03:36
  • The mesh already has the faces and their locations. Splitting them into separate objects is the same problem. What I suggest is for a column (eg) if it has two edge rings you can select them using the UI. Selecting the bridge between them will be the faces in that column. The mesh can be searched for similar edge rings in same plane to process columns. Outer walls will have large areas and normals on the XY plane. Use a live bmesh in the py console to test as you go. Too broad, (and impossible without seeing mesh) to answer. Could put together an answer re method above to find cols. – batFINGER Oct 07 '18 at 06:02
  • @batFINGER well manually doing it would be impossible, but I actually just realized a really (silly and simple) solution that I didn't chcek originally: if you just adda regular mesh collider in unity, it works fine with a character controller collision, as long as the skin with is more than about 0.01, its only that it oesn't work for a rigidbody in unity, so for the time being my issue is solved, but if someone else would want to have rigidbody support, this question still stands – B''H Bi'ezras -- Boruch Hashem Oct 07 '18 at 06:56

0 Answers0