[Closed] help—dynamic label update
hi… im new to scripting… how to dynamically update the “label” while selecting edges in Editable poly— the idea is i want to update the label to the “number of edges selected”… ive started a script already but i dont know how to write the code to dynamically update it… i think its a callback thing… thanks in advance…
this is the script…
rollout test “test”
(
label label1 “test label”
fn labelcallback =
(
label1.text = ($.selectedEdges.count as string) + ” edges selected”
)
on test open do labelcallback()
)
createDialog test
Callbacks are what you need here.
Check the help for General Event Callback Mechanism
Node Related Callbacks will get you and probably the SelectionChanged callback.
on test open do callbacks.addScript #selectionSetChanged "MYgeomCallback()" id:#MY_Selection
fn geomCallback =
(
test.label.text = "Update Here"
)
I should mention that if you are looking for it to update when you select edge 4, and then edge 2 on an object, you may need a different node based call back to capture that data.
i would use NodeEventCallback Mechanism and its subobjectSelectionChanged event…