Friday, April 22, 2011

MaxScript AutoComplete


Dalam pemrograman kita sangat membutuhkan auto complete, terutama pemrograman max script, yang secara default oleh autodesk di off-kan. So berikut trik untuk menghidupkan Auto Complete Max script.

1. buka maxscipt editor (sortcut Alt+m+e ).
2. Setelah maxscript editor kebuka ,buka global setting maxscript ( Alt+t+g)
3. cari file berikut, 




autocompleteword.automatic=1
autocomplete.*.ignorecase=1
autocomplete.choose.single=0

autocomplete.*.start.characters=$(chars.alpha)$(chars.numeric)$_@#.
api.*.ms=maxscript.api



bila anda menemukan tanda # didepanya hilangkan. 



4. simpan file yang anda edit tersebut (ctrl+ s), bila anda bermasalah dengan security windows untuk menyimpan file tersebut, jalankan 3dsmax dalam mode administrator atau file MXS_Editor.properties pada bagian security user windows harus dijadikan bisa diakses oleh everyone.


5. create new script, dan paste script berikut. Script ini berguna untuk membuat daftar API yang dimiliki oleh 3dsmax, pastikan anda bisa mengakses root 3dsmax atau anda bisa mengubah path penulisan file API--> filePath = getDir #maxRoot + @"\maxscript.api", kemudian hasil filenya anda copy ke root 3dsmax.




(
filteredSS = stringstream ""
ss = stringstream ""

apropos "" to:ss
seek ss 0
while not eof ss do
(
l = readLine ss

if matchPattern l pattern:"*#struct:*" then
(
n = (filterString l " ")[1]
l = readLine ss
while matchPattern l pattern:"*public,*" do
(
format "%.%\n" n (trimLeft (filterString l ":")[1] " ") to:filteredSS
l = readLine ss
)
)
else if matchPattern l pattern:"*(const *" then
(
format "%\n" (filterString l " ")[1] to:filteredSS
)
)

filePath = getDir #maxRoot + @"\maxscript.api"
if not doesFileExist filePath then
(
createFile filePath
)
if getFileAttribute filePath #readOnly then
(
setFileAttribute filePath #readOnly false
)
fStream = openFile filePath mode:"w+"
format "%" (filteredSS as string) to:fStream
close fStream
edit filePath
)






6. restart 3dsmax, bila langkah benar maka anda sudah mendapatkan autocomplete.

No comments:

Post a Comment