SME selection Callbacks
Hello, I have a question.
Is there a way to register user selection changes in SME.
For example I have two material nodes in SME view and want to execute some function when selection is changed.
For viewport selection changes I use this:
fn Subscribe = (callbacks.addScript #selectionSetChanged "MyRollout.VPSlection()" id:#VPSelectionID)
I want to do same thing but not in a viewport but in SME editor:
fn Subscribe = (callbacks.addScript #SMEselectionSetChanged "SMESlection()" id:#SMESelectionID) fn UnSubscribe =( callbacks.removeScripts id:#SMESelectionID) fn SMESelection = (Print "Slection changed") Subscribe() ---UnSubscribe()
I know there is no callback type: SMEselectionSetChanged it's just examle what I'm looking for, but can I create calbacks like this/similar, or this is not posable at all ?
If not, I'm thinking maybe I can register left mouse click in SME. And execute function on mouse click somehow ?
Basically I want to get selected material node properties on user selection change without need to add some update button in UI (real time update).
I would appreciate if someone could help or point out to the right direction.
Thank You.
Comments
Solution
It took very long to approve my post, so I've already solved the problem.
Here is solution if someone is interested:
This prevents UI lockdown (It happens if you use one clock element and update UI on tick nonstop), because it updates just when UI is out of focus.
Using this metod you can interact with UI, for example enter values in texbox, spiners etc.
.
You should look into window subclassing to make it efficiently
Check WindowShopper for more info
WindowShopper Not working
WindowShopper tool is not working for me geting error then trying to run it. Maybe it's not not supported on new max versions ? Are you using it ? Works for you ?
.
No, I don't use it. It is just a an opensource example of window subclassing.
Maybe it is max version or AD security tools blocking it, hard to tell.
Thank you. I will check it
Thank you. I will check it out.