Skip to main content
Known Participant
July 17, 2023
Answered

How to listen for BakingProcessEnded event?

  • July 17, 2023
  • 2 replies
  • 384 views

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

This topic is closed to new replies. Start a new post to keep the conversation going.
Correct answer mhamid3d

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
)

2 replies

mhamid3dCorrect answer
Inspiring
July 17, 2023

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
)
Known Participant
July 18, 2023

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!