PDA

View Full Version : New MaxScript Editor Concept


Martin Andersen
03-15-2005, 04:46 PM
Hi.

Most of you have tryed to edit HTML code in a html editor.

So most of you also know that in html editors, you can select some text and press the BOLD
button, then the programs insert the <b> selected text </b> code snippets.

The same could be very cool with the 3dsmax maxscript editor or a new editor..

Then you just select some code and press the a tag-button or drop down, and ex. a If / else is places around the code.

Imagine a maxscript "New script" editor where you, have both a toolbar with all the basic if/else, for, case etc etc. tags on it, and a Menu bar with a lot more code, maybe arranged like the maxwrapper. Maybe with all the functions that the Current selected objects has.

Also be able to define all you own tags.

We allready have the power of VisualMaxscript editor, combined with a little Hack/changing of the "New Script" window, with the features I've mentioned, that will be very very powerfull. That will be sooo cool!

Both that everybody will have easyer learning maxscript, and you will be able to write them mutch faster.


How can this be done in 3dsmax, either edit the "new maxscript" window or create a seperate window?

Hope you like the concept

-----
Edit: ...or can it be done with a Axtive X object Text Editor based... something, how can this be created and what program is used to create this, or is there allready something out that can run inside max, that looks like this? Generally, how can we acces the selected text inside a multi-line text editor and also insert text before and after the select text.

Wahooney
03-17-2005, 09:23 AM
I'm 147% behind you that Max needs a new script editor, where instead of having lots of smaller dialogs floating around you have just the one with tabs for your different scripts. There are so many cool things that can be done with it...

So Martin, when're we starting?

Martin Andersen
03-17-2005, 11:38 AM
well... method one is ofcause hack, recompile/ rewrite the build in maxscript editor (out of my skill level.) - But it takes use of the existing features like CTRL+B, CTRL+RightClick... etc.

The Visual maxscript is not a problem, as i understand it, you can run it from inside max, triggered with a filename, and it will then open & edit your layout, just as the build in maxscript editor.

PLan B is to write one yourself, that can run inside 3dsmax as a ActiveXobject, flash or html.

There is also a sample maxscript code somewhere, that runs photshop inside a maxwindow, but I couldn't make it work. - But if it does, we can run editors inside max.

Until now I think the easy way is to have a online web editor, that runs inside 3dsmax as a activeX object > web window... that webpage does the same, as when you reply to a post on a forum, you can insert Smilies, where the cursor is [modify - we insert code instead of smilies], you can select or mark some text and you pres s the Bold button [modify and instead of setting html<b> selected text </b> around the text, we put if x > y then (selected text) etc. so its just a game of replacing code and icons that allready is there]
If colorcoding is possible inside a html textfield, then this could be an option. Then I also have a question, does html Textfields have a limit?


That is what I have looked into untill now.

But else, there is also some axctiveX object that can run inside max:
(

global GenericDialog
try(destroydialog GenericDialog) catch()
rollout GenericDialog "GenericDialog" width:388 height:159
(

activeXControl txOle "{3D6D5D2F-B9F2-101C-AED5-00608CF525A5}" height:200 width:300 align:#left


)
createdialog GenericDialog style:#(#style_resizing,#style_titlebar,#style_sysmenu,#style_minimizebox,#style_maximizebox)
)


--{8BD21D10-EC42-11CE-9E0D-00AA006002F3} Forms.TextBox.1
--{3B7C8860-D78F-101B-B9B5-04021C009402} RICHTEXT.RichtextCtrl.1
--{3D6D5D2F-B9F2-101C-AED5-00608CF525A5} TX.TextControl.110





my best ideer is to write a 3dsmax extension that can access the 3dsmax Editbox, so you can insert text and code where the Marker/Cursor is, and indsert code around the selected text. but I'm not skilled enougth to code that. Simply just expand the Editbox with functions so you can edit and call functions in it, like a notepad or word editing program.


Please join in, everything can help it. What way do you like best?

Wahooney
03-17-2005, 11:51 AM
Personally I think the hard way (writing a Utility Plugin) will be the most rewarding. You'll have the most control over whats happening and you're only limited by MFC, which isn't all that limiting :p . My knowledge of MFC is, however, limited (as is my time :eek: ), but I would like to give it a try.

Martin Andersen
03-17-2005, 12:12 PM
hehe yours is limited, but what does MFC mean?

Martin Andersen
03-17-2005, 12:56 PM
Btw. Html editors like Homesite (now called dreamweaver) etc. has great coding features, that really is a good example of how a real coding program should be. With line numbers, grouping of text, customized tags etc.

