MXE: Multiple External Editors for Houdini
This is a modified version of CGToolbox Houdini Expression Editor for Houdini that ships with SideFXLabs.
The main changes are:
- Separate external editors for Python and VEX
- Small changes to context menus to be more accessible
- Uses Houdinis package system
There is a comparison of external editors and instructions to make them work with autocompletion and some other nice features for VEX and Python below.
You can also use these instructions if you're using the original version of this extension that ships with SideFXLabs.
- Download the .zip file
- Copy the "MXE" and "packages" folder to $HOME/houdiniXX.X folder(the houdini folder in your documents)
- Open Houdini
- Go to
Edit
->Preferences
->MXE: Set Editor(Python)
and select the executable of the editor you want to use. - Go to
Edit
->Preferences
->MXE: Set Editor(Other)
and select the executable of the editor you want to use.
- Right click the code parameter field(or label) and select
MXE: Edit
- Alternatively, create a hotkey for it under
Edit
->Hotkeys
and press it while holding your mouse above the parameter label
- Go to
Windows
->MXE: Python Source
- Right click the HDA in the network pane
- Hit
MXE: Extra Sections
- Pick the module you want to modify and hit accept
NOTE: The module has to exist beforehand. Create it inside the HDAs Type Properties!
- Right click the Shelf Tool and hit
MXE: Edit
To send the modified code from your editor to Houdini, just save it in your editor. The extension works using a filewatcher.
You can use autosave features of your editor as a sort of live editing feature. I don't recommend this though.
VSCode | PyCharm | Sublime Text | |
---|---|---|---|
Python | ✔️ | ✔️ | ✔️ |
Pros | - Great Autocompletion with Pylance - Fast startup - Decent project management features - Clean UI |
- Great Autocompletion - Relatively simple setup - Great features for Python development - You probably use it already anyways |
- Fast startup - Clean UI |
Cons | - Complex setup - Lacks features compared to PyCharm |
- Slow startup time - Can be convoluted for simple scripts |
- Lacks basic features - Bad Autocompletion |
VEX | ✔️ | ❌ | ✔️ |
Pros | - Good Autocompletion - Plugin for opening docs of functions |
- | - Good Autocompletion - Snippets(for loops etc.) - VEX documentation in editor |
Cons | - No documentation in editor | - | - Not free |
As you can see, VSCode is decent for both VEX and Python and has the advantage that you can do both in one editor. However, PyCharm is equally good or better for Python and Sublime Text is better for VEX. I recommend deciding this the following way:
Do you use PyCharm for other Python projects anyways? Use PyCharm for Python and Sublime Text for VEX.
You don't use PyCharm anyways? Choose freely between VSCode and PyCharm for Python.
Picked VSCode for Python? Choose VSCode for VEX aswell if you like to have everything in one editor. If you don't care, choose Sublime Text.
Picked PyCharm for Python? Use Sublime Text for VEX.
NOTE: These are just my opinions, feel free to disagree and use whatever you want.
This section includes the configuration of all relevant external editors for Houdini. It's completely optional but I highly recommend it if you are going to use one of these.
- Go to
File
->Preferences
->Settings
- Search for "extra paths"
- Click on
Edit in settings.json
- Add "$HFS/houdini/python3.7libs" to your "python.autoComplete.extraPaths"
- Add "$HFS/houdini/python3.7libs" to your "python.analysis.extraPaths"
- Set "python.defaultInterpreterPath" to "$HFS/python37/python.exe"
- Restart VSCode
As an example, this is how it looks in my case(Note: Your paths should use \\
or /
, not \
):
{
"python.autoComplete.extraPaths": [
"C:\\Program Files (x86)\\Steam\\steamapps\\common\\Houdini Indie\\houdini\\python3.7libs"
],
"python.defaultInterpreterPath": "C:\\PROGRA~2\\Steam\\STEAMA~1\\common\\HOUDIN~1\\python37\\python.exe",
"python.analysis.extraPaths": [
"C:\\Program Files (x86)\\Steam\\steamapps\\common\\Houdini Indie\\houdini\\python3.7libs"
],
}
- Go to
File
->Settings
- Search for "interpreter" and select the Python Interpreter under your Project settings
- Select "$HFS/python37/python.exe" as Python interpreter
(Example:C:\Program Files (x86)\Steam\steamapps\common\Houdini Indie\python37\python.exe
) - Click on the gear next to it and choose
Show All...
- In the new window, click the
Show paths for selected interpreter
button(It's the last button in the row at the top) - In the new window, click the
+
button and navigate to your "$HFS/houdini/python3.7libs" folder and hitOK
(Example:C:\Program Files (x86)\Steam\steamapps\common\Houdini Indie\houdini\python3.7libs
) - Apply your settings
- Go to
Help
->Edit custom properties...
- Add the line
idea.max.intellisense.filesize=5000
(The hou module exceeds the default limit) and save - Restart PyCharm
NOTE: You can't be in LightEdit mode to set this up, you have to open files as a project!
- Install the VEX Plugin according to the instructions on that page
- I recommend adding
"auto_complete_use_history": true,
to the settings underPreferences
->Settings
. Otherwise, the ordering of the autocomplete is not the best.
Example:
{
"auto_complete_use_history": true,
}
- Install the Jedi Plugin according to the instructions on that page,
- Go to
Preferences
->Package Settings
->Jedi
->Settings - User
- Add "$HFS/houdini/python3.7libs" to your "python_package_paths"
Example:
{
"python_package_paths": [
"C:/Program Files (x86)/Steam/steamapps/common/Houdini Indie/houdini/python3.7libs",
],
}