Hi all!
I have few python classes that I wanna use in diffrent places (inside hooks, but also in houdini HDA)
I was trying to set up framework, and then import module inside this framework in my HDA python script, but I’m deffinitelly doing something wrong.
So can someone do a little summary of how to use modules from framework inside standalone scirpt/HDA? Ofc I run Houdini through shotgrid desktop app,
Right now I’m trying to get acces to it through sgtk.platform.import_framework() function, and I’m getting this error:
Traceback (most recent call last):
File “C:\Users\p.wiktorek\AppData\Roaming\Shotgun\juicewro\p7596c8010.basic.desktop\cfg\install\core\python\tank\platform\util.py”, line 47, in _get_current_bundle
calling_name_str = caller.f_globals[“name”]
KeyError: ‘name’
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File “p.wiktorek::Sop/Asset_Loader::1.0, PythonModule”, line 13, in
File “C:\Users\p.wiktorek\AppData\Roaming\Shotgun\juicewro\p7596c8010.basic.desktop\cfg\install\core\python\tank\platform\util.py”, line 234, in import_framework
current_bundle = _get_current_bundle()
File “C:\Users\p.wiktorek\AppData\Roaming\Shotgun\juicewro\p7596c8010.basic.desktop\cfg\install\core\python\tank\platform\util.py”, line 56, in _get_current_bundle
raise TankCurrentModuleNotFoundError(
tank.platform.errors.TankCurrentModuleNotFoundError: import_framework could not determine the calling module layout! You can only use this method on items imported using the import_module() method!
Any help would be appreciated! Thanks