Giter Site home page Giter Site logo

mxe's Introduction

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:

  1. Separate external editors for Python and VEX
  2. Small changes to context menus to be more accessible
  3. 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.

Installation:

  1. Download the .zip file
  2. Copy the "MXE" and "packages" folder to $HOME/houdiniXX.X folder(the houdini folder in your documents)

Setting External Editors:

  1. Open Houdini
  2. Go to Edit -> Preferences -> MXE: Set Editor(Python) and select the executable of the editor you want to use.
  3. Go to Edit -> Preferences -> MXE: Set Editor(Other) and select the executable of the editor you want to use.

Usage:

To edit Python SOP and Attribute Wrangle code:

  1. Right click the code parameter field(or label) and select MXE: Edit
  2. Alternatively, create a hotkey for it under Edit -> Hotkeys and press it while holding your mouse above the parameter label

To edit the hou.session module:

  1. Go to Windows -> MXE: Python Source

To edit Python Modules of HDAs(Viewerstates, HDA Module, OnCreated etc):

  1. Right click the HDA in the network pane
  2. Hit MXE: Extra Sections
  3. Pick the module you want to modify and hit accept

NOTE: The module has to exist beforehand. Create it inside the HDAs Type Properties!

To edit shelf tools:

  1. Right click the Shelf Tool and hit MXE: Edit

Sending code back to Houdini:

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.

Recommended editors to use:

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.

Configuration of external editors:

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.

VSCode for Python:

Plugins:

  1. Python
  2. Pylance

Autocompletion for hou module:

  1. Go to File -> Preferences -> Settings
  2. Search for "extra paths"
  3. Click on Edit in settings.json
  4. Add "$HFS/houdini/python3.7libs" to your "python.autoComplete.extraPaths"
  5. Add "$HFS/houdini/python3.7libs" to your "python.analysis.extraPaths"
  6. Set "python.defaultInterpreterPath" to "$HFS/python37/python.exe"
  7. 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"
    ],
}

VSCode for VEX:

Plugins:

  1. VEX
  2. Houdini Vex Help

PyCharm for Python:

Autocompletion for hou module:

  1. Go to File -> Settings
  2. Search for "interpreter" and select the Python Interpreter under your Project settings
  3. Select "$HFS/python37/python.exe" as Python interpreter
    (Example: C:\Program Files (x86)\Steam\steamapps\common\Houdini Indie\python37\python.exe)
  4. Click on the gear next to it and choose Show All...
  5. In the new window, click the Show paths for selected interpreter button(It's the last button in the row at the top)
  6. In the new window, click the + button and navigate to your "$HFS/houdini/python3.7libs" folder and hit OK
    (Example: C:\Program Files (x86)\Steam\steamapps\common\Houdini Indie\houdini\python3.7libs)
  7. Apply your settings
  8. Go to Help->Edit custom properties...
  9. Add the line idea.max.intellisense.filesize=5000(The hou module exceeds the default limit) and save
  10. Restart PyCharm

NOTE: You can't be in LightEdit mode to set this up, you have to open files as a project!

Sublime Text for VEX:

  1. Install the VEX Plugin according to the instructions on that page
  2. I recommend adding "auto_complete_use_history": true, to the settings under Preferences -> Settings. Otherwise, the ordering of the autocomplete is not the best.

Example:

{
	"auto_complete_use_history": true,
}

Sublime Text for Python:

  1. Install the Jedi Plugin according to the instructions on that page,
  2. Go to Preferences -> Package Settings -> Jedi -> Settings - User
  3. 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",
  ],
}

mxe's People

Contributors

peterprickarz avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.