Sorry, yet another question about lattice from a beginner...
Consider a scene with a mesh (say, a default plane) and a (default) lattice. Let's run the following script in edit mode and in object mode with the plane (x)or the lattice selected.
import bpy
lat = bpy.data.lattices['Lattice']
obj = bpy.data.objects['Lattice']
for n in range(len(lat.points)):
print(obj.data.points[n].co)
obj = bpy.data.objects['Plane']
print('***')
for n in range(len(obj.data.vertices)):
print(obj.data.vertices[n].co)
I get:
<Vector (-0.5000, -0.5000, -0.5000)>
<Vector (0.5000, -0.5000, -0.5000)>
<Vector (-0.5000, 0.5000, -0.5000)>
<Vector (0.5000, 0.5000, -0.5000)>
<Vector (-0.5000, -0.5000, 0.5000)>
<Vector (0.5000, -0.5000, 0.5000)>
<Vector (-0.5000, 0.5000, 0.5000)>
<Vector (0.5000, 0.5000, 0.5000)>
***
<Vector (-1.0000, -1.0000, 0.0000)>
<Vector (1.0000, -1.0000, 0.0000)>
<Vector (-1.0000, 1.0000, 0.0000)>
<Vector (1.0000, 1.0000, 0.0000)>
in object mode when the plane is selected, in object mode when the lattice is selected and in edit mode when the plane is selected.
I get:
<Vector (-0.5000, -0.5000, -477240864.0000)>
<Vector (-1.5000, -1.5000, -477240864.0000)>
<Vector (-0.5000, -1.5000, -477240864.0000)>
<Vector (-1.5000, -0.5000, -477240864.0000)>
<Vector (-0.5000, -0.5000, -477240864.0000)>
<Vector (-1.5000, -1.5000, -477240864.0000)>
<Vector (-0.5000, -1.5000, -477240864.0000)>
<Vector (-1.5000, -0.5000, -477240864.0000)>
***
<Vector (-1.0000, -1.0000, 0.0000)>
<Vector (1.0000, -1.0000, 0.0000)>
<Vector (-1.0000, 1.0000, 0.0000)>
<Vector (1.0000, 1.0000, 0.0000)>
in edit mode when the lattice is selected.
Why is there such a difference in edit mode for the lattice only?