Detecting changes in the selection set.

Hi Everyone,

What is the current preferred way to detect changes in the set of selected objects?

I’ve noticed that many scripts don’t even attempt to detect changes in the selection, and have an “Acquire Current Object” type of button. I am very much hoping to avoid that. Personally, I have only managed to automatically detect when the selection has changed by adding a script link that ensures the script window is redrawn when the scene is redrawn.


import Blender
from Blender import Text
from Blender import Scene
txt = Text.New()
txt.write('import Blender
txt.write('from Blender import Window
Scene.GetCurrent().addScriptLink(txt.getName(), 'Redraw')

Is there another way? Are there examples?

Thanks, :smiley:

Jonathan Merritt.