App_launch.py

Hello community members,

can you tell me how to know the app_launch.py is called?

import os
import tank

class AppLaunch(tank.Hook):
“”"
Hook to run an application.
“”"

def execute(
    self, app_path, app_args, version, engine_name, software_entity=None, **kwargs
):

os.chdir("..")

unfortunately it doesn’t work. I’m quite new and don’t know how can I solve this problem.

Thanks
Phuoc

2 Likes

Hi @Phuoc :wave:, welcome to the community! I added your post to the pipeline category which will give it some more visibility.

2 Likes

Hi @Phuoc!

I believe you’re talking about the app_launch hook in the tk-multi-launchapp Toolkit app? Hooks are bits of python code in our apps, separated from the main logic of the app so that they can be easily customized. The tk-multi-launchapp app runs any time a DCC (eg, Maya, Nuke, etc.) is launched in a Toolkit-aware way – either from the Shotgun Desktop tool, from the right-click menus on entities in Shotgun, from the command line, or in custom scripts. The app_launch hook is the part of the app’s logic that actually runs the command to launch the DCC – it allows you to customize the launch command, for example, you can use different flags.

Are you trying to customize the app launch process? Can you tell us a little more about what you’re trying to achieve?

2 Likes

Hello tannaz,

thanks for your reply. Yes it’s the app_launch hook. The problem is that there’s an environment contamination happening through shotgun create. And there is a workaround for this issue:

import os
os.chdir("..")

I just need to start this in my shotgun create python console.
It’s working fine, now I try to automate this workaround.
So I pu it in the app_launch.pi hook but it doesn’t work and my problem is I’m not sure it lauch this class or not when I call houdini from create or desktop.
Is there a possibility to debug this?

Thanks
Phuoc