Maxscript editor tip/tutorial

Become a member of the CGSociety

Connect, Share, and Learn with our Large Growing CG Art Community. It's Free!

REPLY TO THREAD
 
Thread Tools Search this Thread Display Modes
Old 01 January 2009   #1
Maxscript editor tip/tutorial

Hi everyone,

I made a small video tutorial about a thing I found very usefull in the maxscript editor, I haven't read anyone writing about it, but maybe I haven't looked enough, but here it is: http://public.subd.nl/screencasts/

Hopefully it's of any use.

-Johan
__________________
Online: LinkedIn
 
Old 01 January 2009   #2
Hey Johan,

didn't know that < : thanks for that!


J.
__________________
www.joshuanewman.net
 
Old 01 January 2009   #3
That is one awesome time-saver. Thanks for sharing.
 
Old 01 January 2009   #4
That is fantastic, thanks for putting that up there.
__________________
Paul Neale
http://paulneale.com
 
Old 01 January 2009   #5
Just as a note, it is case sensitive.
__________________
Paul Neale
http://paulneale.com
 
Old 01 January 2009   #6
That's a good way to keep scripts written in a consistent way!
Thanks!
 
Old 01 January 2009   #7
Thanks guys, it really shows how accustomed everyone was to the terrible, horrible old mxs editor, and we're probably so happy with a pretty decent editor (although I can come up with a feature or 2 one, like code completion) not a lot of people delved into the new options... at least not me.. until now that is... there are a lot more little gems hidden in the prefs file, like being able to open more then 10 files, multilinetabs etc... and I really wished the output pane could be used as a listener, so we could ditch the clumsy listener and have a streamlined window for editing and output.

-Johan
__________________
Online: LinkedIn
 
Old 01 January 2009   #8
a killer tip, man =)
 
Old 01 January 2009   #9
speaking of improvements to the mxsEditor - with the klunky old one, i did enjoy opening scripts in multiple windows to compare them side-by-side. i can't really do this easily with the tabbed interface. i'd like the option to "float" one of the tabs or open multiple editors. if anyone knows how to do this & i'm just missing it, i'd appreciate the tip!
__________________
w w w . b e a u t i f u l r o b o t . c o m
 
Old 01 January 2009   #10
A little tip to help with making it easier to format the abbreviations file.

Write the code as you normally would in a script, then using the replace tool (Ctrl+H) turn on the "Transform backslash expressions" checkbox (Alt+B) and perform find and replace on line breaks and tabs.

if EXPR then
  (
  	EXPR
  )
  else
  (
  	EXPR
  )


If you use that chunk of code and then do a search and replace searching for "\n" and replacing with "\\n" (no quotations), it will insert a "\n" at the beginning of each new line.

Then do a search and replace using "\t" and "\\t" and it will replace all of the tab characters.

All thats left to do is a few button presses using the "End" and "Delete" keys and your abbreviation file is nicely formatted.

EDIT: I just did the search and replace with "\n" and "\\n" and this time it actually replaced the line breaks. Not too sure why it is leaving them in sometimes and sometimes not.

Last edited by Mathieson : 01 January 2009 at 07:27 PM.
 
Old 01 January 2009   #11
Quote: and I really wished the output pane could be used as a listener, so we could ditch the clumsy listener and have a streamlined window for editing and output.


totally agree

Thank for the tip , very useful !!
 
Old 01 January 2009   #12
Maybe we should put up our abbreviations for other to have a look see.
Here are mine so far

 /* COMMENTS */
 menu=--@categorie:CAT;name:NAME;description:DESC
 header=\n--**************************************************  **************************************************  **\n-- Created: 		00-00-2009\n-- Last Updated:	00-00-2009\n-- Version:			0.10\n--\n-- Author :  Johan Boekhoven / johan.boekhoven@gmail.com / subd.nl\n-- Version:  3ds max 2009 (10) (should work in older versions too!)\n--\n-- Discription: DESCRIPTION\n-- Usage: RUN IT\n--\n-- Wishlist:\n--\n--**************************************************  **************************************************  **\n-- MODIFY THIS AT YOUR OWN RISK\n
 doc=/*\n<DOC> Description here.\nArguments:\n	<bool> arg_a:		A description of the argument.\nReturn:\n	<bool>		Function returns (anything?).\n*/
 
 /* CODE STRUCTURES */
 if=if ARG then\n(\n\tSTATE1\n) -- end if\nelse\n(\n\tSTATE2\n) -- end else
 fn=fn NAME arg_a arg_b =\n(\n\tdoc\n\tfnBody\n)
 str=struct NAME\n(\n\tVAR1,\n\tVAR2,\n\tfn\n)
 fora=for  in  do\n(\n\t\n)\n
 foraw=for  in  where ARG1 == ARG2 do\n(\n\t\n)\n
 fori=for i = 0 to 100 do\n(\n\t\n)\n
 foriw=for i = 0 to 100 where ARG1 == ARG2 do\n(\n\t\n)\n
 foribw=for i = 0 to 100 by  where ARG1 == ARG2 do\n(\n\t\n)\n
 rol=rollout ""\n(\n\tbtn\n\tspn\n)\n

/* GENERIC */
 start=menu header\n(\n\t\n)
 
 /*CONTROLS*/
 btn=button btn_ "" width: height: offset:[0,0] across:
 pbn=pickButton pbn_ "" width: height: offset:[0,0] across:
 spn=spinner spn_ "" width: range:[,,] type: offset:[0,0] across:
 chb=checkButton chb_ "" width: height: offset:[0,0] across:
 grp=group ""\n(\n\tbtn\n\tspn\n\tchb\n\tpbn\n)
 


Some are obviously specific for my needs, but maybe somebody can use it.
I think especially in the commenting and UI building and CA building department lot of speed can be gained by some well balanced abbreviations.

Has any also checked out the great work Rob is doing over at TAO and I try to follow the http://tech-artists.org/wiki/TAO:Code_Conventions, I think some public accepted abbreviations could help on good coding practice, but that's me.

@Mathieson, that's a really good tip!!

Cheers,
-Johan
__________________
Online: LinkedIn
 
Old 01 January 2009   #13
do you know if it's possible to remap the shortcut , I don't find it very straight forward ??
 
Old 01 January 2009   #14
you must edit the MXS_Editor.properties file.
To do this choose the option 'open global option file' from the tool menu.
Search the line '# User defined key commands'
and then add a line with your shortcut and the command you need.

you can find the explanation in the 'MAXScript Editor - Defining Custom Keyboard Shortcuts' tread, from the maxscript help

sorry for my english

cheers
 
Old 01 January 2009   #15
Thank ! this work very well
the line to add is : Ctrl+?|IDM_ABBREV|
 
reply share thread



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
CGSociety
Society of Digital Artists
www.cgsociety.org

Powered by vBulletin
Copyright 2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump
Miscellaneous

All times are GMT. The time now is 09:57 PM.


Powered by vBulletin
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.