Page MenuHome

X3D exporter sets solid to inverted value
Closed, ArchivedPublic


In X3D, "solid=true" means to activate backface culling (back faces are not visible). Current X3D exporter makes two mistakes:

1. It uses

fw('solid="%s"\n' % ('true' if mesh.show_double_sided else 'false'))

which means that double-sided=true results in solid=true, which means that the meaning is inverted. Intuitively, double-sided means that solid should be false.

One can fix it trivially (by swapping 'true' with 'false' in line above). But Blender's "Double-sided" checkbox is actually (for Blender) to control two-sided lighting. It's just wrong to overuse it for backface culling during X3D export, since these are two different things.

2. Fortunately, I see that new Blender got rid of old "Two-sided" checkbox in "Texture face" panel. Instead, material has now simple "Backface culling" checkbox in "Game settings" panel (in "Blender game" mode). This is a great change, as this new "Backface culling" checkbox is precisely what should be used to determine X3D's solid field. The attached trivial patch makes this happen.

There is an additional request to make this really useful: "Game Settings" panel should really be visible even in "Blender Render" mode, not only in "Blender Game" mode. Looking at forums, some people still do not realize that there are hidden buttons, visible only in "Blender Game" mode. In this case, probably noone will realize that some options crucial for X3D export are hidden under "Blender Game" mode. Additional argument is that "Backface culling" checkbox (as well as "Invisible" checkbox, and maybe others) affect what is visible in Blender's "Texture" display mode (Alt+Z). So I think it would be best to apply this patch, *and* additionally make material's "Game Settings" panel just visible also in default "Blender render" mode.