Skip to content

Collisions Exporter Addon

RishiMenon2004 edited this page Mar 21, 2023 · 7 revisions

Blender2MTS - Collision Groups Exporter

Installation

NOTE: Please note that this will not work on any version below 2.8!

  1. Run Blender in Administrator Mode (Only for installation)

  2. Edit -> Preferences -> Add-ons

  3. On the top of the window, click on Install...

  4. Select the "mts_collision_group_exporter.py" file and click install

  5. Once installed, when it shows you the installed addon, click the checkmark and expand the panel.

  6. At the bottom of the panel click on Install Dependencies. This will install a python module json5 to export .json files that have comments in them.

Using the addon

Set Up

Create a cube

Making Collision Groups

Go to Properties Panel -> Scene Properties -> MTS/IV Collision Groups

Collision Groups Panel

Inside the panel click on the + button to add a collision group.

You can rename the collision group and adjust it's properties with the new options that have appeared below. You can also view and remove the collision boxes that are assigned to this collision group.

Collision Group Properties

Making Collisions

With the cube selected, created in the set up step, go to Properties Panel -> Object Properties -> MTS/IV Collision Properties

Collision Properties

Use the various input boxes to adjust the collision box properties.

After this there are two ways to set the sizing of the collision box(s).

Scale the cube to your liking.

Automatic Subdivision Manual Subdivision
If the X and Y dimensions are not the same, the box will automatically be divided into boxes the size of whichever side is shorter. Scale the cube to cover the area you want. Set the subdivision width and height to divide the cube into multiple collision boxes, of the provided height and/or width, that span the covered area.
Automatic Subdivision Manual Subdivision

If you want the boxes to be on a diagonal, rotate the cube in the desired direction IN OBJECT MODE (NOT EDIT MODE)

Importing and Exporting JSONs

There are three locations where the import and export buttons can be found:

  • File -> Import/Export -> MTS/IV Instruments (.json)

    File Import/Export

  • Numbers Panel (Open with N key) -> MTS/IV Tab -> MTS/IV Instrument Tools -> Import/Export Instruments

    Collision Tools

  • Properties Panel -> Object Properties -> MTS/IV Instrument Properties -> Import/Export Instruments

    Collision Box Properties

Import

  1. This opens up the file browser. Navigate to the the json you want to import. This json must include the collisionGroups section.

  2. Click on "Import Collisions" or hit enter.

  3. This will create collision groups and collision boxes with the provided transforms and HUD positions.

Export

  1. Clicking on the export button will open the file browser. Navigate to the save location and enter the file name.

  2. Click on "Export Collisions" or hit enter.