4.14 General syntax rules

Here is a list of general syntax rules that have to be followed to avoid errors in your expression script.

Naming and Renaming

Naming is crucial for Xpressionist to work as expected. Objects in the project window are identified by their name. There are certain letters that are not allowed in object names. If you use any of them, Xpressionist will substitute them with an underscore. So if you have an object which is called Object 1+ it will come into Xpressionist as Object_1_ since the space and the + will be substituted with an underscore. If you have another object in the scene which is called Object 1* it will be named the same as the first object: Object_1_ since Xpressionist substitutes the forbidden letters resulting in equal naming within Xpressionist.

When you rename an object in the project window whose channels are used in an expression, Xpressionist will not find them anymore and give an error. You have either to rename the object to its previous name, or exchange all related channels within Xpressionist with the channels of the renamed objects.

Suffixes

Suffixes of images and plugins will be erased from the filename within Xpressionist. So if you have textures that end with ".img" the ".img" will be removed from the texture name to improve readability and to avoid the dots in ".img". When you add an Xpressionist group in EIU it comes in as "Xpressionist.plm group". However if you add a channel of this Xpressionist instance to the Active Channel list it will come in as "Xpressionist.attribute" - the ."plm group" will be erased from the name.

Suffixes that will be erased are:

.plm group
.plm
.shd
.img
.image
.tif
.jpg
.bmp

Brackets

Always close an open bracket! This may sound simple but this is often the reason why the script gives you an error.

Always put conditional statements like ( x > y ) into brackets.

Assignment Operator "="

A frequent mistake is to use the assignment operator in conditional statements. The assignment operator "=" does not mean "is equal to" but "has the value of". It assigns a value to a property. The correct operator to compare two values is "==" like in if ( a == b ).

Terminate your expression

Always add a ";" (semicolon) to the end of a statement. If this is missing you will often get an error since Xpressionist assumes the statement to be continued in the next line.

Xpressionist 3.5