[Closed] Vertex selection change
Hello All.
I read the callbacks mechanism in maxscript. This works fine when object selection has changed. I am looking for some way to detect a vertex selection change. Can someone tell me how I can detect this change?
Thank you.
I dont know if there is a better solution but this uses a basic callback from the manual and i changed it slightly to catch any vertex selection changes.
it currently crashes when you run this before creating an object but im sure you can put a check in this yourself. (im not writing it all for ya)
fn redrawviews_cb = (
if $ != undefined then (
old_selection = new_selection
new_selection = getVertSelection $ as string
if new_selection != old_selection then print ("changed")
)
)
fn rvcb = (
global old_selection
global new_selection
old_selection = getVertSelection $ as string
redrawviews_cb()
)
callbacks.removeScripts id:#rvcb
registerRedrawViewsCallback rvcb
Hello dutch_delight
Your solution worked! Since I did not get any responses prior to your’s, I ended up using a timer and I am sure you know that it was not elegant, so to speak. Your solution definitely helped me. Thanks a lot