Log inGet started
Package

set_material.procNode

Newest version

This package holds more than this page lists. See all of its files in its world.

README.md

geometry.set_material

Attach a material to a geometry. The shape is the input's own; only the material differs. The material is what a material node answers (material.pbrMat, material.shader, io.import of a .material) or a reference to a material asset; the record kind it names is stated on the detail attribute records. io.output draws the geometry with it and io.export saves it with the mesh.

Inputs

  • geometry (Geometry). What the material is put on. A copy carrying it comes out, and the wired value keeps whatever material it already had.
  • material (Points | Material | AssetRef<material>, optional). The material to attach: what a material node answers, or a reference to a material asset, written asset.resolve("<identity>", "material"). Left out, the geometry keeps the material it has.

Outputs

  • geometry (Geometry). The geometry carrying the material.
local red = g.material.pbrMat({ baseColor = { 1, 0.1, 0.1, 1 }, roughness = 0.4 })
local ball = g.geometry.set_material({ geometry = g.mesh.sphere({}), material = red })