The ZIP archive holds the model as a set of files, its members. The pictures are PNG and JPEG, the materials and styles XML, and the model and its metadata trees of tagged values.
The members
| Member | Contents |
|---|---|
meta/model_thumbnail.png | The thumbnail, a PNG. |
meta/preview_thumbnail.png | A second picture, a PNG. |
meta/meta.dat | Metadata: the version, the units and the save history. |
materials/<name>/material.xml | One material, in XML. |
materials/<name>/<image> | The material’s texture image (JPEG seen). |
thumbnails/Component#N.png | Component thumbnails. |
styles/<name>/style.xml | A style, in XML. |
model.dat | The model, a tree of tagged values. Always the last member. |
The order seen is: the two pictures, meta.dat, the materials, the component
thumbnails, the styles and model.dat. A SketchUp 2023 file had 65 members;
the largest file seen, 693 MB, had 2,720, among them 1,361 material.xml
files whose textures were about 520 KB each.
Thumbnails
meta/model_thumbnail.png is the model’s thumbnail and
meta/preview_thumbnail.png a second picture of it, 256 × 256 pixels in the
files seen. Both are PNG files kept as Deflate
stored blocks, so their bytes can be
read straight from the file. meta.dat names them both, with the image
type 4, the same number the older files use for a PNG thumbnail.
meta.dat
A small tree of tagged values, 330 to 595 bytes once inflated in the files seen. It holds the version of the last save, the model’s units, a GUID, the names of the two pictures and the save history: every save of the model with the program, its version and the time. Its tags are listed on model.dat and meta.dat.
Materials
Each material has a folder under materials/ holding a
material.xml and, if it is textured, the texture image. The folder name is
the material name with characters such as < and >
replaced by _, so the material <Glass Blue Tint> is in
materials/_Glass Blue Tint_/; that rule is inferred from the names seen.
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<materialDocument xmlns="http://sketchup.google.com/schemas/sketchup/1.0/material" xmlns:mat="http://sketchup.google.com/schemas/sketchup/1.0/material">
<mat:material name="<Glass Blue Tint>" type="2" workflow="0" colorRed="9" colorGreen="175" colorBlue="241" colorizeType="0" trans="0.52000000000000002" useTrans="1" hasTexture="1">
<mat:texture textureFilename="C:\Program Files\@Last Software\SketchUp 3.0\Materials\\glass-tinted.jpg" xScale="24" yScale="24" avgColor="4293970184">
<mat:images>
<mat:image id="1" path="./glass-tinted.jpg" file_name="glass-tinted.jpg" />
</mat:images>
</mat:texture>
</mat:material>
</materialDocument>
The attributes seen on mat:material:
| Attribute | Example | Meaning |
|---|---|---|
name | <Glass Blue Tint> | The material’s name, with XML escapes. |
type | 2 | The material type: 0 colour, 1 textured, 2 textured and colourised. The numbers are those of the classic files’ material_type and of SketchUp’s own SUMaterialType; that the XML uses the same ones is an inference that every file seen fits. |
workflow | 0 | SketchUp’s SDK header material.h has SUMaterialWorkflow_Classic = 0 and SUMaterialWorkflow_PBRMetallicRoughness (1). That this attribute stores that enumeration is not documented, but the numbers fit; 0 in every file seen. |
colorRed, colorGreen, colorBlue | 9, 175, 241 | The colour, 0 to 255 each. |
colorizeType | 0 | 0 shift, 1 tint: the values of SUMaterialColorizeType. |
trans | 0.52000000000000002 | The transparency: 0 opaque, 1 clear. Opacity is 1 − trans, and only when useTrans is 1 (otherwise the material is opaque). skppy’s writer writes trans = 1 − alpha, and its public test suite skppy-tests reads the file back through SketchUp’s own SDK, whose SUMaterialGetOpacity returns the alpha written: SketchUp itself says it is transparency. openskp-rs reads it the same way and checks it against the Ruby API’s Material#alpha. The classic files’ transparency f64 runs the same way (a material with alpha 188 has 0.26). The explorer shows the opacity, 1 − trans. |
useTrans | 1 | Whether trans applies: 0 or 1. |
hasTexture | 1 | 1 when the material has a texture, given in the mat:texture element. |
The mat:texture element gives the original path of the texture file,
xScale and yScale (the size of the texture on the model, in
inches), and avgColor (a decimal u32, the texture’s average colour); and
mat:image the image’s path and file_name in the
material’s folder. A path starting ./ is relative to the
material’s folder; one starting materials/ or ref/ is from the
archive’s root (skppy). The original path in the example still names SketchUp 3.0’s own
materials folder, and the namespace URLs still name sketchup.google.com.
Later files can also carry a mat:pbrMR element, the physically based
settings. skppy reads metallicFactor (default 0) and
roughnessFactor (default 1) as attributes or child elements, and
enable_metalness and enable_roughness as children holding
1, true or yes; a factor counts only when it is enabled, and with no element the material
is metallic 0, roughness 1. None of the files seen has one. skppy’s writer also emits a
pbrPromoState attribute on mat:material; no source explains it,
and the explorer shows it as it is.
The bytes of avgColor are taken, like SketchUp’s other colours, as R, G,
B, A from the low byte; no source states it for this attribute.
Some materials are named Layer_ and a tag’s name, such as
Layer_A-Wall; that these hold the tags’ colours is an inference. The
explorer lists every material with its colour, opacity, texture, type,
workflow, scale, average colour, image path and PBR settings, and shows the textures
themselves.
Component thumbnails
The members under thumbnails/, named Component#1.png,
Component#2.png and so on, are PNG thumbnails of the model’s
components, which the explorer shows. Which component each one belongs to has not been
worked out here.
Styles
Each style is a style.xml in a folder under styles/. Every
file seen has two, [Simple Style] and [Simple Style]_1. The
file holds a sty:style element with a name and a
desc, then a run of sty:item elements:
<sty:item id="1000">
<t:variant type="4">1</t:variant>
</sty:item>
type | Value |
|---|---|
| 1 | A flag, 0 or 1. |
| 4 | A 32-bit signed number. SketchUp also writes its colour items as type 4 (below). |
| 5 | A colour as a 32-bit number; named by openskp-rs, but no real file seen uses it. |
| 6 | A single-precision float, such as AODistance 10 (openskp-rs; skppy’s writer emits (8102, 6, "10")). |
| 7 | A double. |
| 13 | The watermark list, item 5001 (below). |
| 0, 2, 3, 9 to 12, 14 | The other variant types of the classic files: empty, a byte, a u16, three doubles, sixteen doubles, a u32 (skppy). Not seen in a style.xml. openskp-rs gives types 2 and 3 widths of 2 and 4 bytes instead of skppy’s 1 and 2, and says only 1, 4 and 7 occur in its files. |
Colours. SketchUp writes its colour items (1014, 2002, 2003, 4000, 4001
and 4003) as type 4, a signed 32-bit number whose little-endian bytes are R, G, B, A
(openskp-rs): -16777216 is opaque black, -3754078 the face back
colour #A2B7C6. So the item’s id, not its type, says it is a colour; the classic files’
style options hold the same values. The explorer shows these items as colours.
Item 5001, the watermark list, is in every style.xml seen, as type 13.
Its t:variant declares a namespace (xmlns:n0, ending
…/1.0/wmlist) and holds an element rather than text:
<t:variant type="13" xmlns:n0="http://sketchup.google.com/schemas/sketchup/1.0/wmlist">
<n0:wmlist count="0" />
</t:variant>
skppy’s writer (writer/styles.py) gives the full form. n0:wmlist
has a count: 0 with no watermarks, otherwise the number of screen images.
Inside it, n0:screenimages holds one n0:screenimage named
<MODEL SPACE>, then one per watermark with the attributes
alphaScale (the opacity), background, info_filename,
info_found, info_time, intensForAlpha,
maintainAR, name, position (the classic codes, 0
centre to 5 tiled; 4 when tiled), fittingType, stretchType,
scale, stretched and tiled. Each holds
n0:images with one n0:image: id (the watermark’s
ID), path (watermarks/<name>.png or .jpg) and
file_name. The explorer shows the count and each screen image with its
attributes and image path.
The item IDs are the same keys as the options of the classic files’ CSkpStyle.
openskp-rs names seventeen: 1000 EdgeDisplayMode, 1005 LineExtension, 1006 DrawSilhouettes,
1007 SilhouetteWidth, 1009 DepthQueWidth, 1011 LineEndWidth, 1012 JitterEdges, 1014
ForegroundColor, 2001 RenderMode (0 wireframe, 1 hidden line, 2 shaded, 5 monochrome; 3 not
confirmed), 2002 FaceFrontColor, 2003 FaceBackColor, 4000 BackgroundColor, 4001 SkyColor,
4002 DrawHorizon, 4003 GroundColor, 4005 GroundTransparency, 8102 AODistance; skppy’s
writer adds 5001, the watermark list. The others are not published. The explorer lists every style and its items, with these names.
model.dat
The model itself: its geometry, components, tags, scenes and options, as one large tree of tagged values, always the last member of the archive. In the files seen it was 3.8 MB to 21.9 MB stored and 17.5 MB to 86.6 MB once inflated. Its layout, and what is known of its tags, is on model.dat and meta.dat.