Skip to main content
deleted 72 characters in body
Source Link
Martynas Žiemys
  • 28.1k
  • 2
  • 38
  • 81

That's weird. It crashes Blender when I try to recheck centers valuues in the console after edit mode switch. Must be some bug in the Blenders Python API. You could deselect everything without switching to edit mode. This seems to work:

import bpy

objd = bpy.context.object.data

centers = [p.center for p in obj.datad.polygons]

for vx in obj.data.vertices:
[v for v in vd.selectvertices] =+ False
[p for p in obj.datad.polygons:
   polygons] p.select+ =[e False
for e in obj.datad.edgesedges]:
    ex.select = False
    
print(centers)

That's weird. It crashes Blender when I try to recheck centers valuues in the console after edit mode switch. Must be some bug in the Blenders Python API. You could deselect everything without switching to edit mode. This seems to work:

import bpy

obj = bpy.context.object

centers = [p.center for p in obj.data.polygons]

for v in obj.data.vertices:
    v.select = False
for p in obj.data.polygons:
    p.select = False
for e in obj.data.edges:
    e.select = False
    
print(centers)

That's weird. It crashes Blender when I try to recheck centers valuues in the console after edit mode switch. Must be some bug in the Blenders Python API. You could deselect everything without switching to edit mode. This seems to work:

import bpy

d = bpy.context.object.data

centers = [p.center for p in d.polygons]

for x in [v for v in d.vertices] + [p for p in d.polygons] + [e for e in d.edges]:
    x.select = False

print(centers)
Source Link
Martynas Žiemys
  • 28.1k
  • 2
  • 38
  • 81

That's weird. It crashes Blender when I try to recheck centers valuues in the console after edit mode switch. Must be some bug in the Blenders Python API. You could deselect everything without switching to edit mode. This seems to work:

import bpy

obj = bpy.context.object

centers = [p.center for p in obj.data.polygons]

for v in obj.data.vertices:
    v.select = False
for p in obj.data.polygons:
    p.select = False
for e in obj.data.edges:
    e.select = False
    
print(centers)