MAXScript Editor - MAXScript-Specific Language Settings

 

   

MAXScript Editor

   

MAXScript Editor Property File Settings

The MAXScript-specific language settings of the Tabbed MAXScript Editor introduced in 3ds Max 2008 can be customized by editing the file MAXScript.properties located in the 3ds Max root folder.

NOTE:

On modern Windows OS like Vista and Windows 7 with User Account Control (UAC) enabled, modifying the factory defaults stored in files located in the 3ds Max root folder will not be allowed.In this case, you can provide your custom overrides by copying the relevant settings into the User Options file also available through the Tools menu of the Editor.

Lexer Settings

lexer.<filepattern> (MAXScript default: see below)

A lexer splits a file up into syntactic pieces. The Editor can then display these pieces in different visual styles.

Several lexers are available.

Often several file extensions (.ms, .mcr) can map to one language (MAXScript) and can use one lexer.

These settings associate a file name with a lexer.

The MAXScript shipping default setting in the fileMAXScript.propertiesfile is:

lexer.$(file.patterns.MAXScript)=MAXScript
lexerpath.<filepattern> (MAXScript default: not set)

This property specifies the path to an external lexer module that will be loaded into the Editor.

Keyword Settings

keywords.<filepattern> (MAXScript default: set internally)

keywords is for keywords,

FOR EXAMPLE:

and animate attributes by collect else exit for from function rollout struct set then

keywords2.<filepattern> (MAXScript default: set internally)

keywords2is for rollout controls,

FOR EXAMPLE:

label button edittext combobox

keywords3.<filepattern> (MAXScript default: set internally)

FOR EXAMPLE:

displaycontroldialog skipspace readfloat

keywords4.<filepattern> (MAXScript default: set internally)

keywords4is for MAXScript Classes,

FOR EXAMPLE:

maxtvutility moflow trackviewpick array matrix3 integer

keywords5.<filepattern> (MAXScript default: set internally)

keywords5is for MAX Classes,

FOR EXAMPLE:

box ffd_2x2x2 cameramapspacewarp

keywords6.<filepattern> (MAXScript default: set internally)

keywords6is for MAX Super Classes,

keywords10.<filepattern> (MAXScript default: set internally)

FOR EXAMPLE:

camera shape colorpicker soundclass texturemap

keywords7.<filepattern> (MAXScript default: set internally)

keywords7is for Core Interfaces,

FOR EXAMPLE:

assemblymgr channelinfo iparserloader trackselectionsets pluginmanager

keywords8.<filepattern> (MAXScript default: set internally)

keywords8is for Object Sets,

FOR EXAMPLE:

objects geometry lights cameras helpers shapes systems spacewarps selection

keywords9.<filepattern> (MAXScript default: set internally)

keywords9is for Struct Defs,

FOR EXAMPLE:

meshops mouse dof cui camerafov xrefs

keywords10.<filepattern> (MAXScript default: set internally)

keywords10is for const reserved globals,

FOR EXAMPLE:

red pi true undefine dmeditmaterials x_axis

keywords11.<filepattern> (MAXScript default: set internally)

keywords11is for reserved globals,

FOR EXAMPLE:

animationrange slidertimeb ackgroundcolor rootnode

keywords12.<filepattern> (MAXScript default: empty)

keywords12 is for user defined words to be colorized. Keywords are checked for in this list first.

See the topic MAXScript Editor - Defining Custom Keywords for an example of generating user-defined keywords and styles.

keywordclass.<lexer> (MAXScript default: not set)

Most of the lexers differentiate between names and keywords and use the keywords variables to do so.

To avoid repeating the keyword list for each file extension, where several file extensions are used for one language, a keyword class variable is defined in the distributed properties file although this is just a convention.

Some lexers define a second set of keywords which will be displayed in a different style to the first set of keywords. This is used in the HTML lexer to display JavaScript keywords in a different style to HTML tags and attributes.

Keywords can be prefix based so ^GTK_ will treat all words that start with GTK_ as keywords.

File Extension Settings

default.file.ext (MAXScript default: .ms)

Defines the language mode used before the file has a name. For example, if default.file.ext=.ms, then when the New command is used to create a new file then MAXScript syntax styling is used.

Characters Settings

word.characters.<filepattern> (MAXScript default: see below)

Defines which characters can be parts of words.

The default value here is all the alphabetic and numeric characters and the underscore which is a reasonable value for most languages.

The shipping default definition in the fileMAXScript.propertiesis:

word.characters.$(file.patterns.text)=$(chars.alpha)$(chars.numeric)$(chars.accented)-'
whitespace.characters.<filepattern> (MAXScript default: not set)

Defines which characters are considered whitespace.

The default value is space and all chars less than 0x20.

