[Closed] Autocomplete in the MaxScript Editor
Sorry Light, I don’t know what’s up with the blog if you can’t see it. I’m using Firefox too and I see it (but of course I made it so that probably doesn’t count).
For the people that don’t see the autocomplete window, have you created the maxscript.api file and tried using that? If you’re not, then press Ctrl-Enter to manually get the popup list.
The way autocomplete works is kind of squirrelly. I’ve never been able to get the settings so that it worked just the way I want it to. But if you’re not using the api file, then change the settings to include just these lines…
autocompleteword.automatic=1
autocomplete.*.ignorecase=1
autocomplete.choose.single=0
And either delete or comment out the other two. Then when you type the window will automatically pop up if there is only one word in the current file that matches what you’re typing. Otherwise, you need to press Ctrl-Enter to see the list.
No worries. The blog looks fine. It’s the link you have in your first post that’s not there on my pc. But it’s alright, your blog works fine.
I think I found the problem with the auto complete. I checked to see the maxscript.api but it was saved in:
C:\Documents and Settings\pusat\Local Settings\Application Data\Autodesk\3dsmax\2010 – 32bit\enu emp
So I saved it into:
C:\Program Files\Autodesk\3ds Max 2011\
like you said, and it worked. Awesome, this is a very neat feature. Thanks for sharing.
Light
I specifically had it create the file in the temp folder because it’s possible that the Windows’ User Account Control settings would prevent a file from being saved to the Max root folder. I actually have mine turned off completely so I didn’t test whether it would or not, I was just playing it safe. And then I mentioned in the blog post about saving the file manually, but I can see how it could be confusing. I’ll update the post to be more explicit about it.
Also posted this on James’ blog:
These settings you make in the global options file are not necessary. You should add them to the user properties as these settings override all other settings, so this keep your settings portable. I have given a talk on the EUE that included this specific topic, you can find the files on my blog: http://blog.subd.nl/2010/06/eue-sheets-and-samples/
About the api not working all the time I have found that too, and I couldn’t pinpoint exactly, but after a restart after the changes where made, it usually sticks… Now if only we could have some real intellisense
-Johan
That’s a good tip, thanks. I was actually going to point to your post about abbreviations as another way to speed up the scripting workflow, but then I couldn’t find your site.
Thanks James.
Thanks Johan, that makes sense. I just moved those settings to my user settings file.
Light
Also for people who likes to use Pascal Casing like me, you can use:
(DotNetClass “System.Globalization.CultureInfo”).CurrentCulture.TextInfo.ToTitleCase str
Light
I tried adding that to the script, but it removes the camel casing from the rest of the command text. For example, instead of “setTilingOffset”, it’s now “Settilingoffset”, which actually makes it harder to read for me. I think a better solution would be to capitalize only the first letter of each string so that you get the best of both worlds.
To do that in MaxScript, you could do this:
str = "bob"
newStr = (toUpper str[1]) + (substring str 2 str.count)
Sweet, after taking out those 2 spaces and making the API, it works
Thanks!
found the same issue, after reading your EUE post
Max tries to find it in the ‘current directory’(mxs help file)
the path needs to be absolute, ie:
#~ API
api.*.ms=C:\Users<user>\AppData\Local\Autodesk\3dsMax\maxscript.api
thanks JHaywood, I also sorted the list,just in case
[I use Ctrl+space for the .api, and autocomplete for the current script]
Can you post your settings? I’d like to see how you got it to use autocomplete for the current script and ctrl-space for the api.
ctrl+space, must be the default, but in my case without :
autocomplete.MAXScript.start.characters=$(chars.alpha)$(chars.numeric)
(scite allows to change shortcuts but max may not allow some of them)
autocompleteword.automatic=1
autocomplete.choose.single=0
autocomplete.MAXScript.ignorecase=1
autocomplete.MAXScript.start.characters=.
Interesting. It seems that Ctrl-Space populates the autocomplete window with matches from the api file(s), and Ctrl-Enter uses the current document. I’m not sure if that’s documented or not. It probably is, but I don’t remember seeing it.
And the fact that you don’t see the box right away as you start type is just because you’re using the period as the startup character. If you type “meshop.”, as soon as you hit that period key, you’ll see the popup showing all of the “meshop” commands.