-
Notifications
You must be signed in to change notification settings - Fork 0
Sectors and Portals
A sector is a room: a closed mesh with its normals facing inward, which the engine tests points against to know where you are. Add ▸ 4DS ▸ Sector builds one.
The export refuses a sector that:
- does not enclose a volume,
- is not closed (it names how many open edges there are), or
- has outward-facing normals.
A portal is the opening between two sectors: a flat outline of at most eight
corners, parented to its sector and named after it with _portal1, _portal2 and so
on. Add ▸ 4DS ▸ Portal builds one on the selected sector.
The eight-corner limit is real — the outline is stored in a fixed slot of eight, so a ninth does not fit.
Sectors and portals carry a panel of their own. Two bits belong to the engine and are refused on export if you set them: the Parsing and Prepared bits, which the game sets at load time for its own bookkeeping.
A sector is drawn as a wireframe in cyan and a portal in purple, and the Sectors box in the 4DS Model tab carries a pair of switches for each:
| What it does | |
|---|---|
| Solid | Shows the faces rather than the wires. A sector is filled by its own display; a portal is drawn filled by the overlay, which is what lets it keep its place in the depth of the scene. |
| In Front | Draws them over whatever stands in front of them, so a room can be seen from outside the building. |
Their colors are shown by setting the viewport to color objects by object, which is what a sector's cyan and a portal's purple live on - a viewport colors by material until it is told otherwise, so filling either of them asks for that once.
A portal lies flat in a wall of the sector it belongs to, so the two surfaces are in the same place and would fight over every pixel. A filled portal is brought a hair toward whoever is looking - not into the room, because it has to win that wall from either side of it - and it is drawn both ways round, since a portal has no front: in the file it is a ring of points and the plane they lie in, with no faces at all, and the game walks the same portal from either side.
What a sector shows follows the scene as it changes. Whether a sector-typed mesh counts as a portal comes from its name and the sector it hangs off, and both can change at any moment, so parenting one under a sector or renaming it is picked up straight away, and so is opening a file saved before these switches existed.
Tip
A mission scene is the best reference: import one, and look at how its sectors and portals are arranged.
Mafia Toolkit 1.1.0 · Blender 5.2+ · Releases
Getting Started
Core Concepts
Frame Types
Characters & Animation
Help