Re: Add "o" to OBJWriter output

by sjb007 » Wed Jun 22, 2022 2:55 pm

For anyone wondering, this can be wordarounded in Blender by simply turning on backface culling for the ceiling material.

An alternative could be to export each room 2 times as 2 separate objects, one with both ceiling and floors, and one with floor only (the Room3D constructor has a ignoreCeilingPart parameter that can be used for this purpose).

The third option is to use the second option, with the addition to select only the ceiling node:

Code: Select all

Room3D room3D = new Room3D(room, home, false, true);
Node floor = room3D.getChild(0);
writer.writeNode(floor);
if (room.isCeilingVisible()) {
  Node ceiling = room3D.getChild(1);
  writer.writeNode(ceiling);
}
Once again making a bid for Most Valued Player I see. [;)]

That was very helpful, although I've slightly modified the idea. Floors and Walls are entirely separate, and members of separate collections, so I can hide ceilings in one tap.

I've posted the first real proof of concept to the ticket in comment 1 of this thread. It all works perfectly on my 90 MB exported obj file. It would be useful if some others could give it a try and see if it works for them.

I just had the thought that the reverse could be done. Blender export to obj, and a special mode for SH3D to reimport. Roundtripping between the two. But I'm not think about that right now.

I am still thinking about the plugin idea, but I just don't know if I have the Java chops to be able to do that.

I'm noticing quite a few issues in Blender with flipped normals. This makes backface culling look quite bad, and tends to butcher the textures/smoothing. I'm not sure if this is poor quality models, the export, or the import. Whatever it is, it is not my code, because I'm not monkeying around with that stuff.