Jump to content

External Editors for editing python scripts


Recommended Posts

Dear community,

 

 

I know how to set my env variable

I know how to setup houdini with the commandline

etc etc

 

However why do external editors not work with Houdini. I configured sublime text "subl". Even tried pycharm (which is nice), however this blinks and then the opened file has suddenly disppeared.

 

When i push the external editor button, it opens sublime text, with my code in a tmp file like hfs23423-231.tmp.cmd after which i can edit it. However I expect it to stream and live update the edited code back to houdini when pressing cmd-s!

 

who knows what's wrong?

Link to comment
Share on other sites

no body is answering..

 

Don't know, but i would think this would interest a great bunch of people. Writing python code within Houdini kind of sucks. Being able to do this with an external editor is a big improvement...

 

 

soo..

Link to comment
Share on other sites

I don't think there is real time editing like you want. If you launch the external editor, Houdini is waiting for that editor to be saved and/or closed to become interactive again.

 

With some clever tricks, you might get it working but python is not the only code, you need to think of VEX too. With Python I know you can have the SOP for example to read from a file on disk, but that would still have to reload. So you could add a Reload button or use the Apply button in the Type properties dialog if you don't mind that.

 

I think the best bet is for SESI to add an advanced editor control like this:

http://www.actiprosoftware.com/products/controls/wpf/syntaxeditor

 

It's pretty cheap and you get full source code, but not sure if they would be willing to use a .net control (Winforms, or WPF). It's the most advanced editor control I know of and can support any custom language. It's basically Visual Studio's editor control riding the bike (steroids)  :)

 

If they added this, it would be 100x more fun to write code and expressions.

Edited by magneto
Link to comment
Share on other sites

first thanks for your answer;)

 

If you launch the external editor, Houdini is waiting for that editor to be saved and/or closed to become interactive again.

 

second, although live streaming would be awesome, it was not what i thought it should do. The thing above on which i quote you is exactly the behaviour i expected, but does not happen at mine :S

 

this is what happens: i push alt-e > it opens the external editor (sublime text 3) > it has the code in it i can edit this, but when i save nothing happens or updates within houdini

 

looks good the link ;)

Link to comment
Share on other sites

Just wondering if you got anywhere with this? Is it possible to hack / mod houdini for it to work properly? I've got my houdini setup with Sublime Text (and this great VEX package for it) but currently the only way I've found it works is:

 

- select your code field in houdini (e.g. wrangle snippet)

- press alt-e to open the code window

- click on the 'external editor' button on the code window

- edit in sublime

- close the window and save on exit

- click apply in the code window, and only then does it apply.

 

Obviously this is ridiculously unusable. It's easier to just copy paste from sublime into the snippet field! (Which is what i'm currently doing). Surely it can't be too difficult to hack this in to work properly?

Link to comment
Share on other sites

Guest mantragora

You got bad workflow guys. In your code field you should just put:

import FooModule as mantragora
reload(mantragora)

mantragora.Tools.Foo_Tool()
and the rest of the magic happens in your external editor all the time. The script is stored in "scripts/python" folder and you don't have to mess with code field anymore.
Link to comment
Share on other sites

You got bad workflow guys. In your code field you should just put:

import FooModule as mantragora
reload(mantragora)

mantragora.Tools.Foo_Tool()
and the rest of the magic happens in your external editor all the time. The script is stored in "scripts/python" folder and you don't have to mess with code field anymore.

 

what about 5-10 lines of python expression. i need to create file with module for this?

Link to comment
Share on other sites

Guest mantragora

what about 5-10 lines of python expression. i need to create file with module for this?

Original title of this topic mentions editing python "scripts" :), not expresions.

For 5-10 lines of code I wouldn't even bother with external editor.

  • Like 1
Link to comment
Share on other sites

  • 8 months later...

Just wondering if you got anywhere with this? Is it possible to hack / mod houdini for it to work properly? I've got my houdini setup with Sublime Text (and this great VEX package for it) but currently the only way I've found it works is:

 

- select your code field in houdini (e.g. wrangle snippet)

- press alt-e to open the code window

- click on the 'external editor' button on the code window

- edit in sublime

- close the window and save on exit

- click apply in the code window, and only then does it apply.

 

Obviously this is ridiculously unusable. It's easier to just copy paste from sublime into the snippet field! (Which is what i'm currently doing). Surely it can't be too difficult to hack this in to work properly?

 

I created a plugin that does exactly what you want:

https://github.com/ArthurYidi/Houdini-External-Editor

 

Check it out!

Link to comment
Share on other sites

  • 2 weeks later...
  • 4 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...