Jeff_hanna
03-17-2005, 02:47 PM
If you want a better text editor with tabs, syntax highlighting, code indentation, etc... then go get Crimson Editor (http://www.crimsoneditor.com). It's free and has included MAXScript syntax support (which I keep up to date, time permitting) for a few years now.

An editor that lets you, for instance, highlight a block and put "If Then / Else" statements around it wouldn't really be that much help. The logic of the If/Else isn't just a tag. There are test conditions that have to be met for the branching to work. There's no way an editor could magically understand what values you are testing for and what you are testing them against and then craft an If/Else clause. The logic is specific to the code and the code is specific to the logic. It's far different than the idea of "make this selection bold".

I do agree that the current state of MAXScript tools in Max is lacking. The MAXScript editor needs to graduate from a bad Notepad knockoff to a full IDE with syntax highlighting; Intellisense hints & autocomplete for both user created functions & native methods and events; and a debugger.

Cthulhu
03-17-2005, 03:05 PM
Hi, I also tried some alternatives to the MaxScriptEditor. After a little configuration, i found ultraEdit and the editor that comes with visual c++ net pretty good. the biggest problem in my opinion was that you could not compile/evaluate the script, which makes the use of external editors pretty much useless. don't know if this is possible with the CrimsonEditor, but since there are no real functions in max to evaluate a script (beside of running it), i doubt that it is working.
I fear the only way to get a new, fully working editor is hoping that discreet will develop one...

Martin Andersen
03-17-2005, 03:15 PM
hmm....
Program running inside max:

ActiveX fix for controls/objects without a default interface:

Here is an example of launching Photoshop from inside of 3ds max:

Example:

rollout rPhotoshop "Photoshop Application"

(

activeXControl ax "Photoshop.Application" height:200 width:300

)

createDialog rPhotoshop 400 400

showProperties rPhotoshop.ax

rPhotoshop.ax.open "d:\\temp\\appledis.jpg"

rPhotoshop.ax.actions[1].name

rPhotoshop.ax.playAction "My Action"



In some of the active X objects you can access properties from the active X object

Jeff_hanna
03-18-2005, 01:52 AM
...the biggest problem in my opinion was that you could not compile/evaluate the script, which makes the use of external editors pretty much useless.

There are at least two different utilities that allow you to edit scripts in a 3rd party editor and remotely execute them inside of Max. Here's a link to a discussion of one on the Discreet MAXScript forums: http://support.discreet.com/webboard/wbpx.dll/read?191193,15

xcvbnm
03-18-2005, 02:43 AM
Those are pretty good ideas.
I'm dreaming of an ms IDE, with integrated listener output window and visual ms window.
Autocomplete with parameter help (like in VC++) would be great. I need to refer manual for many max commands, which I mostly copy and paste from the manual onstead of typing. It'd speed up scripting a lot if it shows the options as you type (may be in a drop down list).

I think its possible with IE activex, if you program a page with javascript. But I'm not sure.

Cthulhu
03-18-2005, 04:04 PM
hey jeff, thanks for that link, didn't know that this was possible!
One feature i am missing in most of the editors is a way to collapse functions (or rollouts) so you get a better overview of the code, especially if you are writing a long script. The VC++ editor is the only one i know that supports that. And a autocompletion for commands would be very nice ;) oh, and commenting the selected code out is also a good thing to have..

Would it be possible that the external editor jumps to the correct line if an error occurs, like the maxscripteditor does?

Jeff_hanna
03-19-2005, 04:24 AM
The VC++ editor is the only one i know that supports that.
There's a rich edit text control called "Scintilla" that allows for code rolling. I paid attention to it a while ago. I was interested, but the editor developed with it, SCiTE only allowed for new language syntaxes to be added during compile time. That's not nearly as handy as the way Crimson Editor, UltraEdit, and others handle syntax files. I've not checked on Scintilla in a while, so I don't know if SCiTE has improved or if other editors are using the control. A Web search might reveal more information.

oh, and commenting the selected code out is also a good thing to have..
Ctrl+M / Shift+Ctrl+M in Crimson editor will comment/uncomment the selected block.

Would it be possible that the external editor jumps to the correct line if an error occurs, like the maxscripteditor does?
Not that I know of, unfortunately.

ofer_z
03-19-2005, 04:43 PM
There's a rich edit text control called "Scintilla" that allows for code rolling. I paid attention to it a while ago. I was interested, but the editor developed with it, SCiTE only allowed for new language syntaxes to be added during compile time. That's not nearly as handy as the way Crimson Editor, UltraEdit, and others handle syntax files. I've not checked on Scintilla in a while, so I don't know if SCiTE has improved or if other editors are using the control. A Web search might reveal more information.


I looked into SciTE recently. it is true that you have to compile the Lexer (the scintilla syntax parser) with it if you want a new language added, however, if there's a Lexer for a language that is similar to the one you wish to add, you can reuse that Lexer and just change the keywords (and some basic behaviour) through configuration files without the need to compile (for example they use the cpp Lexer for cpp, c, javascript, java and ActionScript)
so if one the already supported languages have a close enough structure as maxscript's, it's probably possible to create a syntax file for mxs.

another cool thing about SciTE is its Director Interface (http://www.scintilla.org/SciTEDirector.html) which allows to communicate with it from other applications.

so, if there's anyone out there with enough programming knowledge (unlike me) and some time on their hands, I'm sure the entire mxs community will be grateful... :)

cheers,
o

eek
08-28-2005, 03:45 PM
Martin thats a cool idea.. im gunna give it ago.
(might take ages though as you may need to write hundreds on functions)

eek

f97ao
09-01-2005, 02:02 PM
Ultraedit connection seems cool to maxScript. It's similar to Crimson, but more powerful.
Ultra has most advanced features that you could want, but I'm not using it much myself for maxScript yet at least.
The debugger in max8 is quite powerful what I have seen so far. With breakes, watches, better error reporting for example. The ui is ugly though and there are no line numbers, and no multiple undo... So the editor seems identical.
/Andreas

Martin Andersen
09-01-2005, 02:11 PM
I use the Ultra editor.. it is indeed powerfull... with a hit on a button all preset codes can be inserted without any problem. It does it extreme fast to code ex. dialogs etc, like non specific stuff that you use all the time. Press a button and its there :)

CGTalk Moderation
09-01-2005, 02:11 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.