operator bpy.ops.transform.rotate returns Cancelled

Hi there,

I wrote a neat script which imports files in a loop in the current blenderFile does a little bit of meshmanipulation and exports it again. After each cycle all objects,materials,meshes are deleted so the scene is “clean” for a new import.

The whole script works quite well but for one thing.

I use for rotation the operator bpy.ops.transform.rotate and after the first cycle it returns CANCELLED. I understood that that the operator works on the currently selected object but i checked in my log in every run the right Object is selected and the active object.

It must have something to do with the looping of imports as the objects are manipulated correctly when there is just one File hence one run through the loop everything works fine.

So here are my questions:

  1. Is there a way to determine why the operator returned cancelled?
  2. I read somewhere that blender does its cleanup when closing the file or exiting, is there maybe some data-“Garbage” or a possible setting which could result in the cancelation of the rotate?

I would really appreciate some thoughts, best case scenario a solution.