Threading problem in tk-multi-breakdown2

Hello,

I am a pipeline developer and my company would like to potentially upgrade to tk-multi-breakdown2.

I am currently setting up the beta for that with the follwing setup:

  • tk-core: 0.20.14
  • tk-maya: 0.11.4
  • tk-framework-shotgunutils: 5.8.5
  • tk-multi-breakdown2: 0.2.5

I am testing in Maya-2022.4 with python-2.7.

My problem is, that breakdown2 runs into the following error when manager.scan_scene is running:

Strack-Trace: Traceback (most recent call last):
  File "C:\Users\simon.prager\packages\maya_tk_apps\1.11.1\build_output\bundle_cache\app_store\tk-framework-shotgunutils\v5.8.5\python\task_manager\worker_thread.py", line 82, in run
    result = task_to_process.run()
  File "C:\Users\simon.prager\packages\maya_tk_apps\1.11.1\build_output\bundle_cache\app_store\tk-framework-shotgunutils\v5.8.5\python\task_manager\background_task.py", line 140, in run
    return self._cbl(*self._args, **self._kwargs)
  File "C:\Users\simon.prager\AppData\Local\Shotgun\p\p5583.basic.maya\cfg\install\core\python\tank\log.py", line 514, in wrapper
    response = func(*args, **kwargs)
  File "C:\Users\simon.prager\packages\maya_tk_apps\1.11.1\build_output\bundle_cache\app_store\tk-multi-breakdown2\v0.2.5\python\tk_multi_breakdown2\api\manager.py", line 40, in scan_scene
    "hook_scene_operations", "scan_scene"
  File "C:\Users\simon.prager\AppData\Local\Shotgun\p\p5583.basic.maya\cfg\install\core\python\tank\platform\bundle.py", line 628, in execute_hook_method
    resolved_hook_paths, self, method_name, base_class=base_class, **kwargs
  File "C:\Users\simon.prager\AppData\Local\Shotgun\p\p5583.basic.maya\cfg\install\core\python\tank\hook.py", line 631, in execute_hook_method
    ret_val = hook_method(**kwargs)
  File "C:\Users\simon.prager\packages\maya_tk_apps\1.11.1\build_output\bundle_cache\app_store\tk-multi-breakdown2\v0.2.5\hooks\tk-maya_scene_operations.py", line 51, in scan_scene
    for ref in cmds.file(q=True, reference=True):
TypeError: Argument to query flag must be a boolean

So for some reason the hook tk-maya_scene_operations will not evaluate the maya.cmds correctly - although the command looks good.

I can only get it to work when I change this code to run on the main thread:

Change to:

scene_objects = self._bundle.engine.execute_in_main_thread(
    self._bundle.execute_hook_method, "hook_scene_operations", "scan_scene"
)

Unfortunatly the background-task scan_scene takes quite some time (20 seconds in my test-scene) and during that time maya get’s really slow and tends to crash with fatal-error.

Do you understand why manager.scan_scene does only evaluate correctly when not running on the main thread? I am really not an expert for multi-threading and could need help from someone with more experience with that.

Thank you and all the best,
Simon

1 Like

Just wanted to update the ticket.
I found this known issue:

For me switching back to 0.2.4 was the only option.
A college of mine mentioned that he suspects the switch to a Maya Panel to be the problem. With that the tool might be “bound” to the thread maya is running in.

1 Like