Menu not showing houdini when launching via bootstrap_engine

Hi Guys

We are having issues where the menu items are not getting generated.

Here is some technical background of our setup.

  1. We are building the plugin via base configuration. Our configuration lives on a path
  2. The latest core was used to build the plugin.
  3. The SHOTGUN_ENTITY_ID and SHOTGUN_ENTITY_TYPE are populated in the environment.
  4. We don’t use Shotgun Desktop, Shotgun Create, or the web UI to launch into the DCC as we have own DCC launcher
  5. We are starting the engine via sgtk.bootstrap.ToolkitManager.bootstrap_engine("tk-houdini", toolkit_mgr.get_entity_from_environment())

The above command is run via houdini start up guide.

To confirm that I can see the engine and installed app via the following command.

>>> cur = engine.current_engine()  
>>> cur  
<Sgtk Engine 0x2efb3518: tk-houdini, env: shot>  
>>> cur.apps  
{'tk-multi-loader2': <Sgtk App 0x2f7ccc88: tk-multi-loader2, engine: <Sgtk Engine 0x  
2efb3518: tk-houdini, env: shot>>, 'tk-multi-shotgunpanel': <Sgtk App 0x2f4592e8: tk  
-multi-shotgunpanel, engine: <Sgtk Engine 0x2efb3518: tk-houdini, env: shot>>}
  1. Why is the menu/shelf not appearing?
  2. If this is not supported way for current plugin how can I show the APP from the python command line if have the instance.

Cheers

Pritish

2 Likes

Hi Pritish

Building plugins is one area I’m not familiar with. I can see that our Houdini startup code is doing something similar:

Maybe there might be some clues there?
I did try running some bootstrap code in the Houdini python console, and I got the same result as you, where the engine appears to start, and I can grab a handle to it, however, no menu appears.

I’ll try and get an engineers input to see if they can suggest anything.

2 Likes

I can see that our Houdini startup code is doing something similar:

Hi Phillip

You are right. In fact it is 99% the same except for the fact I am loading it up silently.

I solved the issue though. It seems that menu generaton writes to temp location. As soon as I populated TK_HOUDINI_TMP variable with a path, it created the panel option.

Unfortunately I have other issues now where the apps are misbehaving…sigh…one battle at a time I guess

Will open a up a different thread for that issue

Cheers

Pritish

2 Likes

However the menu still does not load though. Also please note, our houdini is installed in a read only area.

1 Like

I just took a look, and your right it seems to generate a path to a temporary location containing Menu generation stuff. I also notice that this path is set in the HOUDINI_PATH env var not just the TK_HOUDINI_TMP.

But at the moment I can’t get mine to work either. How are you launching the integration in Houdini. Are you doing it via a startup script of some kind? I was testing by passing a .../python27.libs/pythonrc.py file via the HOUDINI_PATH

1 Like

Yes, I pretty much used the file provided by shotgun and it worked.

You have activate the shotgun shelf though from the shelf option.

1 Like

Hey Pritish,

Apologies for the delay in responding here. Phil asked for some help on this, but I was away on vacation for a while there.

I want to make sure I understand the issue as it stands presently:

  1. You have a plugin you’ve built – are you testing by having this plugin initialized on Houdini launch, or are you just in testing mode and kicking it off by hand from the Python console in an already running Houdini session?
  2. If I understand correctly, populating the TK_HOUDINI_TMP env var resolved at least some issues – did you also populate HOUDINI_PATH with that same path prior to Houdini being launched? My fear is that if it’s not in the environment before Houdini is launched that it’ll be too late for Houdini to source the menu configuration information during launch.

–Jeff

1 Like

@Jeff_Beeland Thank you for the reply. I am not launching the plugin by hand anymore. As I mentioned I am using the python file supplied in tk-houdini which I believe works on the same line as tk-maya.

I applied your suggestion of adding TK_HOUDINI_TMP env and I am happy to confirm that it has resolved the issue. The menu now shows up.

3 Likes

Hey - sorry for resurrecting this old thread. I have almost identical issue.
I try to bootstrap a vanilla/stock houdini engine with the following code:

sys.path.append(“//stuff/_sgconfigs/sgconfig_v05_base/install/core/python”)
import sgtk
mgr = sgtk.bootstrap.ToolkitManager()
mgr.base_configuration = “sgtk:descriptor:app_store?name=tk-config-basic”
mgr.plugin_id = “basic.houdini”
e = mgr.bootstrap_engine( ‘tk-houdini’, entity={“type”: “Project”, “id”: project_id} )

The engine seems to init OK, but no menus or shelves are created.
The same code works OK for maya. I also set up TK_HOUDINI_TMP envvar and I can see some XML files are being created there - yet nothing shows up in houdini.
What am I missing ?

EDIT:

I added the following code at the end

engine_root_path = e._get_engine_root_path()
sys.path.append(engine_root_path + '/python')
from tk_houdini import bootstrap
bootstrap.bootstrap_classic()

But I am getting an error: “Toolkitbootstrap is missing required env variable: TANK_CONTEXT”

It seems shelf installed and the toolkit works OK. It’s just the menus that are missing.
Also - I don’t need that extra code lines after bootstrap_engine()