Hi!
I have a weird problem with Python and Digital Assets:
My HDA has a few Python modules which runs every time I press a certain button.
The problem is every time I start a new session I cannot use the button, It gives an error that the python module doesn't exist.
So I have to dive inside the python module, just add a single space to the code and remove it and save the changes to be able to use the tool. I feel it is because the python module does not reload automatically.
I have been dealing with this problem for quite a while and don't know how to solve it.
It would be great if you can help me with this issue.
Thanks
-Ali
HDA python module doesn't work every first time it is opened
5400 6 1- Seiffouri
- Member
- 41 posts
- Joined: 5月 2010
- Offline
- julca
- Member
- 219 posts
- Joined: 10月 2015
- Offline
Hello,
If it's just a reload problem just use the “reload(yourModule)” function.
But, as that's the entire module which not found, I suggest you to add your module folder path in your system path :
Hope that help you.
If it's just a reload problem just use the “reload(yourModule)” function.
But, as that's the entire module which not found, I suggest you to add your module folder path in your system path :
import sys currentPackagePath = "fullPathToYourScript/moduleFolder" if not currentPackagePath in sys.path : sys.path.append(currentPackagePath) #Now, import your module should work import yourModule
Hope that help you.
- Seiffouri
- Member
- 41 posts
- Joined: 5月 2010
- Offline
julca
Hello,
If it's just a reload problem just use the “reload(yourModule)” function.
But, as that's the entire module which not found, I suggest you to add your module folder path in your system path :import sys currentPackagePath = "fullPathToYourScript/moduleFolder" if not currentPackagePath in sys.path : sys.path.append(currentPackagePath) #Now, import your module should work import yourModule
Hope that help you.
Thanks Julca
But the python module is a part of my digital asset, How about that?
- julca
- Member
- 219 posts
- Joined: 10月 2015
- Offline
- mackerBaehr
- Member
- 86 posts
- Joined: 2月 2014
- Offline
- Roger Wellard
- Member
- 15 posts
- Joined: 3月 2015
- Offline
For anyone stumbling across this topic,
hou.hda docs [www.sidefx.com]
Running in the shell or in a callback:
will reload your python houdini module imports
Hope it helps someone
hou.hda docs [www.sidefx.com]
Running in the shell or in a callback:
hou.hda.reloadHDAModule(hou.node(pathtonodehere).hdaModule())
Hope it helps someone
Edited by Roger Wellard - 2020年9月1日 10:03:06
- danialrashidi
- Member
- 1 posts
- Joined: 11月 2013
- Offline
-
- Quick Links