Some Initial Examples

< Previous | Contents | Manuals Home | Boris FX | Next >

Some Initial Examples

Let's look at some simple examples, starting with

the number of unsolved trackers

Here Synthia isn't being told to do something, it's being given a phrase that produces a result; it's going to tell you how many. Some similar examples:

far trackers // a list of the far trackers 2+2*3 // the answer is 8

They are all outcomes (an outcome), quick and easy questions for Synthia.

Exercise: what is camera01's field of view?

To tell Synthia what to do, you use sentences ( a sentence), such as

delete the far trackers with error over 2. make the unsolved trackers purple.

remove constraints on all trackers. create teapots.

Note that colors are frequently used in SynthEyes to group related trackers together; Synthia makes it easy to work with color-based groups.

flash the purple trackers.

Synthia executes each sentence, one at a time, one after another. If you enter a sentence by itself, you don’t need the period at the end. If you enter a few sentences at once (or put several in a file), then you need the period at the end of each. If a sentence ends with a quoted phrase and period, the period should go outside the quotes, unlike typography. For example:

say "Hi, everyone ." // incorrect for Synthia say "Hi, everyone ". // correct for Synthia

Notice that everything after two forward slashes is a comment and ignored by Synthia.

You can also combine several sentences into a compound sentence ( a compoundsentence), such as

rewind, click quarter speed, then start playing.

For frequent use, you might

define "play quarter speed" means "click camera view, rewind, click quarter speed, then start playing".

You can't put an outcome into the middle of a compound sentence: rewind, the number of frames, and start playing doesn't make sense. To turn an outcome into a sentence, say it!

rewind, say the number of frames, and start playing.

Exercise: define stop loudly to stop playing and say the current (ie final)

frame number.

Synthia can talk about menu commands (a menucmd ) such as show image, which controls whether or not the background shot image is shown in the camera view. Menu commands have a default action (see rules about default action), so that when show image is entered by itself, ie as an outcome, the default action causes it to be clicked, turning the background image on or off. We could say that directly

click show image

which uses the rule to click a menucmd. Notice how show image

represents the menu command itself, not the act of clicking it. Similarly

show image is checked

will answer yes or no accordingly, depending on whether show image is checked or not. You can start to see the power of Synthia with rule for check a menucmd :

<a sentence> :: check a menucmd ($EXmeans) => if the menucmd is not checked, click the menucmd.

©2024 Boris FX, Inc. — UNOFFICIAL — Converted from original PDF.