ScriptSpot

Forum topic · General Scripting

Sublime Text Editor - MXS support

By tassel · 2011-05-28

Description

Hi,

Is there anyone who has looked at opportunities to get support for the MXS to the Sublime Text Editor? (http://www.sublimetext.com/)

I have not investigated this much, but this should probably be able to do?

I see it already is language defenition files to notepad++ here(Notepad++ MXS Language Definition)

Have any of you tips, tricks and suggestions around this they would have been received with great thanks.

Comments (21)

Fantastic!

crimsondesigns · 2013-08-26

This is awesome.
Thanks for the great work!

I just created a MaxScript language definition for SublimeText

captainkeytar · 2013-01-10

Haven't had a chance yet to properly host on GitHub/Package Control, but here's v0.1. It's a first pass and there's still numerous things I'd like to add, but I'm new to language definitions so some of that will take some more figuring out on my part.

Please let me know if this works for you, or not :)

https://www.dropbox.com/s/qv1v0weaq45ffqz/MaxScript.zip

Just unzip that to your Package dir in a directory called /MaxScript/

Enjoy!

tassel · 2013-01-10

Many many thanks, appreciate you sharing it. Will try it out when I get time :)

great work!

Mambo4 · 2013-01-11

thanks for this!

I found Sublime Text last year and dropped notepad++ in favor of it for all my python work. I Just started using Max script, so this will be welcome.

Works fine for me. Nice work!

Running scripts from Sublime Text

haavards · 2013-01-14

I took the liberty of adding some files to your Maxscript package to Sublime Text so you can run maxscripts from Sublime. To make it work you have to copy "Autodesk.Max.dll" and "Autodesk.Max.Remoting.dll" from your max root folder to the Maxscript folder. Note, for this to work in versions previous to Max2013 you need to download the .Net wrappers from http://ephere.com/autodesk/max/downloads.html. If you got Max2013 you already got this installed. The last thing is to edit the \Users\username\AppData\Local\Autodesk\3dsMax\2013 - 64bit\ENU\en-US\plugcfg\MaxDotNet.config file and set AllowRemoting to true.

To assign a hotkey for running scripts, edit the "Default (Windows).sublime-keymap.json" file. You can also run it using Tools\Maxscript from the menu.

The files:
http://folk.ntnu.no/havardsc/scripts/SublimeMaxScript.rar

l0op1ng · 2013-01-25

Hi,

And first thanks Haavards for the maxscript support in sublime.
I create a package with everything you said and install it in sublime.

Syntax color works very well.
I have the tool \ max script command but when i click on it nothing happens (after a short wait)

Could you describe a little more how to be able to execute maxscript for sublime please ?

PS : I am using 3ds max 2013 64 bits.

Best,
Rob

haavards · 2013-01-25

Not sure what could be wrong if there are no error messages popping up.

Here is a procedure to check if the remoting is properly set up:

First, be sure to copy the two .dll-files from your max root directory to the maxscript package folder.

Secondly, be sure to have enabled remoting as described in my first post, the two fields to check in the MaxDotNet.config file should look like this:

<RemotingPort>9998</RemotingPort>

 <AllowRemoting>true</AllowRemoting>

Then with Max open, go to the package folder and open up a cmd window at that location. A quick way to do that is to go to the parent folder and shift+right click on the folder and choose "Open command window here". Then enter

MXSSublime "teapot()" 

This calls the .exe file with a simple script. If it's set up correctly you should have a teapot in your scene.

This is basically what the python script does when calling it from the sublime editor. If the remoting works and the script fails it should display an error message in Max's listener as usual.

Try running sublime text as an administrator if it still does not work.

l0op1ng · 2013-01-26

HI,

Thanks !
It works.

But I found that each time I launch max it reset the MaxDotNet.config in my localApps.
In order to avoid the pb I have to modify the file in read only "
Now the system is working fine.

Best,
Rob

borent · 2013-03-12

Thanks for maxscript highlight! This really is not enough! Publish it on the Package Control think many useful =)

But unfortunately I have following problem with Building file. All set up as it was written. Creates a teapot. However, under my code pops up the following error:

Error trying to parse build system: Invalid escape in C:\Users\render\AppData\Roaming\Sublime Text 2\Packages\MaxScript\MaxScript.sublime-build:2:20

In this file, I have not changed anything:
{
"cmd": ["python", "$packages\MaxScript\Executer.py", "$packages\MaxScript", "$file"]
}

I try to send a file for execution "test.ms". Maybe you know what could be the problem?

I resolve my problem

borent · 2013-03-12

In the file: "MaxScript.sublime-build" change to the \ to / and I did not have the environment variable so I pointed the way to a python:

Before:
{
"cmd": ["python", "$packages\MaxScript\Executer.py", "$packages\MaxScript", "$file"]
}

After:
{
"cmd": ["C:\\Python26\\python.exe", "$packages/MaxScript/Executer.py", "$packages/MaxScript", "$file"]
}

pepetd · 2013-12-03

I am having a hard time getting it to work with sublime 2, I place the maxscript folder inside the pristine packages folder and it doesn't work.

I also tried making a packages folder at the sublime root directory and it doesn't work.

Any ideas?

Running scripts from Sublime

Kif · 2013-08-23

Thank you!

Works well

TracyMa · 2013-01-20

you save my time! It will be Better if in package controll system.

tassel · 2011-05-28

Thank you Anubis, I'll take a look at the ConText :)

about ConText

barigazy · 2013-01-12

>>>to Anubis
thanks for txt editor suggestion. I agree that Sublime Editor is a good choise for web and other languages programing, but ConText is free and very easy to adjust basic mxs higlighters.
I don't like limitation to 5 keywords but anyway...
I share my *.chl. See attachment
Cheers!

Attachments

Thanks for the higlighter!

Anubis · 2013-01-12

I'm too made my own simple higlighter but I see that you put a lot more keywords in your CHL-file. The limitation to 5 keywords is quite enough for some languages, and of course w'd be good to have more for Mxs... ConText is a good choice for me anyway :)

barigazy · 2013-01-12

For me is the best choice these adjusments of MXS_Editor. Maybe you already try this but for those who are not let them try.
It is good way to increase functionality of MXS_Editor and also you can easily customize it.
Big Thanks to Josef Wienerroither (spacefrog) and James Haywood.

Attachments

Saij · 2013-01-13

how does this work?
i installed it but it doesn't seems to to anything out of the ordinary

cheers