Maxscript mousetracking

Hey there.

this is probably incredibly easy. My mxs is rather rusty and it never really shined in the first place heh. I want to add modifiers to objects by clicking on them. Basically this:


p = pickObject()
addmodifier p (Modifier())
collapseStack p

Does exactly what i need a single time. I want this to be repeated until right click. I tried to fiddle with mousetrack, but that seemed to interfere. Any quick tips?

Kind Regards,
Thorsten

pickObject has a parameter “count” that you use like this:

pickObject count:#multiple

that will allow for multi-object selection. The selection mode will end when a user right-clicks. You can then iterate over the returned array to add your modifiers.

Way easier than mouse tracking!

Perfect! Completely missed that as i read the docs of pickPoint too long i guess :smiley:

Kind Regards,
Thorsten

After giving it a go, the way this works is not exactly what i am after. It tracks the objects but gives no feedback whatsoever and holds off until right click to go on. Ideally i’d like to “click object -> modifiers added -> continue clicking”. In addition I’d need to go in-depth on the results as it can contain the same object multiple times.

Regards,
Thorsten

How about just a NodeEventCallback with the selection event ?

Well the NodeEventCallback and PickObject block each other. I’ll prolly resort to a NodeEventCallback and see if i can tweak/limit it in a way that makes it look like a “click to change mode”

Thanks for all the input,
Thorsten

As usual, eating lunch and having a beer worked wonders. pickObject() returns undefined if you right click, hence i ended up with this:


p=0
while p!=undefined do
(
p = pickObject()
if p!=undefined do
(
	DoSomething()
)
)

Thanks everyone for the input!
Regards,
Thorsten