dicarlolab / ThreeDWorld

Generator of interactive Unity-based 3D environments with physics
Other
21 stars 4 forks source link

Errors in creating batches of prefab models #15

Closed yamins81 closed 8 years ago

yamins81 commented 8 years ago

@sharatb

The is that arose the other day in converting batches if 3d models to prefabs is ending up being pretty problematic. Basically, the phenomenon that occurs is something like 1) I'll click on a folder of models to convert, and run the creation function from the tab. 2) The system will convert about 10 models or so fine 3) Then it slows dow and stops converting. Eventually some kind of error message is thrown, sometimes about a "mesh is referenced but no longer exists", and sometimes something else.
4) Unity freezes. 5) when I restart unity, none of the meshes that previously appear to have been converted have anything saved -- or sometimes, there's some prefab saved, but it's not complete (e.g. has only a one or two of the collision meshes included)

We suspected that this was a memory problem at first, but I ran this on a machine with > 12GB, and monitored memory usage the whole time. I observed the problem even though the system had not run out of memory. I tried this on two different OSX machines and observed the same problem. When looking in the unity editor log I unfortunately don't see anything that looks related to the problem.

So, @sharatb, can you see if this problem is happening on your machine? That is, import a whole directory of models from the /home/yamins/test_vhacd directory and then run the prefab creation function on that directory. Can you recreate the problem? Or is it specific to OSX?

sharatb commented 8 years ago

I added some logic to cause to operation to wait a bit after updating each object. Let me know how it goes.

yamins81 commented 8 years ago

Sharat --

This seems not to resolve the problem. Still encountering the same problem. See attached log.

On Mon, Mar 28, 2016 at 12:26 PM, sharatb notifications@github.com wrote:

I added some logic to cause to operation to wait a bit after updating each object. Let me know how it goes.

— You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub https://github.com/dicarlolab/ThreeDWorld/issues/15#issuecomment-202471501

sharatb commented 8 years ago

Hey, you didn't actually attach a log file. Also, when I ran it on my machine(after commenting out some unrelated code to make it 5.1 compliant) I was able to convert the entire lopoly animals folder in one go with no problems.

yamins81 commented 8 years ago

@sharatb the log file is attached by a direct email since it's large.

yamins81 commented 8 years ago

@sharatb the new fix seems to work.

One thing that I find confusing, however, is that the prefab creation function only seems to start a new prefab if the unity editor window is actively selected -- e.g. right now, while I'm typing this in the browser, the previous prefab creation ended, and the new one will not start until I re-select the editor window. Is that expected behavior?

sharatb commented 8 years ago

Hmm... that makes sense as a side effect of my earlier change that delays each iteration.

On 3/28/2016 9:10 PM, Dan Yamins wrote:

@sharatb https://github.com/sharatb the new fix seems to work.

One thing that I find confusing, however, is that the prefab creation function only seems to start a new prefab if the unity editor window is actively selected -- e.g. right now, while I'm typing this in the browser, the previous prefab creation ended, and the new one will not start until I re-select the editor window. Is that expected behavior?

— You are receiving this because you were mentioned. Reply to this email directly or view it on GitHub https://github.com/dicarlolab/ThreeDWorld/issues/15#issuecomment-202652036

yamins81 commented 8 years ago

Is there a way to change that? It makes it difficult to actually use on an active computer, because it means I have to have Unity highlighted all the time.

sharatb commented 8 years ago

Yeah, I'll put in a change sometime before lunch. -Sharat

On 3/29/2016 9:19 AM, Dan Yamins wrote:

Is there a way to change that? It makes it difficult to actually use on an active computer, because it means I have to have Unity highlighted all the time.

— You are receiving this because you were mentioned. Reply to this email directly or view it on GitHub https://github.com/dicarlolab/ThreeDWorld/issues/15#issuecomment-202890034

yamins81 commented 8 years ago

Great thanks!

On Tue, Mar 29, 2016 at 9:31 AM, sharatb notifications@github.com wrote:

Yeah, I'll put in a change sometime before lunch. -Sharat

On 3/29/2016 9:19 AM, Dan Yamins wrote:

Is there a way to change that? It makes it difficult to actually use on an active computer, because it means I have to have Unity highlighted all the time.

— You are receiving this because you were mentioned. Reply to this email directly or view it on GitHub < https://github.com/dicarlolab/ThreeDWorld/issues/15#issuecomment-202890034

— You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub https://github.com/dicarlolab/ThreeDWorld/issues/15#issuecomment-202894823

sharatb commented 8 years ago

I pushed a fix. Let me know if it has any problems.

On 3/29/2016 9:52 AM, Dan Yamins wrote:

Great thanks!

On Tue, Mar 29, 2016 at 9:31 AM, sharatb notifications@github.com wrote:

Yeah, I'll put in a change sometime before lunch. -Sharat

On 3/29/2016 9:19 AM, Dan Yamins wrote:

Is there a way to change that? It makes it difficult to actually use on an active computer, because it means I have to have Unity highlighted all the time.

— You are receiving this because you were mentioned. Reply to this email directly or view it on GitHub <

https://github.com/dicarlolab/ThreeDWorld/issues/15#issuecomment-202890034

— You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub

https://github.com/dicarlolab/ThreeDWorld/issues/15#issuecomment-202894823

— You are receiving this because you were mentioned. Reply to this email directly or view it on GitHub https://github.com/dicarlolab/ThreeDWorld/issues/15#issuecomment-202902939

pbashivan commented 8 years ago

Ultimate Game Tools Library had a method called readVRML which would read the wrl file and extract meshes from it, however, a line of code had a condition which checked the number of triangles per c.hull, and would not let this number exceed 255. However the attribute used for checking this actually gave 3 times the number of triangles in the hull, thus excluding some legal triangles. Further vhacd has a tag: maxNumVerticesPerCH which was set to 255. We have decided that that minimum number of vertices it would take to form a mesh of 254 triangles would be 129 vertices. The mesh that would form this would be two n-sided pyramids sandwiched together at the bases. If you can think of a case that uses fewer vertices, let us know.