@donat Thank you for posting your updated Painter TK engine, much appreciated. I’m using the latest Painter 12.1.0 and I’ve noticed that Painter doesn’t completely shutdown when you close it. The process continues in the background with 0 CPU usage (see screenshot).
The Painter log file shows the following error (not sure if its related) %AppData%\Local\Adobe\Adobe Substance 3D Painter\log.txt
[INFO] Task Manager: Shut down successfully!
[INFO] Widget trash contains 2 widgets
[INFO] “[DBG INFO][Library agent]” Resources crawling stopped after: 600 ms for: “C:/Program Files/Adobe/Adobe Substance 3D Painter/resources/starter_assets”
[INFO] <PySide6.QtCore.QObject(0x21d2d663810) at 0x0000021D2AA92780> destroyed
[ ERR] failed to close shotgrid_bootstrap plugin
[ ERR] Traceback (most recent call last):
[ ERR] File “C:\Program Files/Adobe/Adobe Substance 3D Painter/resources/python/modules\substance_painter_plugins.py”, line 230, in close_all_plugins
[ ERR] close_plugin(module, False)
[ ERR] ~~~~~~~~~~~~^^^^^^^^^^^^^^^
[ ERR] File “C:\Program Files/Adobe/Adobe Substance 3D Painter/resources/python/modules\substance_painter_plugins.py”, line 104, in close_plugin
[ ERR] module.close_plugin()
[ ERR] ^^^^^^^^^^^^^^^^^^^
[ ERR] AttributeError: module ‘shotgrid_bootstrap’ has no attribute ‘close_plugin’
Thanks for trying it out. I did a fix and I have created a new version (tag v1.0.5). Could you please update it and tell me if it is working ?
I tried to reproduce your issue and saw, like you, Substance in the task manager although I did close it. But that only happened once, weirdly. I tried multiple times but the following times Substance really exited and was not seen in the task manager anymore.
Anyway, I just added the missing ‘close_plugin’ method, which should solve the issue. It looks like this method is called when Substance Painter needs to… close the plugin (i.e. the engine in this case). Nothing happens in the method.
@donat Thank you so much for the quick reply and code update!
I implemented your changes this morning and I’m still seeing the process hanging in the Task Manager. To cover all my bases, I completed uninstall Painter v12.1.0, rebooted my machine and reinstalled it, but still the same issue. I’m going to try it on another machine to see if I have the same issue. I also worked with Grok AI all yesterday trying different things but nothing worked. If I disable the self.menu_generator.setup_menu_items() so the menu isn’t created but the engine is running, then Painter closes as expected. It really seems to be holding onto some QT widgets, which is keeping it from closing.
Can you tell me what version of Painter your using? Also, my test workfile is just to open Painter, then the Workfiles app and then close Painter. I’m not creating a project or changing contexts - can you try that and see if it works?
I’m going to continue to try different things and see if I can get to the root of this. Thank you again!
Before doing the code changes mentioned above, I updated my shotgrid config (ie I updated all tk apps and engines, and the tk-core). I also installed the last version of Shogrid Desktop. Not sure if it’s relevant, just fyi.
My test : I open Shotgun desktop, select my test project, then click on the Substance Painter icon. I’m using Substance v12.0.3. Once it is open, I open the Workfiles app (File Open…), then click on ‘Cancel’. I then quit Substance. A few seconds later, Substance dissappears from the Task Manager.
Unfortunately I cannot reproduce the issue. However, can you check your latest substance painter logs ? I looked at mine and saw no error.
Hey @donat Yes, I’m on Windows 11 as well and am using the latest SG core and apps so I don’t think that is the issue. There are no obvious errors in the Painter log either.
Could you try this test and let me know the results? Open Painter, then open the TK File Open (workfiles2) app and leave it open. Don’t open a project or change the context, just open the app (in the project context) and then close Painter. Let me know if you get the dangling process?
Could you try this test and let me know the results? Open Painter, then open the TK File Open (workfiles2) app and leave it open. Don’t open a project or change the context, just open the app (in the project context) and then close Painter. Let me know if you get the dangling process?
I tried that exactly : Launch Substance Painter using SG Desktop, then open the workfiles2 app without clicking anywhere in it, and leaving it open, then quitting Substance Painter (either with the File /Quit command or by clicking on the red X icon top right corner). After a few seconds Substance dissappears from the Task Manager
Regards
EDIT ;
Can you delete the file : shotgrid_bootstrap.py that is in %USERPROFILE%\Documents\Adobe\Adobe Substance 3D Painter\python\startup and retry ?
@donat I tried deleting the script in the startup directory like you suggested but still the same result. I think I might try a clean TK config next and see if I get the same thing. I confirmed this issue on another one of our developers machines, so I don’t think its unique to my machine.
I also wanted to confirm on your machine that the Painter process isn’t running in the “background processes”? (see screenshot)
@donat Here’s a quick update on what I’ve found (tldr; this is still an issue)
I created a fresh TK config using the Advanced Project Setup in SG Desktop. I then updated all the TK apps and core to the latest. SG Desktop is latest (v3.0.0) I installed the Painter engine and only had the workfiles2 app and another custom TK app installed for Painter. This issue seems to be related to the workfiles2 app being open when you close Painter. If the workfiles2 app isn’t opened then the process doesn’t hang. If I open my custom TK app then Painter closes as expected. Same with other TK apps I’ve tested with. If I open and close the workfiles2 app then Painter closes as expected.
Deleting %USERPROFILE%\Documents\Adobe\Adobe Substance 3D Painter\python\startup\shotgrid_bootstrap.py did not any effect on the issue.
This is a really bizarre issue, I’ve never seen an issue like this before in my decade + of working with TK/SG. Its not clear to me why you only saw this issue once. Is your studio using this engine in production?
I think we’ll just have to tell the artists not to have the File Open/Save (workfiles2) app open when they close Painter.
I tested again, on a different PC. I see Substance Painter vanish from the Task Manager. I am also looking into background processes (in fact I am using the filtering from the top of the task manager window). Again, I opened the Workfiles app, then close substance painter without closing the Workfiles app.
I have no idea how to investigate further but I’m open for other tests if you have other things you want me to test.
PS : Unfortunately I am not using this in production, I recently switched companies and the new company uses Ftrack