@batFinger's Solution was correct. I only want to present my solution because I also used a Timer to check every half second if the Operator is in the wm.operators list.
def execute(self, context):
bpy.ops.mesh.extrude_region_move('INVOKE_REGION_WIN',
TRANSFORM_OT_translate={
"constraint_orientation": 'NORMAL',
"constraint_axis": (False, False, True)})
wm = bpy.context.window_manager
ob = bpy.context.active_object
lastLen = len(wm.operators)
from threading import Timer
def checkExtrudeOperator():
#print("Things are being done")
wm = bpy.context.window_manager
indexoflastoperator = len(wm.operators)
if indexoflastoperator > 0 and indexoflastoperator > lastLen:
lastoperator = wm.operators.items()[indexoflastoperator -1]
op = lastoperator[1] # get the TRANSFORM_OT_translate
if op.bl_idname == 'MESH_OT_extrude_region_move':
v = op.macros['TRANSFORM_OT_translate'].properties.value
if v.length:
#we need to get new face ids
bm = bmesh.from_edit_mesh(ob.data)
region = bpy.context.scene.plator_custom[bpy.context.scene.plator_custom_index]
region.face_ids = ""
for face in bm.faces:
if face.select:
region.face_ids = region.face_ids + ";" + str(face.index)
print("operator used")
return
else:
print("operator canceled")
return
# we don't need to get new face ids
# if operator not found, call checkExtrudeOperator in 0.5 seconds
t = Timer(0.5, checkExtrudeOperator) # every 0.5 seconds, which should be fast enough before the User does something more (and the new face-ids aren't stored) but isn't that fast to make blender slow.
t.start()
t = Timer(0.5, checkExtrudeOperator) # every 0.5 seconds, which should be fast enough before the User does something more (and the new face-ids aren't stored) but isn't that fast to make blender slow.
t.start()
return{'FINISHED'}
Unfortunately I found out that blender is not only adding new face-ids but it also recalculates the face-ids of old faces... So the whole way of storing face-ids for 'later' isn't working anymore :-(