Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

How to listen for BakingProcessEnded event?

Explorer ,
Jul 17, 2023 Jul 17, 2023

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

TOPICS
Scripting
423
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Beginner , Jul 17, 2023 Jul 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
)
Translate
Community Beginner ,
Jul 17, 2023 Jul 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
)
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jul 18, 2023 Jul 18, 2023
LATEST

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! 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines