PDA

View Full Version : strange problem with function triggered by button


48design
01-03-2010, 12:08 PM
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...

48design
01-03-2010, 04:35 PM
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! :sad:

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

denisT
01-03-2010, 04:39 PM
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...


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

denisT
01-03-2010, 05:57 PM
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 ...

48design
01-04-2010, 08:41 AM
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!

CGTalk Moderation
01-04-2010, 08:41 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.