Way to track the viewport point of view?

You will have to turn the script of @RPaladin to an addon by inserting the bl_info dictionary. blender\3.2\scripts\templates_py\addon_add_object.py. Then you either drop it to where the rest of Blender scripts are or install it from the preferences GUI.

PS. Also if you run the script yourself from text editor, you will have to place an extra register() at the end so you invoke the function manually. Though as said if you turn the file to addon the __main__ call prevails by default.

2 Likes

So, this code example worked for me to register modal operator:

However, if I paste the code to move the cube into the same part where it changes color, it only updates the position once, on launching the operator

Ok, so there was an error. I made it work through this Modal template. But now it turned out that bpy.context.region_data.view_location ignores viewport zoom level, which isn’t ideal. Any way to correct it?

modal timer.blend (773.5 KB)
(An example of what I got)