Skip to content

Conversation

Parik27
Copy link
Owner

@Parik27 Parik27 commented Sep 29, 2025

This is rewrite of the current map import/export.

The basic idea is that the map importer will import empty objects that will contain information about a certain map section entry. So for inst's in ipls, we will have an empty that will point to an ide file and contain any information that is required. There will be an empty associated with the ide file which will contain information that is stored in the ide file and which will point to the actual dff file. Using collection instancing, this relationship can be shown as a rendered map in Blender.

This empty system will make it easier to export and import ide/ipl files since all the information is stored already in the empties and all the exporter has to do is collect the empties and convert it into the relevant format.

Regarding the code implementation, I have written a system to define map section entry data types using Python dataclasses and automatically generate the Blender GUI code for that. This will allow quick prototyping and make it easier to implement support for more sections faster without having to define each field in 5 different places. These data types can have formats associated with them that will describe how they can be read from different file types. So far there are two of these file types, MapBinarySectionFormat and MapTextSectionFormat which corresponds to the SA binary ipls and the normal ide/ipl formats. It is possible to override the readers and writers by creating a new class that inherits from these two classes and it will automatically be used while importing the relevant map file.

In addition, there's also a placeholder map section that will simply store any data that the parser couldn't read. So sections for which we haven't added support will be exported as-is and make it easier to make simple map edits without breaking everything.

In future, more file types can be defined such as MTA's map files, Lua/CLEO scripts, etc.

TODO List:

  • Filter properties based on whether the format supports it or not
  • Ability to choose which game to export for
  • Ability to export binary IPLs from Blender
  • Automatic conversion of formats while exporting if game/type different
  • Show pretty names for map properties in Blender (and also map descriptions to docstrings)
  • Figure out a way to show img import in Blender
  • Automatic import dff/txd files from gta3.img
  • Add more export formats (like lua/map/whatever)
  • Setup collection exporters automatically after import
  • Detect ipl/ide game somehow?
  • Automatic map import by choosing game root
  • Export inside gta3.img???
  • Button/operator to easily access the instanced object for editing purposes.
  • Add to the add object menu
  • Something like the asset browser for placing inst objects in the scene.
  • Support custom gizmos for map sections
  • Add support for the remaining map sections
  • Don't import dependencies that already exist in the scene.
  • Properly name the created empties in the scene
  • Move imported dff's to their own collection that is hidden by default to prevent clutter at 0,0,0
  • Option to perform instancing on existing map objects in the scene. (say I import ipl first then ide and then models)
  • Feature parity with old map import/export
    • Map col files
    • Skip LODs option
    • Progress for import
    • ...?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant