dynamic loading of custom operators (.so or .dll)

   5982   2   0
User Avatar
Member
5 posts
Joined: June 2011
Offline
Hi!
Does anyone know a process (or is it possible at all) to load a custom operator (.so or .dll library compiled from c++) ‘dynamically’ when houdini is open?
I mean a node, from a .so or .dll file that would be place in the /dso/ folder, not an otl file.
Thanks

Ben
User Avatar
Member
183 posts
Joined: Nov. 2008
Offline
No, it's not possible, AFAIK. Only restarting houdini can reload custom HDK operators.
Aleksei Rusev
Sr. Graphics Tools Engineer @ Nvidia
User Avatar
Member
51 posts
Joined: Oct. 2006
Offline
There is probably no way to _load_ plugins once Houdini is already running, but at least in some cases they can be _reloaded_ with the following hack.

On Windows, open Python console, and type the following:
import _ctypes
handle = _ctypes.LoadLibrary(…your library path…)
_ctypes.FreeLibrary(handle)
If this the first reload during the session then invoke FreeLibrary once again.
Then recompile your plugin and do LoadLibrary etc.
On a Unix system use dlopen/dlclose instead, of course you can invoke load/free in any other way (calling external program etc), but it's already exposed via _ctypes (used by inlinecpp).
There are apparently limitations to this, e.g. you can't change operator name/label etc. but at least in some cases it works and it's faster than restart.
  • Quick Links