I’m working on a much bigger project and thought it might be something to do with it being complex, so I have gone back to the good old cube for testing!
I’m having an issue when trying to do what I think should be quite a simple operation.
This is my desired shape:
This is what happens:
This is my code:
import bpy
# Clear Scene
bpy.ops.object.select_all(action='SELECT')
bpy.ops.object.delete(use_global=False)
# Add Cube
bpy.ops.mesh.primitive_cube_add(size=2, enter_editmode=False, location=(0, 0, 0))
# Create Inset Faces
bpy.data.objects['Cube'].select_set(True)
bpy.ops.object.mode_set(mode='EDIT')
bpy.ops.mesh.inset(use_boundary=True, \
use_even_offset=True, \
use_relative_offset=False, \
use_edge_rail=False, \
thickness=0.2, \
depth=0.0, \
use_outset=False, \
use_select_inset=False, \
use_individual=True, \
use_interpolate=True, \
release_confirm=False)
bpy.ops.mesh.extrude_region_move(MESH_OT_extrude_region={"use_normal_flip":False, \
"mirror":False}, \
TRANSFORM_OT_translate={"value":(0, 0, -0.168421), \
"orient_type":'NORMAL', \
"orient_matrix":((0, 1, 0), (0, 0, -1), (-1, 0, 0)), \
"orient_matrix_type":'NORMAL', "constraint_axis":(False, False, True)})
bpy.ops.object.mode_set(mode='OBJECT')
Any help would be appreciated!