Is there a way to refresh Python Panels edited in an external editor?

   4079   5   2
User Avatar
Member
4 posts
Joined: April 2017
Offline
Currently I'm editing my Panel with the Python Panel Editor and it can refresh whenever I hit Apply, however I was trying to setup a workflow where I can edit the .pypanel file in VS Code and then refresh the panel in Houdini. I've tried loading my panel into the Python Panel and hitting the “Refresh” button, but it looks like that only reloads changes made in the Houdini Python Panel Editor, not externally. Changes made externally seem to require restarting Houdini. Is there another workaround for this?

Thanks,

Justin
User Avatar
Member
4 posts
Joined: April 2017
Offline
I ended up just making a build system to transpile my .py file into a .pypanel file, but still need to restart Houdini upon changes. Doesn't look like there are any “Refresh Panels” methods to call.
User Avatar
Member
183 posts
Joined: Nov. 2008
Offline
Just reload all your modules in the onCreateInterface and upon changes, you can hit the reload interface button on the python panel itself.

def onCreateInterface():
    import mymodule
    reload(mymodule)
    
    return mymodule.panel_widget()
Edited by Stalkerx777 - Oct. 24, 2019 15:28:37
Aleksei Rusev
Sr. Graphics Tools Engineer @ Nvidia
User Avatar
Member
4 posts
Joined: April 2017
Offline
Oh nice, I was looking for a single-file solution, but that totally works for development. Thanks!
User Avatar
Member
1 posts
Joined: April 2019
Offline
Is there a way to update the Python panel in realtime without pushing reload interface button
User Avatar
Member
251 posts
Joined: July 2013
Online
look into the python watchdog module, it can trigger events when files are modified.
More code, less clicks.
  • Quick Links