I have a python 3.9 project (not integrated with Houdini in any way). I have multiple versions of Houdini installed such as H19.5 and H20. For both of those installs, I need my python project to grab all of the processed package config data that Houdini locates in /packages in the .json files there. This data contains the paths to any given plugin location on disk as environment variables, among other config data, which allows Houdini to actually locate and load plugins.
Since those .json package files can contain variables that need to be resolved, on startup, Houdini will resolve the config files to produce absolute file paths and such. I believe Houdini does this through hconfig.exe, since if you call hconfig.exe through python (using the subprocess command), it will give you that exactly nice processed data.
The problem is I don't know how to get that data for every Houdini install. My python project is using Python3.9. But if I try to run H20's hconfig.exe from Python3.9, I will get an error saying 3.9 and 3.10 are incompatible. This is because H20 ships with python3.10.
I do not want to change the python version my project is built upon every time Houdini ships with a new python version. I'd like it to be future proof for all future Houdini versions. Is there an easy way to get all the processed package data for all Houdini installs found on disk?
I've played around with hython and managed to get it to output all that useful processed package data using:
# import os # os.environ # nevermind (ignore above code), this is better code that only gives the plugin paths hou.getenv("houdini_path")
The issue is that all the env vars are mixed together (not separated by which config file they originated from) and they're also mixed in with a whole lot of other data I don't want.
What's the solution here? How do I easily get this data in a clean and efficient way?