Converting Models to glTF for STK 11.5

Information

 
QuestionWhat Software Setup is Required to Convert Models to glTF?
Answer
One of the great new features of STK 11.5 is the ability to enhance models with glTF textures that provide higher resolution graphics and reflective surface mapping. With this cool new capability now available, it begs the question of how to create and update models to this new standard? This article is meant to provide all of the necessary materials required to get started in this process; however, this is not meant to be a full-fledged tutorial on the subject. If you follow the steps below, you will be on your way to creating your own custom models with astounding graphics.
  1. Download Blender 2.79b and Visual Studio Code (Not Visual Studio). Blender can be downloaded here and VS Code can be downloaded here. Install both applications on your machine and make sure they are working properly. If a newer version of Blender is available it is still recommended to use version 2.79b, as the interface is expected to completely change for version 2.80 and the required plugins have not been tested with the new version.
  2. Open Blender and install the Blender glTF Exporter. To do this you will need to go to File -> User Preferences and then go to the Add-ons tab. There is an “Install Add-on from File” options at the bottom. These steps are also shown in the images below.
User-added image
User-added image

When you choose the install from file option it will ask you to choose a file. You want to navigate to the glTF Exporter folder (that you already downloaded) and load the file from the following path: glTF-Blender-IO-master\glTF-Blender-IO-master\addons\io_scene_gltf2/_init_.py

Once installed, you will see new exporting options for .glb and .glTF formats, which can found from the File- > Export menu as shown below.
User-added image

  1. To get started in Blender it is recommended to load in the default model, Default_GLTF_2.0_for_STK-11.5.blend, which came with the glTF Exporter download. When you open the file, you will notice shading controls located in the bottom middle of the screen, as shown below. These are the controls required to make very basic textures that reflect light.
User-added image
When you have the default model loaded, you can load your models into the scene and you can delete the default cube at any time. You will need to create a new material on each of your objects and assign the correct shader. This can be done by assigning the surface type, as shown below.
User-added image
  1. Once your model is completed you want to export it as a glTF using the method shown in step 2.
  2. Open VS Code and install the glTF Tools and STK GMDF Tools extensions. These can be found by simply searching the names in the extensions section as shown below.
User-added image
  1. Load glTF into VS Code by using the load option or dragging and dropping the file into the VS Code main window. If you import a .glb you need to create a .gltf by right-clicking the file name tab in VS Code and choosing “glTF: Import from GLB”.
  2. To add articulations to your glTF model, you need to create a GMDF file. The documentation for creating these files can be found here and can be created inside VS Code. Some example GMDF files can be found in the samples folder.
  3. Once you have defined all of your articulations you need to inject the GMDF into glTF. Technically STK can read a GMDF file for a model without injecting it into the glTF, but it is recommended to minimize the total number of files. For this to work properly the GMDF filename must be the same as the glTF file and should be in the same directory. With the glTF file selected in VS Code press Ctrl+Shift+P to search possible functions. Begin to search “GMDF” and select “Inject GMDF in glTF”.  When you select this option you notice that your GMDF data has been added to your glTF file.
  4. Once you have injected the GMDF file, it is ready to be exported as a .glb file. To do this, right-click on the filename tab and select Export to GLB. Once you do this, the file can be easily loaded into STK under the model properties for the object. Note that STK also accepts the glTF format but it is recommended to export as a GLB.
Resource File 2