H14 Python source editor

   4878   8   1
User Avatar
Member
319 posts
Joined:
Offline
Is anyone else having problems writing/testing code in the python source editor in H14?

There's no specific example I can give as it seems so inconsistent, but it is reporting traceback errors to me on code that is perfectly legal.

For example, with the exact same code, I get an error, delete it, write it again, evaluates fine. Or erroring on commented code! (When I delete the comment, the error goes away).

Or erroring on extra whitespace at the end of code. I remember in previous builds sometimes you get whitespace or carriage returns at the end of a script causing an error, but it was nowhere near this bad. Just writing a simple 4 line function takes 10 times as long now due to traceback errors that aren't valid. Is anyone else noticing this problem?

14.0.265
User Avatar
Member
2631 posts
Joined: June 2008
Offline
I am not having those problems using R14. But I think we can all agree the editor is junk software kind of like the editor in Maya. No one really uses them for serious work.

Copying and pasting from WEB sources can introduce illegal characters which can cause problems. That is why re-typing can often work. Also Python is TAB centric which is annoying as poop.

On Windows I use Programmers Notepad 2 for my python work. On OSX there is no acceptable code editor except xCode which is not Python friendly.

There are free CC-0 license editors out there that could be integrated into Houdini as better replacements than what is already there. I think brick and mortar style companies like SideFx might be afraid of proposing such a bold move in fear of offending “old-salts” that have been loyally using their product for years. This is where the “old-salts” need to chime in and say frack the crap homey we want something new and modern. :wink:

We want CTRL-D, duplicate line!
Using Houdini Indie 20.0
Windows 11 64GB Ryzen 16 core.
nVidia 3050RTX 8BG RAM.
User Avatar
Member
319 posts
Joined:
Offline
None of the occurrences of strange behaviour involves copy and pasting any code, its all been typed from scratch. I've been writing Python for a while also, so I'm familiar with all its formatting requirements.

I find the python source editor and the hou.session() module useful for little one off things, not for anything comprehensive, just for small automation tasks I want to do within a specific hip file. Not having the source editor evaluate correctly/consistently, even for a 3 line function, is a bit of a headache!
User Avatar
Member
39 posts
Joined: Feb. 2007
Offline
Sublime text editor might help. Its quite a good replacement for python source editor in houdini, and it also has vex syntax highlighting.

http://forums.odforce.net/topic/22129-houdini-exhelp-sublime/ [forums.odforce.net]
http://forums.odforce.net/topic/20148-external-editors-for-editing-python-scripts/page-2 [forums.odforce.net]
http://www.sublimetext.com/ [sublimetext.com]
User Avatar
Member
665 posts
Joined: July 2005
Offline
Hey Dean,

Can you provide an example of the offending code?

-j
User Avatar
Member
319 posts
Joined:
Offline
Yep I've been told sublime is pretty good.

Here's a couple of examples Jacob:-

1st image error on a comment

2nd image errors with trailing carriage return

3rd image no error with no carriage return

This morning while making these examples though the errors seem to be more consistent, i.e. trailing carriage returns or a comment as the last line of the function. Yesterday I had all sorts of trouble writing a three line function that would eval fine but then error. Seems more predictable today though, so if the behaviour is consistent like this I can live with it!!

Attachments:
comment_error.png (34.7 KB)
error_onCR.png (30.0 KB)
no_error_withoutCR.png (24.4 KB)

User Avatar
Member
665 posts
Joined: July 2005
Offline
Yea, houdini isn't good w/ last lines…

Just try to write an hscript function in a cmd file, and you'll see that it always ignores the last line of the file.

Wouldn't hurt shooting it over to SESI if you can reproduce it.

-j
User Avatar
Member
319 posts
Joined:
Offline
Just out of interest, does it not act the same way for you?

I can reproduce the last line tracebacks consistently…
User Avatar
Member
1922 posts
Joined: Nov. 2006
Offline
Last lines that are either commented out code or notan empty string have always been a problem
Graham Thompson, Technical Artist @ Rockstar Games
  • Quick Links