Jump to content
strages

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?

Share this post


Link to post
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..

Share this post


Link to post
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

Share this post


Link to post
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 ;)

Share this post


Link to post
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?

Share this post


Link to post
Share on other sites

Not so difficult. for me it is:

1. focus code field

2. alt+e twice

3. edit code

4. ctrl+w+enter

5. click on accept button in internal editor

 

strages It doesn`t work with sublime 3, but it works with sublime 2

Edited by Alexey Vanzhula

Share this post


Link to post
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.

Share this post


Link to post
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?

Share this post


Link to post
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

Share this post


Link to post
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?

 

I created a plugin that does exactly what you want:

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

 

Check it out!

Share this post


Link to post
Share on other sites

TameSpiritedKinkajou.gif

Hi Arthur, i didn't check it out , possible to provide a video as well?

 

  • Like 1

Share this post


Link to post
Share on other sites

For Sublime fans, you should also check out SubTunel which allows to control various scripting contexts (Node, HDAs, shelftools) entirely from Sublime.

 

https://github.com/kubaroth/SubTunnel

 

It would be nice if someone integrated inside a Houdini pane using qt :)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×