Inside Sabertooth
Learn how Sabertooth uses 3ds Max to create 3D interactive projects, including HBO Go’s Game of Thrones interactive experience
  • 1/3
You are here: Forum Home / Autodesk® Softimage® / XSI SDK / Script editor with syntax highlighting and more
  RSS 2.0 ATOM  
19 pages: 10.13.14.15.16.17.19 first last

Script editor with syntax highlighting and more
Rate this thread
 
30199
 
Permlink of this thread  
avatar

Hi,

Thank you very much for Unicode support.

However, I think I found a problem.
When I type 2-byte chars in ScriptEd, everything’s fine, the chars appear as they should, and I can re-load the file (which contaings 2-byte chars) into ScriptEd which I created and saved with ScriptEd.
But when I open the file with XSI’s script editor, it’s garbled. See the 1st picture attached.

I tested opening the file with a few text editors, but it’s only garbled with XSI’s script editor, while any other editors were able to load it without garble.  Maybe ScriptEd saves files with the way XSI doesn’t like?

I also tested opposite way; I loaded an unicode file into ScriptEd which is created and saved within XSI’s script editor. This route, no prolbem, ScriptEd can load and display the unicode file properly.

I attached the unicode text file.
Any idea?

Also, it would be even better if ScriptEd supports ‘inline entering’, so that I can type 2-byte chars where the line I’m entering is. See the 2nd pic, when I type 2-byte chars using my Japanese input method program (MS-IME) in ScriptEd, MS-IME’s input bar is always away from the line I’m editing, while it’s exactly at the line I’m forcusing if I’m doing it in XSI’s script editor.

Thanks anyway, I’m using ScriptEd daily.



Attachment Attachment
Attachment Attachment
Attachment Attachment
Replies: 0
avatar
  • saajjj
  • Posted: 24 March 2009 12:11 PM

Hi junki,
I really appreciate your feedback and testing, thank you.

I tested opening the file with a few text editors, but it’s only garbled with XSI’s script editor, while any other editors were able to load it without garble. Maybe ScriptEd saves files with the way XSI doesn’t like?

This leads me to believe that there is something ‘odd’ with the XSI Script Editor implementation/understanding of Unicode. I don’t want to waste your time but could you perhaps save text files in Unicode through the ‘other’ editors and see if they open correctly in the XSI Script Editor? If they open correctly then the fault is in my end. Otherwise we can ask AD about it.

Also, it would be even better if ScriptEd supports ‘inline entering’, so that I can type 2-byte chars where the line I’m entering is. See the 2nd pic, when I type 2-byte chars using my Japanese input method program (MS-IME) in ScriptEd, MS-IME’s input bar is always away from the line I’m editing, while it’s exactly at the line I’m forcusing if I’m doing it in XSI’s script editor.

I had no idea what MS-IME was prior to your post. I have done some research and it appears that there is currently no way to make the inline popup box appear in the correct place with the text control that I’m using in ScriptEd. I’ll continue to explore further in this matter, but no promises :)

My thanks to all other users too

Cheers,



Replies: 0
avatar

Hi,

I did an another test. I saved a file containing 2-byte chars as UTF-8 (See the 1st pic attached) from Window’s Notepad. ScriptEd loads it property, while XSI’s Script Editor doesn’t (See the 2nd).

If I save it with Unicode or Unicode big endian in Notepad, both of ScriptEd and XSI’s editor load it propery.

I also did the same test using a few different editors and the result was the same --> XSI’s Script Editor does not load properly if the file is saved as UTF-8 no matter what text editor I use.

So, it seems to me ScriptEd saves files with 2-byte chars using UTF-8. Then, if ScriptEd is capable of saving files using XSI-friendly format like Unicode or Unicode big endian, this problem would go away I guess.  What do you think?
(I have to say I’m not familiar with this kind of stuff at all, so I could be totally wrong)

