GithubHelp home page GithubHelp logo

onemillionthusername / io_export_qmap Goto Github PK

View Code? Open in Web Editor NEW

This project forked from c-d-a/io_export_qmap

0.0 0.0 0.0 55 KB

.map exporter for Blender

License: GNU General Public License v3.0

Python 100.00%

io_export_qmap's Introduction

Blender MAP Exporter

This addon allows exporting Blender scenes to idTech .map file format.

Supported Blender versions: 2.83 - 4.0+
Supported game formats: Quake, Half-Life, Quake 2, Quake 3, Doom 3, Quake 4
Other Quake-derived games (Jedi Academy, Call of Duty, etc) are untested, but hopefully also compatible.

Meshes will be exported to brushes (either as individual faces, or as convex hulls of each mesh). Curves and metaballs are treated as meshes. NURBS surfaces can either be exported as patches, or be converted to meshes on export. The addon will also export lights, cameras, and empty objects as point entities, with any custom properties they may have.

The addon offers UVs in "Standard Quake", "Valve220" and "Brush Primitives" formats, custom grid and precision, automatic triangulation of concave surfaces, detail flag assignment, export to clipboard in plaintext and GTK formats, geometry scaling with adaptive light intensity, and automatic spotlight creation.

Installation

Download io_export_qmap.py, then select it under "Edit > Preferences > Add-ons > Install".
Older Blender versions may show an error about missing preferences on first setup - try enabling the addon again.
The addon preferences allow you to change the default settings used in the export dialogue. They only take effect after restarting Blender.
prefs

Mesh Options

The map format requires each brush to be convex.
There are many ways to represent a mesh with brushes, each with their pros and cons.
mesh

For complex scenes, you can override mesh export mode on a per-object basis:
override

Formats

In most cases .map file is an intermediary between the editor and the compiler. So in practice, the output format can be anything, as long as it's supported by the other tools. For example, Quake 1 tools have broad support for Valve220 UV format, but only very limited support for patches.

Planes

Brushes are defined by planes, rather than by individual vertices. This is an important distinction to keep in mind, because when exporting detailed geometry, you will need enough precision to represent each plane. Otherwise, any face with more than three verts may end up leaving gaps. Soft maximum of 17 decimal places roughly matches TrenchBroom's precision.

Most games use the original Quake format, defining planes by three verts. Doom 3 introduced a new format, using a plane equation. While the original format meant that verts of neighboring triangles never drift apart, with Doom 3 planes you get no such guarantee, so you might want to use higher precision even on simple meshes.

UVs

UV scale depends on texture size. The exporter will use the first texture it finds in the material's node tree, or, failing that, the user-definable fallback size.

Texture coordinates in the legacy "Standard Quake" format have the broadest support, but also potentially lose a lot of information, as it doesn't support shearing (only rotation and scale along world axes). The two other formats, "Valve220" and "Brush Primitives", are more advanced and have similar capabilities to each other. The choice depends on whether your editor and compiler support them.

Since the .map format doesn't store individual vertices, it doesn't store individual verts' UVs either. Instead, it defines texture coordinates per plane. The exporter uses two arbitrarily selected edges for this task. In practice, this means that it is impossible to maintain perspective warp (e.g. on curved pipes), unless you triangulate every face in advance.

Flags

Quake 2 introduced flags for defining various special properties (lights, etc). The flags carried over to Quake 3, still remained in vestigial form in Doom 3, and were removed in the Quake 4 format.
The exporter currently only supports the Detail flag. For any face belonging to an object, a collection, or assigned a non-zero attribute with "detail" anywhere in their name, the exported surface will get its Detail flag set.

Clipboard

For convenience, the exporter can put the map data into the system clipboard, instead of writing it to a .map file. In this case, the filename in the export dialogue is ignored, and the data is ready to be pasted directly into an open map in your editor of choice. Some functionality may depend on the editor automatically re-assigning the entity names and targets.

Supported formats: text clipboard (TrenchBroom), GTK clipboard (GTKRadiant, NetRadiant, etc).
GTK clipboard is currently Windows-only. DarkRadiant clipboard is not supported.

io_export_qmap's People

Contributors

c-d-a avatar joeedh avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.