Can I stop a Python script midway, get some info from the user and then only continue?

Can I stop a Python script midway, get some info from the user and then only continue?

wynandlens
Enthusiast Enthusiast
167 Views
3 Replies
Message 1 of 4

Can I stop a Python script midway, get some info from the user and then only continue?

wynandlens
Enthusiast
Enthusiast

is there a "continue" UI option in maya? Like a UI item specifically designed to block a script and only continue once you click it?

0 Likes
168 Views
3 Replies
Replies (3)
Message 2 of 4

FirespriteNate
Advocate
Advocate

you can use `confirmDialog` or `promptDialog` for this. They both halt all processing until dismissed.

`confirmDialog` is just buttons, `promptDialog` allows you to prompt for variable input (there's also `layoutDialog` but that's a bit more complicated to set up).

0 Likes
Message 3 of 4

wynandlens
Enthusiast
Enthusiast

Thanks! Both these take complete control of your maya session, so a user can't click on anything. I'd like them to select a node in the view port, click 'USE THIS NODE' and continue the script.

 

 

0 Likes
Message 4 of 4

mcw0
Advisor
Advisor

Split your script into 2 scripts.  Run the first.  Create a UI to prompt the user to select something.  And have a scriptJob that executes the second script upon selection change.

0 Likes