As for inline entering, it’s not a big problem so you shouldn’t take it seriously, but I don’t know of any other text editor that isn’t capable of inline entering, so I thought implementing it was kinda easy task. I’d like you to consider it if you have time

Thanks.



Attachment Attachment
Attachment Attachment
Attachment Attachment
Replies: 0
avatar
  • saajjj
  • Posted: 24 March 2009 11:31 PM

Hi junki,
Thanks again for your tests. It does seem that if the files are saved out as Unicode/Unicode Big Endian then the problem will disappear. Like I said earlier I’m totally new to unicode but I’m quite certain I’m saving out files as UTF-8. I will have to explore this further at home.

I’m a bit surprised though that all editors can read UTF-8 without issues except the XSI Script Editor. However, if saving out as Unicode/Unicode big endian solves the problem then all will be well.

About the inline text entering. The problem is with one of the libraries I’m using in ScriptEd, when the developers of that library fix it, it will be fixed automatically at my end. When they issue a fix is anyone’s guess :)

Cheers,



Replies: 0
avatar
  • saajjj
  • Posted: 28 March 2009 05:24 PM

Hi,
The Unicode issue has now been fullly resolved. The XSI Script Editor saves and reads Unicode files only encoded as UTF-16LE, anything else makes it display junk as shown in the images junki posted above. I’ve changed ScriptEd so that it saves all files in Unicode UTF-16LE. This will ensure that files saved from ScriptEd open in the native editor without issues.

This is a recommended update.

Another minor change is the addition of more file types in the ‘Save As’ dialog box. Previously, the user could only save a file with the extension of the active language selection. So if the active tab was JScript, by default ScriptEd would attach a .js extension to the file name. Now, a user may select, *.txt or *.* from the list to save as other extensions. The default behaviour, however, is as before.

The usual stuff follows:
The download link, as usual, is here (right click, ‘save as..’)

Please remember to both: uninstall & delete the previous version from XSI/system before installing the new version. Please read the Installation instructions in the first post if you’re installing ScriptEd for the first time.

[B]Note to 7.5 users[/B]: There is a bug in 7.5 which prevents a Custom Display Hosts being embedded in the layout. Autodesk is aware of the bug. This means that the bundled ScriptEd layouts will crash 7.5. You may however use ScriptEd through View > Others > ScriptEd. Instructions to map a shortcut key to ScriptEd are here

Junki,
If it’s not too much trouble, could you please verify that the latest release (1.92) works properly at your end?

Cheers,



Replies: 0
avatar

Thank you for the update, I tested, but I’m afraid there still seems to be a glitch.

If the file which contains 2-byte chars I saved from ScriptEd has just 1 line, it’s fine, XSI’s Script Editor can open it properly. However, if the file has more than 2 lines, XSI’s Script Editor can not even load it. If I load it into Windows’ Notepad and a few external editors, they can load but I can see garbled lines.

I tried with more than 2 lines without any 2-byte chars, then evetything is fine. So it’s obviously related to unicode thingy.

I also tried one line with 2-bytes, another line without 2-bytes, but still garbled. It seems if the file contains at least one 2-bytes chars, it will be garbled no matter how many lines there are.

So it seems to me that there is some problem with CR + LF when saving from ScriptEd if the file contains 2-bytes. What do you think?

Again, below is the result of my test.

1: just 1 line file containing 2-byte chars --> OK
2: more than 2 lines file WITHOUT any 2-byte chars --> OK

3: more than 2 lines file containing 2-byte chars --> garbled
(even if the 2nd line has no 2-byte chars)

I also attached the text file I used for this test.

Thanks,



Attachment Attachment
Attachment Attachment
Attachment Attachment
Replies: 0
avatar
  • saajjj
  • Posted: 31 March 2009 10:39 PM

Junki,
The garbled text appears to be linked to how line endings are being stored in ScriptEd. I’ll have a look at this over the weekend.

I’m retracting my earlier statement:

