[py] Custom Radial Menus for digital assets. How to load the radial file?

   1098   1   1
User Avatar
Member
900 posts
Joined: Feb. 2016
Offline
Hello,

I would like to ship my digital asset with a custom radial menu file, to be loaded when the asset is created, and removed once the node is deleted.
I guess I have to save the radial file in the “extra files” section of my digital asset, right?

But how to load the file with python?
In the radial menu documentation I can happen to see only the .save(filename) function.
The sourceFile() description mentions that it can be possible to load it. Do you know how to?
http://www.sidefx.com/docs/houdini/hom/hou/RadialMenu.html [www.sidefx.com]


I guess I could create the radial menu with python, but it seems a unnecessary effort to code it, considered that I could instead create it easily with the Houdini Wizard, save it to file, and embed it my digital asset, ready to be loaded back.

Thanks for any help,
Cheers
User Avatar
Member
900 posts
Joined: Feb. 2016
Offline
Ohhh, I finally understand. You have to save the radial menu in the $HOUDINI_USER_PREF_DIR/radialmenu directory. It will be loaded on the next session (when hou check the files to load on startup).

So in case you have a custom radial menu specific for you digital asset, a nice workflow could be:
you create a radial menu with the wizard, instead of bothering with python.
Take the file and store it in the “Extra Files” section of you hda, which onCreated() would save the radial menu file in the $HOUDINI_USER_PREF_DIR of the new user using your hda.

Only problem I can see is that the new radial menu will be loaded only on the next session. Won't be ready to use as soon as you save it with python.
Would be nice to have a function in python that force the UI to refresh radial menu directory.

I will investigate a little more to be sure I'm not missing something, before bothering the support, and then might push a feature request..
Edited by Andr - Feb. 22, 2019 04:10:37
  • Quick Links