Notifications
Clear all

[Closed] Even for face select change?

Is it possible to get an event when the selection changes on faces/edges/vertices?

If I understand correctly it’s only possible when selected objects change.
/Andreas

11 Replies
1 Reply
(@bobo)
Joined: 11 months ago

Posts: 0

It is possible using a WHEN construct instead of the general callback scripts. The callback will be executed each time the monitored objects are selected or deselected, but also catches changes in the sub-object selections, so it should work for you. Of course, you can keep track of what was previously there or what SO mode you are in and only act when the user really selected/deselected vertices, faces or edges.

Assuming you are going to use it in PolySpeed where you already know which objects you want to monitor, it would be very easy to implement:

Example:

when select $ changes id:#Bobo obj do (print (getfaceSelection obj))

Note that $ can stand for one or more selected objects, and the when construct will monitor them all. So you could also say when select selection changes… or when select #($Box01,$Box02) changes… or when select mySelectionArray changes … (where mySelectionArray is a collection of nodes).

‘select’ means you want to be notified when the objects or their subobject get selected/deselected.

the ID lets you easily delete specific callbacks

‘obj’ is an argument that is passed to the expression after DO and will contain the actual object that has changed. In the case above, I am asking for the face selection of the one object that has changed. You could do something like

… do if subObjectLevel > 3 then print (getfaceSelection obj)

to only access the face selection when in face mode and so on…

Hope this helps,
Bobo

i kinda lurk here in the script crypt once in a while…but refuses to post dummas questions yet.
but…

bobo are you god.

…hey any ice on the red yet?

1 Reply
(@bobo)
Joined: 11 months ago

Posts: 0

No.

I personally know a couple of guys that IMHO have a deeper knowledge of MAXScript than I have. It sounds strange, but this area is so vast that I feel I don’t know even half of what is possible in MAXScript. This gives me the drive to try new things every day and still get a kick out of inventing something new. The fact that I am now being paid to do this on a daily basis is the topping of the cake!

Thanks for asking, your question made my day

Wow, I really thought it was impossible. Thanks a ton Bobo. TAda, do you understand what kind of power you just unleashed for me??

Now I can seriously look at Modo and some other applications and add things I thought was previously impossible.

After living in a cryp for about 1.5 month, I’m finally beginning to grasp a fairly big chunck of MaxScript at least. Much of it is thanks to you Bobo.

MaxScript has really developed alot the last years. I remembered a few years ago when you would run into limitations in ever corner. Now it’s actually pretty uncommon that I find things that really aren’t possible to do. I just hope they give us some more powers with events like this. I still have trouble knowing what the user is actually doing with max, I just don’t get enough feedback.

One thing I think is pretty amazing with maxscript that few seem to note, is that it’s pretty darn fast for being a script language. I also like it alot that the creators have put in almost all the functions that I would normally use for just about everything. Ever time I think “oh blah, now I have to cut and paste this string into pieces then tada, there is a feature that already does this for me”

It’s great that you can implement things from the SDK if you realy, really have to. It’s not much fun to write things for the SDK. but it should be very good for nasty object creation etc.

/Andreas

Yes!
I watched a PolySpeed video yesterday (sorry, missed it in the past), and it looks GREAT!
More power to you – I am glad I can help from time to time!

1 Reply
(@f97ao)
Joined: 11 months ago

Posts: 0

Thanks Just wait till you see the last version is has 3 times the features.

I’m finding all kinds of things that I can speedup with Polyspeed. Meshsmooth is the clear choice, but also the editable_poly, the viewports are speedup alot too. I’m also just now experimenting with speeding up modifiers too. Displacement paint seem to work great.

I have a bunch of pretty tricky design problems ahead of me, maybe I will post some of them here

/Andreas

f97ao : by the way here its your 30 day anniversary on your polyspeed thread…
…okay now its 31.
congratulations…have a swede- beer. you and …urgaffel+bobo,who seems to be by far your most help with very fast clear and concise help. good teamwork.Great teamwork actually…just today read all of your total polyspeed thread …and saw the movie.
…as for feed back it seems like a project like yours contributes alot to the cg community and yet the headline banner has no places for this kind of thing…hmmm! or maybe it does…
…anyway it seems like you have it all working out 99.999% there anyway,regardless…i was going to add as i was reading but then there was urgaffel…way too late at this point i think… i think i will toddle off now.

bobo:okay so you’re not god…but you have god friends… i know an
ominpotent being when i see one…and holy moley… its wearin a toque.
… i hear the pbears are inching ever so slowly out of churchill and are creeping
toward winnapeg …

Hmm, yea will take a bear. I also have alot of other folks that help me on the polyspeed forums. I post almost all my ideas there, and once in a while some stuff here.

Hmm, what do you mean about the headline banner? I’m not that familair to how Cgtalk works, what you can post here etc, so I’m always wary about posting too much about PolySpeed. Response has only been positive about me posting here on CGTalk so far though.
Myself I really like to be in touch with the developers more in graphic programs, so I try to do what I wished others would do to me. Hopefully this gets through to the reader.

Please don’t hesitate to post ideas you have. Polyspeed is mostly about speed but also about other modeling things, this is often where I need the most help.

/Andreas

Ok, so I can get to know when they change selections. Would it be possible to know if the user has double clicked say an edge too?

Hmm, should be possible with some tricking at least i think. The mouse tool should be pretty bad for this. One idea I just got that would work, but I would need the sdk for is to keep track of all the mouse movements and clicks (i actually have a max extention for this already).

Then I get the event when the user changes selection. What I do now is I save the time and checks with the MaxExtention if a double click has happened at the same time (roughly).

What I remember from the maxscript extentions is that it’s not possible to create events with it, so no double click even would be possible there.

What do you think about that?
/Andreas

Sorry sir,my writing is sometimes bad,what i meant was that some projects deserve a place on a top banner to gain more attention ,because they are worthy…yours is. yes ,okay?
Ii didn’t realize you had a web page for your project,and are getting more feedback there.Also, like you i have been somewhat concerned about the speed at which
max handles very large mesh data models…and so have avoided using as an interactive tool extensively,and therefore lack the knowledge that some people have when using for poly modeling.I look forward to polyspeed as a step in the right direction.—I generally use max just for its rendering.

1 Reply
(@f97ao)
Joined: 11 months ago

Posts: 0

Ok, glad you think so. I will create a complete website for the plugin pretty soon. Then I will make more public announcements etc and spread the word even more. I just realised that there will many more uses for poly than i first thought. Vertex painting, even uvw mapping is far supperiour since suddenly size of the object doesn’t matter any more! (hm, can’t believe I said that)

Please visit the wishlist and features section if you have the time. we discuss alot of ideas there, and it realy saves my time to know how folks work. With the advanced version of poly you should be able to handle nearly any sized object in max with no or little problem.

/Andreas