The Unicode issue turned out to be simpler to resolve than I initially thought.

:biggrin:

I should’ve checked for multiple lines myself. Silly me.
Thanks again!
Sajjad



Replies: 0
avatar
  • saajjj
  • Posted: 07 April 2009 11:20 AM

Hello,
The Unicode issue is finally fixed! Junki has checked the latest release, files saved in ScriptEd can be opened in the native SI Script Editor and vice versa without issues. For those interested, the bug was in how ScriptEd was writing the End of Line characters. Oddly enough the SI Script Editor writes/reads only UNIX style EOL chars, I had wrongly assumed that it would read Windows EOL chars.

My thanks to junki again for spending time on helping me with this.

[B]This is a recommended update[/B] (specially since the last recommended update is buggy)

I would be interested to hear from any other users who use localization in their scripts (using the latest version). I can only assume this localization would be used for arguments passed to the ‘logmessage’ command.

The usual stuff follows:
The download link, as usual, is here (right click, ‘save as..’)

Please remember to both: uninstall & delete the previous version from XSI/system before installing the new version. Please read the Installation instructions in the first post if you’re installing ScriptEd for the first time.

[B]Note to 7.5 users[/B]: There is a bug in 7.5 which prevents a Custom Display Hosts being embedded in the layout. Autodesk is aware of the bug. This means that the bundled ScriptEd layouts will crash 7.5. You may however use ScriptEd through View > Others > ScriptEd. Instructions to map a shortcut key to ScriptEd are here



Replies: 0
avatar

Saajj, thanks for the update. It works like a charm now.

I can only assume this localization would be used for arguments passed to the ‘logmessage’ command.

And obviously comments. An ability to write comments in my native language is crucial to me. :cool:



Replies: 0
avatar
  • saajjj
  • Posted: 27 April 2009 01:58 AM

Hello,
I’ve updated ScriptEd with a few things. A user informed me that ANSI encoded files weren’t opening/saving properly in ScriptEd. This happened after I had added support for Unicode files. I’ve enabled ANSI support again. The ANSI/Unicode business has been tested vigourously and users shouldn’t have any more problems. (Please do let me know if you encounter further issues)

Changes:

[LIST]
[*]Files which open as ANSI will get saved as ANSI and files which open as Unicode are saved as Unicode.
[*]A new file will be saved as Unicode.
[*]Files dragged into ScriptEd now open in a new tab
[*]~README.txt now has a complete list of supported shortcut keys
[*]A new context menu (right-click) similar to native script editor has been added. The major addition here is the “Add Command” option. The only sub-menu missing compared to the native editor is “Syntax Help”.
[*]I’m not sure if this has already been mentioned but ScriptEd now uses proper Tab spaces and not multiple character spaces. This should fix, if any, Python related issues.
[/LIST]
I’d like to point out that every vendor seems to be implementing file encoding in different ways. Although this shouldn’t be a serious issue, but three Microsoft word processing applications open the same file in three different ways. There is really nothing I can do to sort that.

Windows applications like Notepad++, Ultraedit, Edit Plus, Visual Studio (specialized text editors) etc. load files saved through ScriptEd properly - yay :)

[B]Recommended Upgrade:[/B]
I would recommend everyone upgrade to this version as previous versions will NOT be able to open ANSI encoded files properly.

The usual stuff follows:
The download link, as usual, is here (right click, ‘save as..’)

Please remember to both: uninstall & delete the previous version from XSI/system before installing the new version. Please read the Installation instructions in the first post if you’re installing ScriptEd for the first time.

[B]Note to 7.5 users[/B]: There is a bug in 7.5 which prevents a Custom Display Hosts being embedded in the layout. Autodesk is aware of the bug. This means that the bundled ScriptEd layouts will crash 7.5. You may however use ScriptEd through View > Others > ScriptEd. Instructions to map a shortcut key to ScriptEd are here



Replies: 0
19 pages: 10.13.14.15.16.17.19 first last