Is there a way to flip or change the normal vector of a face using python in the blender game engine?
-
$\begingroup$ While or prior to running the game? $\endgroup$– someonewithpcFeb 3, 2015 at 18:33
-
$\begingroup$ While running the game $\endgroup$– simonwiedemannFeb 4, 2015 at 13:50
-
$\begingroup$ Could you use replace mesh? $\endgroup$– ruckusFeb 6, 2015 at 4:22
-
1$\begingroup$ I would post the script here, but it is very lengthy, you have to get the mesh, and then iterate through all vertices and flip them in engine. and Blender artists is not going anywhere :) Elysium is it's mirror. blenderartists.org/forum/… blenderartists.org/forum/… $\endgroup$– BluePrintRandomMar 8, 2015 at 19:34
1 Answer
This is only possible via Python.
Basically you turn the order of the vertices for each single polygon (face) by exchanging the positions of the first and third vertex
flipping triangles:
flipping quads:
You might need to set the vertex normal too to correct the shading.
Attention:
KX_PolyProxy does not provide the right vertices when the mesh consists of a mix of quads and triangles (Blender 2.73 and earlier). I do not know when this gets fixed.