Setting this property allows you to force the Editor to consider other characters as whitespace (e.g. punctuation) during such activities as cursor navigation (ctrl+left/right).

Style Settings

style.*.<stylenumber> (MAXScript default: not set)
style.<lexer>.<stylenumber> (MAXScript default: see below)

The lexers determine a style number for each lexical type, such as keyword, comment or number. These settings determine the visual style to be used for each style number of each lexer.

The value of each setting is a set of ',' separated fields, some of which have a sub-value after a ':'.

The fields are font, size, fore, back, italics, notitalics, bold, notbold, eolfilled, noteolfilled, underlined, notunderlined, and case.

The font field has a sub-value which is the name of the font, the fore and back have color sub-values, the size field has a numeric size sub-value, the case field has a sub-value of 'm', 'u', or 'l' for mixed, upper or lower case, and the bold, italics and eolfilled fields have no sub-value.

The value "fore:#FF0000,font:Courier,size:14" represents 14 point, red Courier text.

A global style can be set up using style.*. stylenumber .

Any style options set in the global style will be inherited by each lexer style unless overridden.

The shipping properties and values set in the fileMAXScript.propertiesare:

# Default
style.MAXScript.32=$(font.base)
# White space
style.MAXScript.0=fore:#808080
# Comment: /* */.
style.MAXScript.1=$(colour.code.comment.box),$(font.code.comment.box)
# Line Comment: --.
style.MAXScript.2=$(colour.code.comment.line),$(font.code.comment.line),eolfilled
# Number
style.MAXScript.3=$(colour.number)
# String
style.MAXScript.4=$(colour.string)
# Verbatim strings
style.MAXScript.5=fore:#007F00,$(font.monospace),back:#E0FFE0,eolfilled
# End of line where string is not closed
style.MAXScript.6=fore:#000000,$(font.monospace),back:#E0C0E0,eolfilled
# Identifiers
style.MAXScript.7=
# Operators
style.MAXScript.8=$(colour.operator),bold
# Keyword arg name
style.MAXScript.9=fore:#804080
# Name value
style.MAXScript.10=$(colour.char)
# Pathname
style.MAXScript.11=fore:#3F7F3F,$(font.monospace),back:#E0F0FF
# Keywords1 - Keywords
style.MAXScript.12=$(colour.keyword),bold
# Keywords2 - Rollout controls
style.MAXScript.13=$(colour.preproc),bold
# Keywords3 - Functions
style.MAXScript.14=fore:#3060A0
# Keywords4 - MXS Classes
style.MAXScript.15=fore:#6030A0
# Keywords5 - MAXClasses
style.MAXScript.16=fore:#60A030
# Keywords6 - MAXSuperClasses
style.MAXScript.17=fore:#0040B0
# Keywords7 - Core interfaces
style.MAXScript.18=fore:#00B040,italics
# Keywords8 - Object sets
style.MAXScript.19=fore:#D0B080,italics
# Keywords9 - StructDefs
style.MAXScript.20=fore:#804020,italics
# Keywords10 - Const reserved globals
style.MAXScript.21=fore:#3060A0,italics
# Keywords11 - Reserved globals
style.MAXScript.22=fore:#B00040
# Keywords12 - User defined
style.MAXScript.23=fore:#FF0000,bold,italics
style.<lexer>.32 (MAXScript default:see below)
style.<lexer>.33 (MAXScript default:see below)
style.<lexer>.34 (MAXScript default:see below)
style.<lexer>.35 (MAXScript default:see below)
style.<lexer>.36 (MAXScript default:see below)
style.<lexer>.37 (MAXScript default:see below)

In addition to the styles generated by the lexer, these numbered styles are being used:

32- default style and its features will be inherited by all other styles unless overridden.

33-- display line numbers in the margin.

34 and 35- used to display matching and non-matching braces respectively.

36- used for displaying control characters. This is not a full style as the foreground and background colors for control characters are determined by their lexical state rather than this style.

37- used for displaying indentation guides. Only the fore and back fields are used.

A * can be used instead of a lexer to indicate a global style setting.

The shipping properties and values set in the fileMXS_Editor.propertiesare:

# Global default styles for all languages
# Default
style.*.32=$(font.base)
# Line number
style.*.33=back:#C0C0C0,$(font.small)
# Brace highlight
style.*.34=fore:#0000FF,bold
# Brace incomplete highlight
style.*.35=fore:#FF0000,bold
# Control characters
style.*.36=
# Indentation guides
style.*.37=fore:#C0C0C0,back:#FFFFFF

See the topic MAXScript Editor - Customizing Syntax Color Schemes for an example of a custom color scheme.

See the topic MAXScript Editor - Defining Custom Keywords for an example of generating user-defined keywords and styles via Keywords12 / style.MAXScript.23.

 

   

Back To Topic Navigation