The ONLY thing on the page is a cube that’s been poked “Alt-P”
If I run the code below in python console, I get a list of verts.
>>> current_object = bpy.context.active_object
>>> [i.index for i in current_object.data.vertices if i.select]
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13]
If I run this code (pulled from the info panel):
import bpy
bpy.ops.mesh.primitive_cube_add()
bpy.ops.object.editmode_toggle()
bpy.ops.mesh.poke()
bpy.ops.mesh.select_all(action='TOGGLE')
#Select ANY Center Vert then run "cube_star_02.py"
Select ANY Center Vert and then run:
import bpy
#After Select Center Vert
bpy.ops.mesh.select_similar(type='FACE', threshold=0.01)
bpy.ops.transform.resize(value=(3.53695, 3.53695, 3.53695), constraint_axis=(False, False, False), constraint_orientation='GLOBAL', mirror=False, proportional='DISABLED', proportional_edit_falloff='SMOOTH', proportional_size=1)
bpy.ops.mesh.select_all(action='TOGGLE')
bpy.ops.mesh.select_all(action='TOGGLE')
bpy.ops.mesh.inset(thickness=0.291296, use_individual=True)
bpy.ops.mesh.delete(type='FACE')
bpy.ops.object.editmode_toggle()
I get the desired outcome.
This could just as easily (or maybe not, given what may be involved) be one program if not for the fact that
I haven’t been able to figure out what to do with the identified verts to be able to determine WHICH are the Center Verts and HOW to select them.
There may be an answer somewhere, but, either it speaks to my specific problem and I just don’t know enough to know it (entirely possible) or it hasn’t been specifically addressed because it hasn’t been specifically asked.
This one looks to be fairly simple. It’s the only object on the page. It’s a basic object (Cube). Other than that I’m stumped.
How do I
- Identify the center verts
- Programmatically select them
Thanx