Repository navigation
Closed
Labels
area:elementsWork in the elements area.area:ifcWork in the ifc area.priority:P1High-impact work needed for the MVP or beta path.type:featureNew product or library capability.
Description
Elements export and display without their Revit material. The viewer colours them by category (#350). This issue records what is measured so far on the way to real materials, and what is still missing.
Measured
Material objects:
- A material is serialised as
01 00 00 00 · u64 id, the same object shape as a run type (RE-52), with a class tag 0x47 bytes past the id. - The tag is
0x0a28on Revit 2024 and0x0a6bon Revit 2025. Found this way, the objects number exactly theOST_Materialsrecords on every file measured: Snowdon Towers 220, Core Interior 86, RE1 Architecture 69, Projeto1 and teste_export_2025 114 each. - Some objects open with the element-data header; others sit inside another element's data.
Shading colour and transparency:
- After the material's name, the first frame of this form holds the colour:
ff × 8;- an
f32transparency (0..1); - an
f32of 0.5 on every material seen; - four
u32COLORREFs (pattern colours); - the shading colour as a COLORREF (
r g b 00); - a
u32shininess (64 by default).
- Where a material's name reads, colour and transparency equal Revit's own IFC surface style of the same name on 43 of 43 materials, across the five files. The oracle is
IfcSurfaceStylename →IfcSurfaceStyleRendering→IfcColourRgbandTransparency.
Missing
- Names. The first framed string after the id is the name on project materials: "Glass", "Soil" and the like, read as for system types (Names for system-family types (walls, floors, roofs) from schema-serialised partition data #322). On most materials loaded with families it is not: on 120 of Snowdon's objects it reads
assetlibrary_base.fbx, an appearance asset reference. Only 28 of the 137 materials Revit's IFC writes for Snowdon are named this way. Some carry the name as a parameter entryi64 -1001203 · u32 0 · u32 n · UTF-16, 13 of Snowdon's objects. - The element-to-material link. This is the blocker. A wall type's record slots hold no material id, and neither does its serialised data, read as u64 or u32 (Core Interior type 17328, 0x865 bytes). The compound structure must be another object keyed by the type. Family instances take materials from type parameters, not yet traced.
Oracles
Revit's IFC4 exports:
- local only: Snowdon Towers, Projeto1, teste_export_2025;
- CI: RE1 (MIT) and Core Interior slim.
Revit's IFC styles geometry with the material's surface style, so an element's shaded colour can be measured end to end once the link is decoded.
Clean-room: byte observations only.
Metadata
Metadata
Assignees
Labels
area:elementsWork in the elements area.area:ifcWork in the ifc area.priority:P1High-impact work needed for the MVP or beta path.type:featureNew product or library capability.
Activity
DrunkOnJava commentedon Sep 23, 2026
Progress on the element-to-material link, measured on the same five files.
Host types' layers: decoded
The compound structure of wall, floor, roof and ceiling types is in the type's own serialised data:
f64width, ft;u64material id (ff×8= by category);u64deck profile id (ff×8= none);u32function (1 structure, 2 substrate, 3 thermal/air, 4 finish 1, 5 finish 2, 100 membrane);ff ff ff ffand a per-release tag, 0x10a6 on 2024 and 0x110e on 2025. On 2024 this follows the type's name string directly.u32 k, k ×2d 00,u32 0(2025 floors and ceilings).Default Wall.Colours: from the id, no name needed
The colour frame is found as the first one after the material's id. It equals Revit's surface style on 123 of 123 materials whose name is known. The 8 apparent misses were all a wrong name candidate, not a wrong colour.
Still blocking
assetlibrary_base.fbx).i64 -1001203entry (u32 0, optionally anotheru32 0,u32 n, UTF-16) names many family materials. It also holds binary strings on others. The best bounded rule names 92 of the 174 materials Revit exports, with too many garbage picks to ship.Next steps:
DrunkOnJava commentedon Sep 23, 2026
Wall exterior side, measured and not yet found.
04 00 08 01) in their data, so each wall's direction is known.DrunkOnJava commentedon Sep 24, 2026
The element-to-material link is found for host elements. It is not in the type's record but in the type's own element data (RE-53).
Layers. A wall, floor, roof or ceiling type's data holds a
u32layer count, then one 37-byte record per layer, exterior or top first:ff × 8for by category;The count is framed by
ff ff ff ffand a per-release tag (a6 10on 2024,0e 11on 2025), or byu32 k · k × 2d 00 · u32 0on 2025 floors and ceilings. Snowdon gives Revit's constituent sequence on 42 of 42 types, Core Interior on 4 of 4, and RE1 on its wall, floors and ceiling.Which side is the exterior. A wall's data carries its location line, a word and a flip flag after
ff ff ff ff 01 00 00 00. With the flag set, the first layer lies right of the location line's direction. This holds on all 416 Snowdon walls where it can be measured.Drawn. The glTF export and viewer now draw 2024 walls as their layers in their materials' shading colours. Scored end to end against Revit's IFC4 per-layer solids on Snowdon:
The colour check needs no names: the layer names its material by id, and Revit styles that layer's faces.
Still missing:
IfcMaterialLayerSetor surface style yet.Report:
reports/element-framing/RE-53-wall-layers.md. PR to follow.feat(elements): draw walls as their layers, each in its material's co…
DrunkOnJava commentedon Sep 24, 2026
Landed in #359: material shading colours, host type layers and wall sides. The glTF export and viewer draw Revit 2024 walls in their layers' colours. Names and the IFC layer sets remain open here.
DrunkOnJava commentedon Sep 24, 2026
Material names: measured, not yet shipped.
Ground truth came from walls and slabs: a type's layers name their materials by ElementId (RE-53), and Revit's IFC names the same layers' materials in the same order. On Snowdon Towers this gives 42 id-to-name pairs. Two of those pairs turned out to be swapped in Revit's layer order.
Where a material's own name sits in its object, on Revit 2024:
28 0aat +0x47), 8 zero bytes, thenu32 nand UTF-16 at +0x51 (for example "Mirror", "Matte Black"). A slot there that holdsu32 1followed by a BuiltInParameter id is not a name.0d b9 f0 ff ff ff ff ff),u32 0,u32 n, UTF-16.ff ff ff ff 49 01,u32 n, UTF-16.With that order, on Snowdon:
Revit 2025 differs:
5c 01, not49 01;49 96 f0 ff…) carries the name on RE1 ("Gypsum Wall Board"), where on Snowdon (2024) it carries a description ("Steel, mill finish");A per-release model of the material object is needed before names ship. The IFC layer sets (#88) follow once they do.
feat(elements): draw floors, roofs and ceilings as their layers stack…
fix(elements): reject a material shading frame read misaligned inside…
DrunkOnJava commentedon Sep 24, 2026
RE-58 reads material names by ElementId, including the 2025 layout this issue left open.
A material's own name field can hold parameter entries before its name:
i64 BuiltInParameter · u32 n · UTF-16 × n;i64 BuiltInParameter · u32 value.The name comes after them. On every such material measured, it ends with
ff ff ff ffand a release tag:17 0con 2024 and6b 0con 2025. RE1's floor finishes are an example: 8 entries come first, and the name sits at +0xf8.partition_materials::name_atreads, in order:-1001203entry.Named:
Every named material that Revit's own export styles by that name has Revit's colour for it, 174 of 174.
The IFC export now writes layer sets with these names. The layer names are Revit's, in Revit's order, on 3,321 of Snowdon's 3,322 layers and on all of Core Interior's and RE1's. Report:
reports/element-framing/RE-58-material-layer-sets.md.Still open here:
The IFC's material list is still the string heuristic's; replacing it with these named records is #34.
PR: #366.
feat(ifc): write layered walls, floors, roofs and ceilings as IfcMate…
fix(ifc): write the file's own named materials as IfcMaterial instead…
feat(ifc): name each material layer set Family:Type as Revit does (RE…
feat(viewer): highlight a layer's material from the element panel (#373)
feat(ifc): export family instances' materials from their type's geome…
45 remaining items
research(elements): RE-200 probe and report, a family instance's mate…
docs: family instances take their own material parameters' materials (D…
feat(materials): read mullion, column, rendered-content and type mate…
feat(materials): no <Unnamed> where a family shows no geometry withou…
fix(materials): last off-centre columns and hidden-form materials (Dr…
fix(materials): category materials from graphics styles; nested famil…
perf(materials): memoise material names and category styles; family w…
test(ifc): R2025 walls take their category's material (DrunkOnJava#355)…
research(elements): RE-201 to RE-206 probes and reports (DrunkOnJava#355
docs: native-record materials for family instances, columns and walls (…
docs: reconnaissance addenda for RE-200 to RE-206; family-instance ma…
docs(materials): say in code what the past-both-faces column rule res…
docs(status): family-instance, mullion, column and wall materials fro…
feat(ifc): family instances, mullions, columns and walls carry Revit'…