Skip to content

Blender plugin to import and export Torque DIF interiors.

Notifications You must be signed in to change notification settings

RandomityGuy/io_dif

Repository files navigation

IO DIF

Blender plugin to import and export MBG Torque DIF interiors and Torque Constructor CSX files. Supported Blender Versions: 2.8.0 to 3.3

Note

The difs generated by this plugin ONLY work in Marble Blast not because of the dif versions but because of the very way the difs are constructed. A lot of stuff is not generated because MB does not require it and some unconventional algorithms are used which specifically make use of how MB makes use of difs. The collision WILL not work anywhere outside MB. Even raycasts don't work.

Features

Import DIF

  • Powered by hxDIF
  • Supports PathedInteriors and its path
  • Supports embedded GameEntities with properties
  • Supports loading textures

Import CSX

  • Import Torque Constructor CSX files
  • Supports Entities and textures

Export DIF

  • Powered by DifBuilder
  • Export support for PathedInteriors and Markers
  • Export support for GameEntities and its properties
  • Additional export parameters provided by obj2difPlus

Installation

Download the plugin from Releases and install it how you normally install blender plugins.

How to

Import

File > Import > Torque (.dif).
It can't be any more simpler than that.

If you want to load a Torque Constructor (.csx) file and create a Torque DIF, use File > Import > Torque Constructor (.csx).

Export

File > Export > Torque (.dif)

Additional export options

Flip Faces: Flip the normals of the dif, incase the resultant dif is inside out.
Double Faces: Make all the faces double sided, may increase lag during collision detection.

DIF Properties Panel

Located in the object properties panel

  • Interior Entity Type:
    • InteriorResource: normal static interior type
    • PathedInterior: moving platform type interior
      • Marker Path: a curve object that describes the path of the moving platform
        • initialPathPosition: set using the "Evaluation Time" parameter located in Curve > Object Data Properties > Path Animation
        • totalPathTime: time it takes for the moving platform to complete the path, set using the "Frames" parameter located in Curve > Object Data Properties > Path Animation.
    • Game Entity: represents an entity in the dif such as items
      • Game Class: the class of the entity such as "Item", "StaticShape",etc
      • Datablock: the datablock of the item.
      • Properties: a list of additional key value pairs which will be set to the object on Create Subs

Limitations

  • No Trigger support: I tried but Torque was being Torque even when I successfully embedded them into difs.
  • No Game Entity rotation support: there isnt even a rotation field for Game Entities in difs, and torque doesnt even use the rotation field explicitly passed as a property
  • Rarely the Torque Constructor CSX import will incorrectly rotate brushes.

Previews

Imgur

Imgur

Build

Checkout the repository correctly

git checkout https://github.com/RandomityGuy/io_dif.git
git submodule init
git submodule update
git submodule foreach git submodule init
git submodule foreach git submodule update

Then build DifBuilderLib.dll using CMake.
Copy resultant DifBuilderLib.dll to blender_plugin/io_dif folder.
Copy blender_plugin/io_dif to your blender plugins folder.

Credits

Thanks HiGuy for your incomplete blender dif import plugin