How to edit Python scripts in an external editor?

   1644   5   0
User Avatar
Member
291 posts
Joined: Aug. 2019
Offline
I'm talking about the Python scripts in an HDA:



When I press "Edit text in an external editor", it opens my editor of choice (VScode in my case):



But it's a *temp* file. When I make changes there and save it, the script in Houdini doesn't change at all!



It's definitely not how I expected "edit in an external editor" works. I googled and found this: http://cgtoolbox.com/houdini-expression-editor [cgtoolbox.com]

However, it only works for parameter expressions, not for scripts in HDAs.

Attachments:
Screenshot 2022-01-15 112221.png (83.9 KB)
Screenshot 2022-01-15 112255.png (71.4 KB)

User Avatar
Member
6239 posts
Joined: Sept. 2011
Online
If its an HDA, just save it as an expanded HDA, and edit the files directly. To see the changes in Houdini, use the Refresh Asset Libraries command in the Asset menu. Works better than reloading external python modules.

Using an external editor from within Houdini might as well not be an option at all. I could never get it to work reliably except with something simple like gedit on linux.
User Avatar
Member
291 posts
Joined: Aug. 2019
Offline
I found this:



It actually works for HDA's Python module script. But it's a weird "special case" and only works for that.

Attachments:
Screenshot 2022-01-16 112322.png (39.6 KB)

User Avatar
Member
6239 posts
Joined: Sept. 2011
Online
raincole
It actually works for HDA's Python module script. But it's a weird "special case" and only works for that.

That's some LABs baloney, not part of the Houdini base software.

raincole
When I press "Edit text in an external editor", it opens my editor of choice (VScode in my case):

This actually does work for me; it opens notepad and blocks Houdini until it's closed. If a software doesn't block when opened, then Houdini won't know when the file is finished being edited.
User Avatar
Member
4 posts
Joined: July 2019
Offline
raincole
I found this:

Image Not Found


It actually works for HDA's Python module script. But it's a weird "special case" and only works for that.


I'm trying to edit the interactive state script for my HDA in an external editor (VS Code). Using "Edit Extra Sections Source Code" does open the file in VSCode, but I don't see the code update in houdini on save?

Is it supposed to update on save?

EDIT:

Looks like it does not update on save. But when I don't have the type properties editor open, then I edit using "Edit Extra Sections Source Code", save my edits, when I reopen the type properties I see the edits!
Edited by wyhinton - July 4, 2022 18:23:23
User Avatar
Member
9 posts
Joined: May 2010
Offline
Im having massive problems with this functionality - every time I save the changes in vscode and then go back to my OTL, it first errors saying'Cannot access the OTL source:' ... then once I hit retry a few times - the node has one of 3 results: inherited changes, no inherited changes, or a complete scenefile crash. Usually one of the latter two.
Edited by bender83 - Sept. 28, 2022 17:42:44
  • Quick Links