I'm playing around with bmesh and have run into something I can't figure out how to do and can't find any related documentation on.
I have extruded a face directly outward (after subdividing a larger object to create it) and now want to scale it inward after the extrusion. When I try to use bmesh transform and scale operators (code below), it ends up moving the face location, apparently in relation to the global space. It seems like the answer is related to feeding the proper matrix into whatever function I'm calling, but I haven't quite wrapped my head around how it all works yet.
Here is what the result looks like just after the extruding operation:
And here is what I'm trying to achieve:
Basically, what I want is to use the equivalent of:
bpy.ops.transform.resize()
...inside of bmesh, to scale the face on the X and Z axis in place/relative to the face center.
I've tried performing the operation using the scale operator with different "space" arguments:
face = bm.faces[0]
bmesh.ops.scale(
bm,
vec=(.5, 1, .5),
space=matrix,
verts=face.verts
)
I've also tried using the transform operator with manually constructed matrices
face = bm.faces[0]
matrix = mathutils.Matrix([ ... ])
bmesh.ops.transform(
bm,
matrix=matrix,
verts=face.verts
I can't figure out how to get the boundaries of the scale transformation space to be confined to the face area.
Thanks for any insight or help!