Integrating Shotgun into Premiere Workaround

I got it working. There are a few typos in the wiki of that repo that causes the engine to fail to load.
(missing ; and } )
I also had to run 2to3 on some of the modules.
So… it works!
I’m not trying to debug window parenting. Currently the SG windows aren’t getting parented to the premier window. Has anyone any experience getting this to work? Without having a python console in Premier, it’s hard for me to debug the code being used to get the premier hwnd.
If I run the code from the engine.py (_win32_get_proxy_window()) from a SG Python console it does appear to return a hwnd for my premier window, but for some reason, when premier launches, I’m getting an error which suggests the engine isn’t able to get the hwnd on startup as it’s erroring with

                "not be parented to Premiere, but they will still function "
                "properly otherwise."

which suggests the _win32_get_proxy_window() method is returning None.

This is my test code which does return a hwnd, but I can’t verify the same result in Premier. Can anyone suggest how to proceed to debug this?

import sys
import os
sys.path.insert(0, r"C:\cache\sg\bundle_cache\app_store\tk-framework-adobe\v1.1.6\python")
import tk_framework_adobe_utils.win_32_api
found_hwnds=tk_framework_adobe_utils.win_32_api.find_windows(class_name="Premiere Pro", stop_if_found=True,)
_WIN32_PREMIER_MAIN_HWND = found_hwnds[0]
2 Likes

I have it working. I spent quite some time debugging the old build, and adopting the code to python3.
The framework “tk-framework-adobe-ppro” also should be updated including rebuilding Adobe CEP.
And finally, one more problem appeared, when you’re able to only run any toolkit application in premier or ae once. After that, it stops responding. Basically what happens is that the event server stops. Now I have to force it to start back again by injecting in every app hook before doing anything.

engine._HEARTBEAT_DISABLED = False

Otherwise both premier and ae stop being able to run any app.
Hope that helps anyone.

1 Like

Hello

This was an interesting read, and I’ mtrying to learn how to integrate Premiere into Shotgrid. I am getting the following error when launching Premiere. Could you help me out ?


2023-07-16 20:01:59,579 [   ERROR] [PROXY] Error calling __commands::adobe_premiere_pro((), {}):
Traceback (most recent call last):
  File "C:\Program Files\Shotgun\Resources\Desktop\Python\bundle_cache\app_store\tk-desktop\v2.6.7\python\tk_desktop\desktop_engine_project_implementation.py", line 225, in _trigger_callback
    callback(*args, **kwargs)
  File "C:\Users\sreyeeshgarimella\AppData\Roaming\Shotgun\kavaleer\p122c364.basic.desktop\cfg\install\core\python\tank\platform\engine.py", line 1083, in callback_wrapper
    return callback(*args, **kwargs)
  File "C:\Program Files\Shotgun\Resources\Desktop\Python\bundle_cache\app_store\tk-multi-launchapp\v0.12.2\python\tk_multi_launchapp\base_launcher.py", line 130, in launch_version
    self._launch_callback(
  File "C:\Program Files\Shotgun\Resources\Desktop\Python\bundle_cache\app_store\tk-multi-launchapp\v0.12.2\python\tk_multi_launchapp\base_launcher.py", line 397, in _launch_callback
    self._launch_app(
  File "C:\Program Files\Shotgun\Resources\Desktop\Python\bundle_cache\app_store\tk-multi-launchapp\v0.12.2\python\tk_multi_launchapp\base_launcher.py", line 189, in _launch_app
    (prepped_path, prepped_args) = prepare_launch_for_engine(
  File "C:\Program Files\Shotgun\Resources\Desktop\Python\bundle_cache\app_store\tk-multi-launchapp\v0.12.2\python\tk_multi_launchapp\prepare_apps.py", line 44, in prepare_launch_for_engine
    launcher = sgtk.platform.create_engine_launcher(
  File "C:\Users\sreyeeshgarimella\AppData\Roaming\Shotgun\kavaleer\p122c364.basic.desktop\cfg\install\core\python\tank\platform\software_launcher.py", line 88, in create_engine_launcher
    raise TankError(
tank.errors.TankError: Cannot create tk-premiere software launcher! tk-premiere Undefined does not exist on disk.
Cannot create tk-premiere software launcher! tk-premiere Undefined does not exist on disk.

Seems like the engine does not exist on disk or not in the right location.

How are you pointing to the engine?

@Ricardo_Musch Thanks for the reply so I found the original error :

. ```
2023-07-16 21:29:46,948 [ ERROR] [PROXY] Error calling __commands::adobe_premiere_pro((), {}):
Traceback (most recent call last):
File “C:\Program Files\Shotgun\Resources\Desktop\Python\bundle_cache\app_store\tk-desktop\v2.6.7\python\tk_desktop\desktop_engine_project_implementation.py”, line 225, in _trigger_callback
callback(*args, **kwargs)
File “C:\Users\sreyeeshgarimella\AppData\Roaming\Shotgun\kavaleer\p122c364.basic.desktop\cfg\install\core\python\tank\platform\engine.py”, line 1083, in callback_wrapper
return callback(*args, **kwargs)
File “C:\Program Files\Shotgun\Resources\Desktop\Python\bundle_cache\app_store\tk-multi-launchapp\v0.12.2\python\tk_multi_launchapp\base_launcher.py”, line 130, in launch_version
self._launch_callback(
File “C:\Program Files\Shotgun\Resources\Desktop\Python\bundle_cache\app_store\tk-multi-launchapp\v0.12.2\python\tk_multi_launchapp\base_launcher.py”, line 397, in _launch_callback
self._launch_app(
File “C:\Program Files\Shotgun\Resources\Desktop\Python\bundle_cache\app_store\tk-multi-launchapp\v0.12.2\python\tk_multi_launchapp\base_launcher.py”, line 189, in _launch_app
(prepped_path, prepped_args) = prepare_launch_for_engine(
File “C:\Program Files\Shotgun\Resources\Desktop\Python\bundle_cache\app_store\tk-multi-launchapp\v0.12.2\python\tk_multi_launchapp\prepare_apps.py”, line 44, in prepare_launch_for_engine
launcher = sgtk.platform.create_engine_launcher(
File “C:\Users\sreyeeshgarimella\AppData\Roaming\Shotgun\kavaleer\p122c364.basic.desktop\cfg\install\core\python\tank\platform\software_launcher.py”, line 88, in create_engine_launcher
raise TankError(
tank.errors.TankError: Cannot create tk-premiere software launcher! tk-premiere Undefined does not exist on disk.


For some reason it's going to a hard coded path in the descriptor

hi, @Ricardo_Musch Just wanted to follow up on this one. I set the path to that user on my machine and Premiere launches now. The weird part is I can’t see the panels
image

Hello,
Has anyone had any issue getting the shotgun panel to show up in premiere pro 2024

There are no issues, all works fine (once you make it work of course)

People are having so many issues with premiere integration, that I think I’ll make a github fork with the working one or pull some changes to make the engine work out of the box. I will try to make it at the beginning of this year.

1 Like