PDA

View Full Version : Vertex selection change


dairymilk1980
06-14-2007, 09:47 AM
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.

dairymilk1980
06-19-2007, 07:10 AM
Is there no solution to this selection callback problem?

dutch_delight
06-25-2007, 01:33 PM
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

dairymilk1980
06-28-2007, 09:29 AM
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 :)

CGTalk Moderation
06-28-2007, 09:29 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.