I want to flip the normals via python. I have a single polygon as an object loaded. I am using blender 3.4.1.
I try to do the following in python:
>>> bpy.data.meshes['Plane'].polygons[0].normal
Vector((0.0, 0.0, 1.0))
>>> bpy.data.meshes['Plane'].polygons[0].flip()
>>> bpy.data.meshes['Plane'].polygons[0].normal
Vector((-0.0, 0.0, -1.0))
After executing this, the normals in the viewport did not change. Often I see the command normal_flip
being used which seems to be not in the scope of the object I work with:
>>> bpy.data.meshes['Plane'].polygons[0].normal_flip()
Traceback (most recent call last):
File "<blender_console>", line 1, in <module>
AttributeError: 'MeshPolygon' object has no attribute 'normal_flip'