Copy link to clipboard
Copied
Hi,
Sorry if this is an easy question, but how do I listen for 'BakingProcessEnded' from Event.Py in my own python script?
From the documentation I havent been able to deduce what I actually need to add to get a function to run when that even is triggered.
Could someone break this down for me please?
Thanks!
Graeme
In your python script:
import substance_painter.event as spevent
def do_stuff(*args):
# do stuff here
spevent.DISPATCHER.connect_strong(
spevent.BakingProcessEnded, do_stuff
)
Copy link to clipboard
Copied
In your python script:
import substance_painter.event as spevent
def do_stuff(*args):
# do stuff here
spevent.DISPATCHER.connect_strong(
spevent.BakingProcessEnded, do_stuff
)
Copy link to clipboard
Copied
Amazing, thank you so much!
As it turned out, I nearly had it correct - but I had a third variable after "do stuff" where I thought I had to write "any" or the status that I wanted to watch for.
I really appreciate your help!