<<Contents

FX Model Editor Advanced

Adding input/output modules

Model Editor handles load and save operations via a customizable and extensible method of plug-in modules. These modules are stored in the "Translators" directory underneath the root Model Editor directory.

All modules are XSLT translation files (that must end in ".xslt"). In all cases, the translation file is expected to either begin with Model Editor's raw XML format (output) or to produce that format (input). A good way of determining how to write a translator is to examine a test model saved in the "Raw XML" format, which is the same internal format that Model Editor expects a translation module to deliver.

Although modules are encouraged to be as error-resistant as possible, if an input filter detects that it has been asked to open a file of entirely the wrong type, it may elect to return an empty string (that is, no nodes in the result tree). If Model Editor is returned an empty model, it will not detect this as an error. On the other hand, if the tree that is returned to it has no root element (no output), it will display an error to the user which may help the user to understand the problem.

An XSLT file must have a processing instruction to be recognized by Model Editor. This instruction contains the following information, as shown in this example:

<?ModelEditor Version="1.0" Name="MORPH-DSL" Type="Input" Filter="MORPH-DSL (*.xsd)|*.xsd" RootElements="xs:schema"?>

Because XSLT files operate only on XML data, it is currently not possible to input files which are not some form of XML. (Outputting such files is, however, possible.)

It is possible to have an input- or output-only module, in which Model Editor can read a particular file format but cannot write it, or vice versa.

Altering the model tree

Model Editor's tree is completely customizable through the use of the following configuration files:

All of the above files must exist within the same directory as the executable file itself.

Although customizing Model Editor is very powerful, beware that the save and load modules might expect the data to be in a specific format. Changes to the model tree may cause previously-saved files to be inaccessible, and may cause load and save to fail, until the translators are also updated.

Languages

Model Editor supports displaying all aspects of its user interface in any language that can be represented in the XML files. The translation strings are found in the ModelEditor.xml file, under the <ResourceStrings> branch.



Copyright © 2003 Magnetar Games Corporation