Hi all!
I've recently been looking into the new recipe system in Houdini and have been trying to create new recipes through the Python API using commands like hou.data.saveNodePresetRecipe(). However, I've hit a little snag, I am able to write out files to disk and the recipe does immediately appear on the intended node, but after a restart of Houdini, the recipe is gone from the overview, even though it is still on disk. If I try saving a recipe with the built-in tools I do not get this behavior, also, the built-in tools store the recipes inside a .hda file, while this command seems to give a more raw output, instead, creating a folder on disk with a .json file containing all the parameters and options for the recipe with some other supporting text files.
So far, I have only tried to store these custom recipes either inside the oils folder or the Presets folder of my prefs folder. I am not sure if there is another directory I should store them in or if I have to specify a directory as an environment variable in the .env file so that Houdini knows where to find them.
If anyone knows why the recipes created by this command are only visible while I keep Houdini open and are lost when I restart, I'd be very grateful if you could share your knowledge. Is this command only intended to be used alongside the hou.data.applyNodePresetRecipe() command to recreate the recipes?
Thanks for the read!
[SOLVED] Help creating new recipes with the python API
1137 1 0-
- underscoreus
- Member
- 26 posts
- Joined: July 2017
- Offline
-
- underscoreus
- Member
- 26 posts
- Joined: July 2017
- Offline
Ended up figuring this out with some help from a kind stranger over on Discord.
My problem was two-fold:
1. I wasn't specifying a file extension in the third argument of the hou.data.saveNodePresetRecipe function, meaning that the file was created on disk as a blank file. On Linux this file was just interpreted as a folder with multiple other files inside (a .json file and a few other files). This made the recipe work in the Houdini session it was created (maybe the command adds the recipe to memory while Houdini is open?) but did not end up loading it when Houdini was re-launched. Instead, the recipes should be stored as a .hda file, which I should have been able to infer.
2. I was storing the recipes in the C:/users/my_user/Documents/houdini20.5/Presets folder instead of the C:/users/my_user/Documents/houdini20.5/otls folder. This also causes the recipe to only be available in the Houdini session it was created in, even if the file is saved on disk as a .hda file. When I switched to use the otls folder and saved the recipe as a .hda file everything worked immediately as expected.
My problem was two-fold:
1. I wasn't specifying a file extension in the third argument of the hou.data.saveNodePresetRecipe function, meaning that the file was created on disk as a blank file. On Linux this file was just interpreted as a folder with multiple other files inside (a .json file and a few other files). This made the recipe work in the Houdini session it was created (maybe the command adds the recipe to memory while Houdini is open?) but did not end up loading it when Houdini was re-launched. Instead, the recipes should be stored as a .hda file, which I should have been able to infer.
2. I was storing the recipes in the C:/users/my_user/Documents/houdini20.5/Presets folder instead of the C:/users/my_user/Documents/houdini20.5/otls folder. This also causes the recipe to only be available in the Houdini session it was created in, even if the file is saved on disk as a .hda file. When I switched to use the otls folder and saved the recipe as a .hda file everything worked immediately as expected.
-
- Quick Links