Artists' Guide for External Editor for Scripting in Houdini

   10492   8   3
User Avatar
Staff
99 posts
Joined: Feb. 2021
Offline
Hi, want to improve your experience coding in wrangles? The title may seem like an oxymoron, but hey, never say never.

So I'd like to share with you a reference document I've made to configure my external editor Sublime Text 3. It was helpful every time I migrated to a new personal or work computer. I can set things up the way I liked them in a few minutes. The editor gives you options for auto-formatting, different color schemes, auto-completion, function help cards, etc.

SideFX is also working on improving our own text editor. But in case you want to try out Sublime Text in the meantime, here is your guide.

https://docs.google.com/document/d/1Vebq04Ycz1cjHlprzNyn23O6tkP3QJJll1bwbwuD18s/edit?usp=sharing [docs.google.com]


Feel free to leave comments for improvements. Shout-outs to the developers who created the packages included in the document.




Edited by MaiAo - March 19, 2021 11:21:48

Attachments:
Sublime Python Example.png (42.1 KB)
Sublime VEX Example.png (68.5 KB)

Mai Ao
Senior Technical Lead of SideFX Labs
youtube.com/@notverydarkmagic
User Avatar
Member
28 posts
Joined: March 2016
Offline
Thanks!
FX reel https://vimeo.com/523174378 [vimeo.com]
User Avatar
Staff
99 posts
Joined: Feb. 2021
Offline
The latest update to Sublime Text hard-bound its new Safe Mode to Alt+Shift. If like me, you previously bound Houdini's Edit in External Editor hotkey to Alt+Shift+<something>, to prevent launching from Houdini into Sublime Text Safe Mode, try rebinding the Edit in External Editor hotkey to Alt+D. It's one of those combinations that don't trigger a conflict.
Edited by MaiAo - May 29, 2021 08:28:26
Mai Ao
Senior Technical Lead of SideFX Labs
youtube.com/@notverydarkmagic
User Avatar
Member
9 posts
Joined: Dec. 2013
Offline
This is very cool. I had no idea you could do this but I just set it up to use Visual Studio Code.

As I got tripped up on getting the external editor hot keys to work let me add to the thread as maybe it will help someone else in the future.

Where your mouse is located when you press the hotkey is very important and determines if it works or not.

Your cursor can't be typing text or the shortcut won't work. So first make sure you click out of the text box. Next when you press the shortcut make sure you are hovering your mouse over where it says "VEXpression" on like an AttWrangle node or "Python Code" on a python node, etc to launch the external editor. If you are hovering over other parts you will still open the external editor but you won't actually have a live link to the text box and are creating a new file.
User Avatar
Member
43 posts
Joined: Sept. 2017
Offline
This is great, much appreciated.

Is there anything similar (auto-completion, function help) for writing python with hou?
User Avatar
Member
7 posts
Joined: Oct. 2020
Offline
i need to report a problem though, if you delete the houdini program where the external editor is set up and then reinstall the same version it would cause freeze when you press right key in the wrangle window.
User Avatar
Member
113 posts
Joined: Aug. 2013
Offline
I'm having trouble setting this up. I've defined Sublime both as EDITOR and as VISUAL in the houdini.env file. But I can't get it to work properly from within Houdini.
For example: in the case of wrangles the keyboard shortcut doesn't work, or even if it launches the editor then changes and saving from Sublime will not work. But if I right click the vex editor and select from the menu Expression > Edit in external editor Sublime will work. It gets even more weird if I try to setup a shortcut for python editor.
I'm not sure what to try next.
Edited by coccarolla - April 23, 2025 03:34:11
User Avatar
Member
68 posts
Joined: April 2020
Offline
coccarolla
ing this up. I've defined Sublime both as EDITOR and as VISUAL in the houdini.env file. But I can't get it to work properly from within Houdini.
For example: in the case of wrangles the keyboard shortcut doesn't work, or even if it launches the editor then changes and saving from Sublime will not work. But if I right click the vex editor and select from the menu Expression > Edit in external editor Sublime will work. It gets even more weird if I try to setup a shortcut for python editor.
I'm not sure what to try next.
airlawn solved the hotkey issue a couple of posts up. you have to click outside the text editor and then hold your mouse over the VEXPRESSION text above the text editor and then fire your hotkey. so weird. i never would have figured that out. haha.

EDIT : oddly holding my mouse over the VEXPRESSION and hitting alt-d doesn't work sometimes and it's not because the text editor is active. what appears to fix it is if i right click on the VEXPRESSION button and then click off to the grey part of the window and THEN press alt-d it works. so odd.
Edited by indigosm - May 16, 2025 17:00:04
User Avatar
Member
68 posts
Joined: April 2020
Offline
has anyone figured out how to get the vex code included in your #include to work with autocomplete in other text editors? i tried in both SUBLIME TEXT and VSCODE and couldn't get it with either. i also tried adding the directory my included file is in to the sublimeText/vsCode projects but that didn't fix it either.

it's so weird because if i type a function that's in the #include in sublime text and hover my mouse over it, it does know it's a function and lists where it came from, but it still doesn't work with autocomplete, which is what i really want... i have so many external functions and i can never remember their names or their arguments so i wish i had autocomplete to help with that.
Edited by indigosm - May 14, 2025 20:17:08
  • Quick Links