Difference between revisions of "Tile Model Integrator Tool"
Shawn Allen (Talk | contribs) (→Tile Mosaic Tool (TMT)) |
Shawn Allen (Talk | contribs) (→TMIT dependencies) |
||
Line 102: | Line 102: | ||
Currently supported file formats are shown in Table 2.1 | Currently supported file formats are shown in Table 2.1 | ||
− | insert table here | + | =<span style="color:red">insert file format table here<span style="color:red">= |
Python 2.7.8 is the programming language used for the Tile Model Integrator Tool, and it relies on the tkinter library as well as other modules which are included in a standard Python install. | Python 2.7.8 is the programming language used for the Tile Model Integrator Tool, and it relies on the tkinter library as well as other modules which are included in a standard Python install. | ||
Tkinter is the standard python interface to the Tk GUI toolkit and is included with the standard Windows and Mac OS python installations. | Tkinter is the standard python interface to the Tk GUI toolkit and is included with the standard Windows and Mac OS python installations. | ||
− | |||
==Integrator tool user interface== | ==Integrator tool user interface== |
Latest revision as of 12:20, 19 August 2016
Contents
- 1 Tile Model Integrator Tool
- 2 This page is under construction.
- 3 Overview
- 4 Tile Model Library
- 5 Tile model library: Overview
- 6 Tile models are composite objects
- 7 Global model elements
- 8 Content to simulator: Overview
- 9 Tile Mosaic Tool (TMT)
- 10 insert file format table here
- 11 Python Modules
- 12 OpenFlightTM API Requirements
- 13 Integrator tool user interface
Tile Model Integrator Tool
This page is under construction.
Overview
The Tile Model Integrator Tool (TMIT) was created to manage integrating tile models into the NADS Tile Mosaic Tool (TMT) tile library.
Previously, all library integration tasks were manual and required specialized knowledge of the 3D model and NADS virtual asset library and pipeline.
TMIT does not completely eliminate these requirements, but it does facilitate model integration into the tile library through a graphical user interface and guided data entry steps.
This allows non-experts to successfully import new tile models. Once the imported file has been successfully integrated it becomes part of the standard library and may be used the same as any native tile model.
Because library models must be unique, only unique models will import. It is not currently possible to have two different models in the library with the same name.
TMIT is is a simple GUI application written in Python 2.7.8 that processes Wavefront OBJ and OpenFlightTM files and guides the user during data entry for importing new models into the Tile Model Library.
TMIT imports OBJ format model files. However, file format is a function of the OSGConv converter engine, which supports a variety of file formats.
Subsequent changes to the tool for expanding supported file formats are therefore possible by extending OSGConv.
Tile Model Library
The NADS MiniSim relies on a collection of 3D models known as ‘tile models’ that represent environments and environment components within the simulation scene environment. This scene environment can be thought of as the simulation world.
A simulation scene environment is created by assembling tiles using the TMT. The environment is typically designed to accommodate specific research requirements such as simulation drive time (duration) or locale (place).
These configurations may be altered to create additional configurations. When a final design has been reached, the configuration is published using a build process to generate files necessary for scenario authoring and simulation.
Roundabout tile model and TMT world configuration/layout
Tile model library: Overview
The idea of re-use is central to the tile model library. Just as in a real library, models can be checked out for use. The TMT provides a convenient interface to the models available for use within the library.
There is no real limit to the number and type of models that may be imported into the library. As project requirements grow, models are revised or constructed using modelling standards and conventions for tile models and imported into the library.
Once a model has been integrated into the library, it can be re-used as needed.
Tile models are composite objects
Tile models are not just 3D model geometry and textures – they are composite objects which include various meta-data (objects and attributes).
All model-specific and library configuration files must be managed when importing new models into the library. Currently importing new models requires making edits to library configuration files, adding the tile model and associated data files into the library file system and ensuring all required files are present. There is a library constraint that all models must be unique. In a manual process, this constraint is highly dependent on the diligence of the person integrating new models into the library.
The process of integrating new models is second nature for persons having daily contact with the system; however, ensuring that novice simulator users are able to integrate new models requires some automation and error-checking in the workflow. This functionality has been built into the tile model integrator tool.
Global model elements
In addition to model-specific meta-data, there are also attribute and configuration files which are global in scope and apply to the entire library of models.
Content to simulator: Overview
This section describes the process for getting source data and models into a simulation world. Not shown in this schematic are various modelling conventions which apply to the Tile Model Library.
NADS content pipeline: source to simulator
In the process schematic, data resources on the left side are processed, imported or created by 3D modelling tools and staff.
Additional data files are also generated or created and then imported into the Tile Library, including placement of files within the library on-disk file hierarchy.
Tile Mosaic Tool configuration files must be updated to include new model resources, and at this point the newly imported model may be used by the TMT.
Tile Mosaic Tool (TMT)
The TMT is a graphical user interface to the tile model library for creating simulation worlds.
The TMT is a simple 2-dimensional top down map editor that contains an inventory of tile models grouped by association or function.
Within the TMT, tile models are grouped into categories which include a color specification for the category.
When the TMT first encounters a new tile model, it processes that model by opening the model.flt file to process attributes located in the model header. The results of this step are stored in the tile model folder as <model.txt>, where model is the same base file name as the actual model.
This processing happens when the model is new to the library, and any time in the future when the time stamp differs between model.flt and model.txt files.
If there is no header data present in the model.flt and no model.txt file present, the TMT does not recognize the model and it will not be present in the tile library.
In order to implement these model header attributes, it is necessary to edit the model.flt file using a 3D modelling application capable of modifying specific OpenFlightTM hierarchy nodes or some other tool capable of injecting the required attributes into the model file header.
Alternatively it is possible to generate these model attributes manually by creating a model.txt file using a text editor. Existing tile models can be used as a template to ensure all required fields are present, but this method does not guarantee that correct data is entered; for example, duplicating a similar model and failing to update the record fields for the new model will result in a mismatch between the model attributes and the model.
Model size is a required attribute and is specified in terms of tile model units. A tile unit is 660 feet. Models must be at least 1 unit in width and length (X and Y coordinate planes) and rectilinear. In general model size accurately reflects the dimension of the model, but in special cases it is desirable to implement non-standard dimensions instead. Model dimensions are also stored in a library configuration file that is used during the environment publication process. Failure to include correct model data results in invalid builds which affect scenario authoring – although the environment generates files for simulation, some objects in the build will not respond to authored commands.
Currently, importing a new model into the library requires manually: a) creating the tile model geometry, textures, object definitions and attributes, b) editing the Tile Library configuration file to include the new model, c) editing the Tile Dimension configuration file to include the new model, d) editing additional Tile Library configuration files as needed – for example, if new road profiles or intersection elevation maps are defined in the new model.
TMIT dependencies
TMIT has several important dependencies: because the current content to simulator workflow requires OpenFlightTM format files for tile model source files, the Presagis OpenFlightTM API is necessary to automatically modify converted files.
OSGConv.exe is used as a converter engine, which makes available all 3D file formats currently supported by OSGConv as possible simulator models.
Currently supported file formats are shown in Table 2.1
insert file format table here
Python 2.7.8 is the programming language used for the Tile Model Integrator Tool, and it relies on the tkinter library as well as other modules which are included in a standard Python install.
Tkinter is the standard python interface to the Tk GUI toolkit and is included with the standard Windows and Mac OS python installations.
Integrator tool user interface
The integrator tool is organized by panels in 3 areas of functionality:
a) Tile category operations – add new categories, change color records b) Import model panel – specify model to import into library c) Model attribute data entry panel – data entry for header attributes
Each panel is available only when the user satisfies conditions necessary for operation. For example, there is no way to import a model without previously selecting a tile category. Importing a model and then cancelling any required operation prevents access to the model attribute data entry panel.
The integrator tool reads the tile library configuration file, alltiles.txt. This is a file which defines the organization of models into categories and contains a color value for each category expressed as an R, G, B triplet of integer numbers.
TMIT can add new tile categories; modify existing category color parameters using a graphical color chooser, and import new OBJ models into selected tile categories.
Upon choosing a category, the user interface updates to reflect the current selection. Choosing import initiates a series of workflow steps, all of which may be cancelled at any time. When the user satisfies model import requirements, the process of model importing begins. The user must choose a file to import – file choice is filtered by file location, number of associated files, and file type. The next step is defining model header attributes using a graphical user interface. This step is managed through the use of color coded feedback and reinforced by status messages informing the user about the state of their work. Upon successful data entry, the user can then choose to save their work, which triggers all associated file management activities: first the selected model is copied from the source model location into the model library into the proper model folder location, based on model category selection. Then this copy is converted to OpenFlightTM, which is the TMT model source file format. The model data entered by the user (and validated by the tool) is then injected into the converted flight model header. The library configuration file alltiles.txt is updated with the imported model data, and the model is integrated into the model dimension configuration file.
At this point the user can exit the integrator tool and open the TMT, which now contains the imported model. A brief processing step is performed on the imported model when it is first used in the TMT, and then the user may begin to create a simulation environment using the tile library, which includes the imported model.
At this stage the imported model has been fully integrated into the tile library and may be used the same as any pre-installed tile model.
Currently the tool does not support removal of models or tile categories.
This is due to historic use and re-use of model resources – allowing removal of a file can cause projects to fail catastrophically due to missing files when they are regenerated.
The TMT is able to open configurations which contain missing model references. However, saving the configuration with missing models creates an invalid layout, which will then always fail to open.
There is no way to recover the layout file once this situation occurs.
NADS has seen the original library grow to several hundred models over the course of 16 years; it is unlikely that a simulation laboratory would outgrow hard drive storage requirements given low storage costs. Therefore there is no need to manage numbers of library models by removing models or tile categories.
While the tool does also not support renaming tile model categories, there are no requirements for the specific categories to be present. Thus, a category can be renamed without incurring any penalties.
Because the alltiles.txt file is a text file, it is possible to change category names by editing the file.
The integrator tool does not permit duplicate file names in either the tile library configuration file alltiles.txt or in the tile size list file tilesizes.txt. Encountering a duplicate tile model name will terminate the current process and return the user to Panel 1 of the tool.
System Configuration Requirements
The Integrator tool requires a standard MiniSimTM installation. This typically includes a MiniSim installed root folder, OSG folder, TMT installation folder, including a TMT utils folder. Additional requirements include Python 2.7.8 and OpenFlightTM API python bindings.
On startup the integrator tool performs system level configuration diagnostics. If the system is incorrectly configured, the tool will present an error message to the user and exit. If any of the required system components are not detected during the initialization phase, the tool will notify the user and exit.
The tool queries system environment variables and the nadsconfig_system.bat script file to identify TMT, miniSim and OSG filesystem locations.
Python Requirements
The tile model integrator tool is written in Python 2.7.8, which is not compatible with Python 3.0 or above. There are no external downloads required for the tool, as all modules used are included as part of the standard Python 2.7.8 installation except the OpenFlightTM API files.
Python Modules
TMIT requires the following modules: os, system, stat, re, shutil, subprocess, Tkinter, tkFileDialog, tkMessageBox, tkCommonDialog, tkSimpleDialog, tkColorChooser and the external Presagis module mgapi.
OpenFlightTM API Requirements
The API files required are bundled as library files which are the intellectual property and copyright of Presagis:
a. fltdata.dll b. mgapilib.py c. mgapilib.pyc d. mgapilib.pyd
These files are included with TMIT courtesy of a licensing agreement with Presagis and may not be re-distributed without permission.
Integrator tool user interface
This section includes screen shots of the tool and describes various user interface features and operation. Figure 2.3 shows the default configuration following successful initialization, and after selecting one of the tile model categories. The status area prompts the user to select a category.