materials

Create, configure, and assign materials in Lens Studio scenes via GraphQL.

16|2|Updated Apr 13, 2026
One-click install
npx skills add https://github.com/lens-studio-devs/ls-extensions --skill materials-lens-studio-devs
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: materials
Source: https://github.com/lens-studio-devs/ls-extensions/tree/main/plugins/ls-clad/skills/materials
Command: npx skills add https://github.com/lens-studio-devs/ls-extensions --skill materials-lens-studio-devs

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Working with materials in Lens Studio involves two distinct APIs (Editor/GraphQL and Runtime Lens API), and using the wrong one causes silent failures that are hard to debug. This Skill provides the correct property paths, presets, and assignment patterns so materials behave as expected. ## Core Features & Use Cases - Material Creation: Create materials from presets like SimplePBRMaterialPreset, PBRMaterialPreset, and UnlitMaterialPreset using asset-graphql mutations. - Property Configuration: Set baseColor, metallic, roughness, and texture slots via the passInfos.0 property path prefix, with guidance for imported GLB materials that use different property names. - Material Assignment: Assign materials to RenderMeshVisual components using REFERENCE-typed setProperty calls, plus handling of screen-space Image materials. - Use Case: You need a red metallic sphere in your Lens. Use this Skill to create a SimplePBRMaterialPreset, set baseColor to red and metallic to 1.0, then assign it to the sphere's RenderMeshVisual component. ## Quick Start Create a red PBR material in Lens Studio and assign it to the selected scene object.

Frequently Asked Questions about materials

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I create a material in Lens Studio with GraphQL?

Use the createAssetFromPreset mutation with a preset name like SimplePBRMaterialPreset, a material name, and a destination folder relative to Assets. The mutation returns the new material's id and name for further configuration.

How do I set baseColor on a Lens Studio material?

Call setProperty with the material asset id, propertyPath passInfos.0.baseColor, valueType VEC4, and an RGBA value string with components from 0 to 1. This path applies to the GraphQL Editor API, not runtime Lens scripts.

Why does mat.mainPass.baseColor not work in ExecuteEditorCode?

mat.mainPass.baseColor is Runtime Lens API only and works exclusively in TypeScript Lens scripts. In ExecuteEditorCode or GraphQL you must use setProperty with the passInfos.0.baseColor path instead.

How do I assign a material to an object in Lens Studio?

Query the scene object to find its RenderMeshVisual component id, then call setProperty on that component with propertyPath materials.0, valueType REFERENCE, and the material asset id as the value. Materials attach to the component, not the scene object.

Why does setting ENABLE_GLTF_LIGHTING via setProperty do nothing?

For imported GLB materials, lighting mode is a preprocessor define in the pass's defines array, not a settable property, so setProperty returns success but changes nothing. Use ExecuteEditorCode to edit passInfos defines directly and read the array back to confirm.

When should I use a shader graph instead of material presets?

Use presets with property tweaks whenever the desired look can be achieved that way. Escalate to the shader-graph skill only when the user explicitly requests a custom shader or no preset combined with property changes can produce the requested result.