How to edit Python scripts in an external editor?

   7357   6   1
User Avatar
Member
692 posts
Joined: 8月 2019
オフライン
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
8173 posts
Joined: 9月 2011
オフライン
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
692 posts
Joined: 8月 2019
オフライン
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
8173 posts
Joined: 9月 2011
オフライン
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
5 posts
Joined: 7月 2019
オフライン
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 - 2022年7月4日 18:23:23
User Avatar
Member
39 posts
Joined: 5月 2010
オフライン
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 - 2022年9月28日 17:42:44
User Avatar
Member
13 posts
Joined: 8月 2013
オフライン
Any updates or roadmap plans around this? The python dev ecosystem has exploded in elegance and sophistication these last couple of years. Would love to be able to work on Houdini python code in a more modern way.

e.g. the way TouchDesigner lets you sync python code with external file
Edited by Michela Ledwidge - 2025年2月27日 18:13:47

Attachments:
screenshot.png (97.9 KB)

  • Quick Links