HDA fails to load python module.

   1708   2   0
User Avatar
Member
9 posts
Joined: 5月 2017
Offline
I tried to call some functions in Python module, but it failed.
This problem occurs irregularly, so I can't specify the reason.

Why I can't call my functions? How to avoid this problem?
Edited by Escatra - 2021年2月20日 13:02:36

Attachments:
nonamed.png (292.4 KB)

User Avatar
Member
1906 posts
Joined: 11月 2006
Offline
It looks like all your function definitions are in event handling script sections of your asset and not the "PythonModule" section which is what you can access via the hdaModule() calls. If you move those definitions to that section you should be able to access them from callbacks and stuff.

Alternatively you can use the toolutils.createModuleFromSource to create modules from other sections, though that's probably more annoying to do for actual callbacks: https://www.sidefx.com/docs/houdini/hom/locations.html#asset_modules [www.sidefx.com]
Graham Thompson, Technical Artist @ Rockstar Games
User Avatar
Member
9 posts
Joined: 5月 2017
Offline
Wait... I never noticed that the section is changed to 'OnInputChanged'...
I think I didn't changed, it might be some mistake. Thanks!
  • Quick Links