Okay so who knows this one?

Hi all.

Does anyone know how to record, from python, whether a view angle has changed? I.e when the user rotates the 3D view using the MMB or the numpad keys, an event (or user operator) should be called…let’s say the user rotates the view with the mouse, then it should print to the console…‘rotated’

I know how to register / create an operator, but man… this part is hidden well. Can anyone please help. I have an idea for a (IMHO ;)) a great addon but I can’t find any documentation on this… short of hacking the actual blender code… But I’m on a 64bit win 7 machine and I can’t get blender to compile, so that option is not working… my only other option is someone out there who can help me with a script.

So please… does anyone know?

Couldn’t you just setup a calculation between the camera and the 3D cursor, in your space handler? If the calculation is different, the view has changed.

@Atom. Thanks for the reply.

I’m not using cameras at all actually. I’m in the process of adding a script which will allow you to record your 3d ‘view history’. It’s an indispensible tool i’ve used in some other 3d software when designing, because then you can revert to previous rotations. Cameras just won’t do. If I make use of cameras I’ll just clutter the outliner.

Currently I’ve implemented saved views addon which I plan on expanding. But I need this as part of that script… (you can download the script at http://www.paste all.org/15695/python … remember to remove the space in the url…)

…However, if you can help me with a space handler in 2.54 that would be awesome. I am already able to calculate the view rotation, and i can get the differences between 2 views, but how would one actually find out whether the view has changed?

That’s basically the question I’m asking. :confused:

Actually… I found the answer. It seems one has to register a modal operator. That way you can record everytime the mouse button is pressed or the navigation keys are used…

Thanks for your time anyway…