Notifications
Clear all

[Closed] strange problem with function triggered by button

Hi community!

I have a strange problem: I wrote a script first without interface and used
runFunction $
in the last line to run the script. That worked very well!
Now I tried to script an interface for this little tool, so I used a pickbutton
to pick a node instead of the $ and a button that triggers the function
on btn_go pressed do runFunction pickbutton.object
and my script stopped working without warnings!

The script uses particleFlow. Could that have something to do with it,
because “easy” operations like snapshot or something do work!

It is exactly the same function, I swear! It’s just triggered with this button
from a rollout…

4 Replies
1 Reply
(@denist)
Joined: 11 months ago

Posts: 0

pickbutton doesn’t have pressed event as i remember. use picked event (see pickbutton MXS help for details and samples)

Thanks for your answer!

I have two buttons, a pickbutton and a button to run the function with the picked object picked with the pickbutton…
So the problem is still there! 🙁

(strange, my post is on top of yours… ^^)

two things:

  1. when you call <function> $ that means the object is selected. <pickbutton>.object might be not selected.
  2. when you call your function from listener the operation is undoable. sometimes particleflow doesn’t update its components if script is not undoable.
    try to call:
    on button pressed do undo <…> on …

YOU ARE GOD! ^^

Thank you, that did the trick!
You are right with #2, if you script something with particelFlow, pFlow ist not updated if one not uses the undo syntax! It’s really strange…

Thanks denisT!