Material
A surface appearance that can be applied to faces — color, texture, transparency, or PBR properties.
Materials control how geometry looks when rendered. A material can be a simple flat color, a color with transparency, a texture image, or (in SketchUp 2025+) a full PBR material with metallic, roughness, normal, and ambient occlusion maps.
You create materials inside an operation with
op.createMaterial(), then apply them to faces. Query all
materials in the model with model.getMaterials().
See the Material Examples for more ways to use them.
Example
Section titled “Example”let model = await SketchUpApi.getActiveModel();
// Create a colored material and apply itawait model.performOperation(async op => { const matRef = op.createMaterial('Blue Glass'); op.materialSetColor( matRef, new SketchUpApi.Color(100, 150, 255) ); op.materialSetAlpha(matRef, 0.5);
const faceRef = op.createFace(model, [ [0, 0, 0], [60, 0, 0], [60, 60, 0], [0, 60, 0] ]); op.faceSetFrontMaterial(faceRef, matRef);}, 'Create blue glass face');
// Query materials backlet materials = await model.getMaterials();let mat = materials.values.find( m => m.name === 'Blue Glass');console.log(mat.color.toHex());// => #6496FFFFconsole.log(mat.alpha);// => 0.5Properties
Section titled “Properties”
readonlyalpha:number
Opacity from 0 (fully transparent) to 1 (fully opaque).
Set via op.materialSetAlpha(matRef, value).
ambientOcclusion
Section titled “ambientOcclusion”
readonlyambientOcclusion:Readonly<AmbientOcclusionTextureInfo>
Ambient occlusion map settings (PBR workflow only).
Ignored when workflow is not PBR.
attributes
Section titled “attributes”
readonlyattributes:Attributes
Custom attribute dictionaries attached to this material.
readonlycolor:Color
The solid color of this material. Even textured materials have a color that shows through transparent texture areas.
colorizeDeltas
Section titled “colorizeDeltas”
readonlycolorizeDeltas: readonly [number,number,number]
HSL deltas applied when colorizing: [hue, saturation, lightness].
colorizeType
Section titled “colorizeType”
readonlycolorizeType:MaterialColorizeType
How the colorize effect is blended with the texture.
displayName
Section titled “displayName”
readonlydisplayName:string
The user-visible name shown in the Materials panel, like
"Brick_Antique". May differ from name for built-in
materials that have localized display names.
readonlyid:number
The persistent ID that uniquely identifies this material.
materialType
Section titled “materialType”
readonlymaterialType:MaterialType
Whether this material uses color only, texture, or both.
metallic
Section titled “metallic”
readonlymetallic:Readonly<MetallicTextureInfo>
Metallic map settings (PBR workflow only).
Ignored when workflow is not PBR.
readonlyname:string
The internal name used to reference this material in API
calls, like "Brick_Antique".
normal
Section titled “normal”
readonlynormal:Readonly<NormalTextureInfo>
Normal map settings (PBR workflow only).
Ignored when workflow is not PBR.
ownerType
Section titled “ownerType”
readonlyownerType:MaterialOwnerType
What kind of entity owns this material (model-level, layer, etc).
roughness
Section titled “roughness”
readonlyroughness:Readonly<RoughnessTextureInfo>
Roughness map settings (PBR workflow only).
Ignored when workflow is not PBR.
texture
Section titled “texture”
readonlytexture:Texture|undefined
The texture image applied to this material, or undefined
if it’s a solid-color material. Access texture.imageWidth
and texture.imageHeight for pixel dimensions.
SDK 2.12.0 Protocol 1.9.0
readonlytype:Material=EntityType.Material
useAlpha
Section titled “useAlpha”
readonlyuseAlpha:boolean
Whether the alpha channel is actively used for rendering.
workflow
Section titled “workflow”
readonlyworkflow:MaterialWorkflow
Whether this material uses the classic workflow or PBR (physically-based rendering). PBR is only available in SketchUp 2025 and later.
SDK 2.12.0 Protocol 1.9.0
Accessors
Section titled “Accessors”sketchupId
Section titled “sketchupId”Get Signature
Section titled “Get Signature”get sketchupId():
SketchupId
JS API identifier for this material. Pass it to API methods that accept a sketchupId.
Returns
Section titled “Returns”typeName
Section titled “typeName”Get Signature
Section titled “Get Signature”get typeName():
string
Returns a named variant of the type field.
SDK 2.35.0
Returns
Section titled “Returns”string
Methods
Section titled “Methods”exportThumbnail()
Section titled “exportThumbnail()”exportThumbnail(
fileType,options):Promise<string>
Exports a thumbnail preview of this material as a
base64-encoded image. For solid colors the result is a
square; for textured materials the aspect ratio is preserved
and maxSize limits the largest dimension.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
|
|
|
|
|
|
{ |
|
|
|
|
‐ |
Returns
Section titled “Returns”Promise<string>
SDK 2.15.0 Protocol 1.12.0
getSkm()
Section titled “getSkm()”getSkm():
Promise<string>
Exports this material as a .skm file (SketchUp Material
format) and returns the data as a base64-encoded string.
Returns
Section titled “Returns”Promise<string>
SDK 2.30.3 Protocol 1.9.0
refresh()
Section titled “refresh()”refresh():
Promise<Material>
Re-fetches this material from SketchUp to get its current state (color, texture, alpha may have changed).
Returns
Section titled “Returns”Promise<Material>
toString()
Section titled “toString()”toString():
string
Returns
Section titled “Returns”string
Deprecated
Section titled “Deprecated”export()
Section titled “export()”export():
Promise<string>
Returns
Section titled “Returns”Promise<string>
SDK 2.12.0 Protocol 1.9.0