Everything after the version map is
the model, written as an MFC CArchive stream. The first parts, up to the
options, have the same layout in every file seen and are described field by field below.
The objects after them follow the class versions in the map and are not decoded here.
All numbers are little-endian, and every string is a
CString.
Layout
| Part | Size | Contents |
|---|---|---|
| Model fields | 12 | Three u32 values of unknown meaning. |
| Thumbnail | varies | A CDib object: a new class record, an image type, a length and a PNG. |
| Unknown | 14 | 01 00 00 00 and ten zero bytes. |
| Options | varies | Named groups of typed values: units, pages, slideshow and others. |
| Objects | to the end | Materials, layers, component definitions, entities and attributes. |
Model fields
Straight after the map’s end entry come three 32-bit numbers. Their meaning is not known.
| Offset | Size | Type | Name | Seen |
|---|---|---|---|---|
| 0 | 4 | u32 | Unknown 1 | 1 or 2. |
| 4 | 4 | u32 | Unknown 2 | 1200 (B0 04 00 00) in every file. |
| 8 | 4 | u32 | Unknown 3 | A small number: 1, 2 or 6 in the classic files seen. |
01 00 00 00 B0 04 00 00 01 00 00 00
Three fields lead straight to the thumbnail’s class record. The explorer’s parser checks this: a file whose map is followed by five fields is a SketchUp 2017 to 2020 model.
Thumbnail
The first object after the map is a CDib, the picture SketchUp shows in its
file dialogs. It holds a complete PNG file.
| Offset | Size | Type | Name | Meaning |
|---|---|---|---|---|
| 0 | 10 | class record | Class | FF FF 03 00 04 00 43 44 69 62: a new class, schema 3, the 4-letter name CDib. |
| 10 | 4 | u32 | Image type | 4 for the PNG thumbnail. JPEG textures inside materials use the same class with type 1. |
| 14 | 4 | u32 | Length | The size of the image in bytes. |
| 18 | length | bytes | Image | A complete PNG file, starting 89 50 4E 47. |
FF FF 03 00 04 00 43 44 69 62 04 00 00 00 19 11 00 00 89 50 4E 47 …
The thumbnails seen are PNGs of 4 KB to 90 KB. The SketchUp 8 file’s is 128 × 69
pixels (its IHDR chunk holds 00 00 00 80 00 00 00 45), the 2015 and 2016
files’ 256 × 256. A JPEG texture in the SketchUp 8 file starts
03 80 01 00 00 00 E2 32 00 00 FF D8 …: a new CDib object, type
1, 13,026 bytes, then the JPEG.
The explorer shows the thumbnail straight from the file.
After the thumbnail
Fourteen bytes whose meaning is not known: 01 00 00 00 and then ten zero
bytes, in every file seen. The explorer skips to the next string marker and reports a
run of another length.
01 00 00 00 00 00 00 00 00 00 00 00 00 00
Options
Next come the model’s options, in named groups.
| Part | Type | Meaning |
|---|---|---|
| Unknown string | CString | Empty in every file seen. |
| Unknown | u32 | 2 in every file seen. |
| Group count | u32 | The number of option groups that follow: 4 or 5 seen. |
| Groups | Each a CString name, then its options, then an empty CString that ends the group. |
Each option is a key, a type byte and a value:
| Part | Type | Meaning |
|---|---|---|
| Key | CString | The option’s name. |
| Type | u8 | How the value is stored (below). |
| Value | varies | The value. |
| Type | Value |
|---|---|
| 4 | i32, a signed 32-bit integer |
| 6 | f64, a 64-bit floating-point number |
| 7 | u8, true or false: 0 false, 1 true |
| 10 | CString |
Two options from the PageOptions group, ShowTransition set to
true and TransitionTime set to 2.0:
FF FE FF 0E 53 00 68 00 6F 00 77 00 54 00 72 00 61 00 6E 00 73 00 69 00 74 00 69 00 6F 00 6E 00 07 01
FF FE FF 0E 54 00 72 00 61 00 6E 00 73 00 69 00 74 00 69 00 6F 00 6E 00 54 00 69 00 6D 00 65 00 06 00 00 00 00 00 00 00 40
Groups seen:
| Group | Options seen |
|---|---|
PrintOptions | none (an empty group) |
PageOptions | ShowTransition, TransitionTime |
SlideshowOptions | LoopSlideshow, SlideTime |
UnitsOptions | LengthPrecision, LengthFormat, LengthUnit, LengthSnapEnabled, LengthSnapLength, AnglePrecision, AngleSnapEnabled, SnapAngle, SuppressUnitsDisplay, ForceInchDisplay, AreaUnit, VolumeUnit, AreaPrecision, VolumePrecision and others |
NamedOptions |
The same key, type and value form appears elsewhere in the stream, in attribute
dictionaries: LastModifiedByKey with type 10 and an empty string
(0A FF FE FF 00), VersionKey with type 4 and 1000
(04 E8 03 00 00).
To read the options: read the empty string, the u32 2 and the group count. For each group, read its name; then, until the next string is empty, read a key, a type byte and a value of that type; then read the empty string. A type other than 4, 6, 7 or 10 is not known, and the explorer stops there.
The objects
The rest of the file is the model itself as CArchive objects: materials,
layers, component definitions, groups, faces, edges, vertices, text, dimensions,
scenes and their attributes, each introduced by a class tag
and laid out according to its class version in the map. These layouts are not decoded
here, and the explorer shows the rest of the file as one range. Two lists can still be
found in it by searching.
Materials
The materials are written as a u32 count, then the first material with the
CMaterial class record (FF FF 0C 00 09 00 and the name),
then the others, each with that class’s 8000 | index tag. Each material
starts with a two-byte preamble, 00 00 when it carries no attributes, and
then its name as a CString.
0D 00 00 00 FF FF 0C 00 09 00 43 4D 61 74 65 72 69 61 6C 00 00 FF FE FF 05 62 00 6C 00 61 00 63 00 6B 00 …
0F 80 00 00 FF FE FF 08 3C 00 42 00 65 00 69 00 67 00 65 00 3E 00 31 00 …
A material without a texture in the SketchUp 8 file goes on after its name with a
u16 0, four colour bytes (such as D3 BD 90 FF), an empty CString, 16 bytes
and a u8. OpenSKP reads the 16 bytes as 8 bytes and an f64 opacity; that has not been
checked here. The classic files seen hold from 4 to 59 materials.
Layers
The layers (called tags in later SketchUp) follow the same pattern: a u32 count, the
first layer with the CLayer class record (FF FF 02 00 06 00
43 4C 61 79 65 72), the others with its tag, and each with the same preamble
and its name.
How the explorer finds them
- Search the object stream for the class name with its length before it (for
materials
09 00andCMaterial), and check forFF FFand a schema in front of it. - Read the u32 count just before the class record.
- After the name, skip up to eight zero bytes to the first CString: the first name.
- Look for the next tag with the top bit set that is followed by zero bytes and a string: that is the class’s tag and the second name.
- Search for that tag again, read the name after it, and repeat until the count is reached.
So the lists are found by searching, not by reading every object, and the explorer labels them so. In most files seen every name is found. An object that carries attributes has a longer preamble, and its name is missed; the explorer then shows how many of the count it found.