Boolean Nodes flipping normals on some faces of exported objects?

   4965   9   2
User Avatar
Member
67 posts
Joined: May 2016
Offline
Hi there, I am experiencing issues with the use of Boolean Nodes and the faces being flipped in exported .fbx files (I have seen the same in .obj files too). I have re-created a project and I have attached screenshots to demonstrate.

I am using 16.0.552 under Win10. Here is the project (.hiplc) file [dl.dropboxusercontent.com]. Here is the exported (.fbx) file [dl.dropboxusercontent.com].

Here is my geo from within the 3D Viewport (with “remove backfaces” display setting on):



Here are the nodes:



Here is the Boolean node settings:



And here is what the exported geo looks like in FBX Review:



And Modo Indie 10.2:



Can anyone tell me why that face normal is flipped?
User Avatar
Member
806 posts
Joined: Oct. 2016
Offline
Hi,

I did a quick test, exporting the result of the boolean operation as an OBJ and loaded that into modo90x. Works correctly that way.
Yet, exporting as alembic of FBX creates that inverted face normal. I wonder if the problem is related to the polygon being an ngon? I also played with some other geometries (box+box) and always get an inverted normal with FBX/Alembic.

One solution could be to use the boolean outputgroups and transfer normal directions from the original geometry to those. But that's probably a case-depending solution.

Marc
---
Out of here. Being called a dick after having supported Houdini users for years is over my paygrade.
I will work for money, but NOT for "you have to provide people with free products" Indie-artists.
Good bye.
https://www.marc-albrecht.de [www.marc-albrecht.de]
User Avatar
Member
67 posts
Joined: May 2016
Offline
Yeah I just tried OBJ and it worked for me too. I'm pretty sure in the more complicated project where I first saw this, OBJ == FBX in this regard. I could stick with OBJ, however it gives the object the name “default” in Unity, which is a bit of a pain.
User Avatar
Member
67 posts
Joined: May 2016
Offline
Malbrecht is onto something with the n-gon. If I whack in a Divide node the issue goes away:

Edited by trojanfoe - March 21, 2017 03:07:45
User Avatar
Member
134 posts
Joined: Dec. 2006
Offline
Hi, you should probably try to add a little more information in your box1, a division of 3,3,3 works just fine.

Or a divide
Edited by willh - March 20, 2017 15:51:40
User Avatar
Member
67 posts
Joined: May 2016
Offline
Ah, so more geometry in the boolean helps too?
User Avatar
Member
1743 posts
Joined: March 2012
Offline
It looks like the Boolean node is working fine. It shouldn't need any brickering or triangulating in advance.

It looks like FBX requires a reversed winding order from Houdini, but that's being handled, (though there's a small inconsistency in vertex order when re-importing, but the winding is okay). However, from a few Google searches, it sounds like a lot of other programs don't support importing ngons from FBX, so they just show up as invisible. If you put down a Font SOP and export that, is it visible from either side in FBX Review or Modo?
Writing code for fun and profit since... 2005? Wow, I'm getting old.
https://www.youtube.com/channel/UC_HFmdvpe9U2G3OMNViKMEQ [www.youtube.com]
User Avatar
Member
806 posts
Joined: Oct. 2016
Offline
Hi,

modo is fine with importing ngons … it actually does import the ngon cleanly, but the face is flipped (you can flip it back or see it from the other side) - both in FBX and in Alembic. With obj the face is not flipped.

Winding order may well be a reason, but I would assume the winding is the same if you split the cube before the boolean … we could also have a look at it in Blender (which handles ngons fine as well), but since FBX Review seems to agree on the face looking backward … hmm …
I don't see a “bug” as such in there, since ngons should be avoided anyway, but it sure is an interesting puzzle.

Marc
---
Out of here. Being called a dick after having supported Houdini users for years is over my paygrade.
I will work for money, but NOT for "you have to provide people with free products" Indie-artists.
Good bye.
https://www.marc-albrecht.de [www.marc-albrecht.de]
User Avatar
Member
1743 posts
Joined: March 2012
Offline
After looking into this a bit more, FBX Review and Maya are fine with ngons and their winding order, but they're not fine with the bridge, i.e. the edge shared between primitive 78 and itself. They both skip that polygon entirely. If I explicitly split the polygon into 2 by adding another edge with PolySplit, it imports fine in FBX Review (and presumably Maya). I'm not sure on a good way to automate that, apart from triangulating any face that has at least two vertices sharing the same point.

We could probably use FBX's support for explicit hole polygons when exporting, though that could be complicated to get right. There'd be a lot of cases that interface wouldn't support, but it might be possible to get something to work for most cases. If you'd like that, feel free to submit an RFE for it. Alternatively, it might be easy to put in an option (presumably on by default) to triangulate any polygons that have the same point twice when exporting.
Writing code for fun and profit since... 2005? Wow, I'm getting old.
https://www.youtube.com/channel/UC_HFmdvpe9U2G3OMNViKMEQ [www.youtube.com]
User Avatar
Member
67 posts
Joined: May 2016
Offline
Hey thanks for looking into it. I am happy with the triangulation provided by a Divide SOP as my solution at the moment, so I'll leave it there
  • Quick Links